annotate toolboxes/FullBNT-1.0.7/KPMstats/logist2FitRegularized.m @ 0:cc4b1211e677
tip
initial commit to HG from
Changeset:
646 (e263d8a21543) added further path and more save "camirversion.m"
author |
Daniel Wolff |
date |
Fri, 19 Aug 2016 13:07:06 +0200 |
parents |
|
children |
|
rev |
line source |
Daniel@0
|
1 function [net, niter] = logist2FitRegularized(labels, features, maxIter)
|
Daniel@0
|
2
|
Daniel@0
|
3 if nargin < 3, maxIter = 100; end
|
Daniel@0
|
4
|
Daniel@0
|
5 [D N] = size(features);
|
Daniel@0
|
6 weightPrior = 0.5;
|
Daniel@0
|
7 net = glm(D, 1, 'logistic', weightPrior);
|
Daniel@0
|
8 options = foptions;
|
Daniel@0
|
9 options(14) = maxIter;
|
Daniel@0
|
10 [net, options] = glmtrain(net, options, features', labels(:));
|
Daniel@0
|
11 niter = options(14);
|
Daniel@0
|
12 %w = logist2Fit(labelsPatches(jValidPatches), features(:, jValidPatches));
|
Daniel@0
|
13
|