Changeset 82


Ignore:
Timestamp:
08/20/13 10:34:55 (11 years ago)
Author:
dtax
Message:

Now better?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • prextra/loglc2.m

    r37 r82  
    2828    % Handle untrained calls like W = loglc2([]);
    2929    if nargin == 0 || isempty(A)
    30         B = mapping(mfilename);
     30        B = prmapping(mfilename);
    3131        B = setname(B, name);
    3232        return;
    3333       
    3434    % Handle training on dataset A (use A * loglc2, A * loglc2([]), and loglc2(A))
    35     elseif (nargin == 1 && isa(A, 'dataset')) || (isa(A, 'dataset') && isa(W, 'double'))
     35    elseif (nargin == 1 && isdataset(A)) || (isdataset(A) && isa(W, 'double'))
    3636        if nargin < 2
    3737            W = 0;
     
    4545        % Train the logistic regressor
    4646        [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);
    4848        B = setname(B, name);
    4949       
    5050    % Handle evaluation of a trained LOGLC2 W for a dataset A
    51     elseif (isa(A, 'dataset') && isa(W, 'mapping')) || (isa(A, 'double') && isa(W, 'mapping'))
     51    elseif (isdataset(A) && ismapping(W)) || (isa(A,'double') && ismapping(W))
    5252       
    5353        % Evaluate logistic classifier
    5454        [~, test_post] = eval_logreg(+A', W.data.E, W.data.E_bias);
    55         A = dataset(A);
     55        A = prdataset(A);
    5656        B = setdata(A, test_post', getlabels(W));
    5757        ll = [];
     
    106106    x = [E(:); E_bias(:)];
    107107    options.Method = 'lbfgs';
    108     options.Display = 'on';
     108    %options.Display = 'on'; %DXD: nooooo!
     109    options.Display = 'off';
    109110    options.TolFun = 1e-4;
    110111    options.TolX = 1e-4;
Note: See TracChangeset for help on using the changeset viewer.