Changeset 82
- Timestamp:
- 08/20/13 10:34:55 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
prextra/loglc2.m
r37 r82 28 28 % Handle untrained calls like W = loglc2([]); 29 29 if nargin == 0 || isempty(A) 30 B = mapping(mfilename);30 B = prmapping(mfilename); 31 31 B = setname(B, name); 32 32 return; 33 33 34 34 % Handle training on dataset A (use A * loglc2, A * loglc2([]), and loglc2(A)) 35 elseif (nargin == 1 && is a(A, 'dataset')) || (isa(A, 'dataset') && isa(W, 'double'))35 elseif (nargin == 1 && isdataset(A)) || (isdataset(A) && isa(W, 'double')) 36 36 if nargin < 2 37 37 W = 0; … … 45 45 % Train the logistic regressor 46 46 [data.E, data.E_bias] = train_logreg(+A', getnlab(A)', W); 47 B = mapping(mfilename, 'trained', data, getlablist(A), k, c);47 B = prmapping(mfilename, 'trained', data, getlablist(A), k, c); 48 48 B = setname(B, name); 49 49 50 50 % Handle evaluation of a trained LOGLC2 W for a dataset A 51 elseif (is a(A, 'dataset') && isa(W, 'mapping')) || (isa(A, 'double') && isa(W, 'mapping'))51 elseif (isdataset(A) && ismapping(W)) || (isa(A,'double') && ismapping(W)) 52 52 53 53 % Evaluate logistic classifier 54 54 [~, test_post] = eval_logreg(+A', W.data.E, W.data.E_bias); 55 A = dataset(A);55 A = prdataset(A); 56 56 B = setdata(A, test_post', getlabels(W)); 57 57 ll = []; … … 106 106 x = [E(:); E_bias(:)]; 107 107 options.Method = 'lbfgs'; 108 options.Display = 'on'; 108 %options.Display = 'on'; %DXD: nooooo! 109 options.Display = 'off'; 109 110 options.TolFun = 1e-4; 110 111 options.TolX = 1e-4;
Note: See TracChangeset
for help on using the changeset viewer.