Home > @Classifier > Classifier.m

Classifier

PURPOSE ^

function [cl] = classifier(pos, neg)

SYNOPSIS ^

function [cl] = Classifier(nc)

DESCRIPTION ^

 function [cl] = classifier(pos, neg)
 constructor for the classifier class
   The classifier class is a base class for all classifier. It declares
   the interface for any classifer. All the methods are to implemented by
   the descendent classifier classes

   Inputs:
       nc: number of classes

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [cl] = Classifier(nc)
0002 % function [cl] = classifier(pos, neg)
0003 % constructor for the classifier class
0004 %   The classifier class is a base class for all classifier. It declares
0005 %   the interface for any classifer. All the methods are to implemented by
0006 %   the descendent classifier classes
0007 %
0008 %   Inputs:
0009 %       nc: number of classes
0010 
0011 if nargin == 0
0012     cl.numClasses = 2;
0013     cl.posVal = 2;
0014     cl.negVal = 1;
0015 elseif nargin == 1
0016     cl.numClasses = nc;
0017     if nc == 2
0018         cl.posVal = 2;
0019         cl.negVal = 1;
0020     else
0021         cl.posVal = NaN;
0022         cl.negVal = NaN;
0023     end
0024 else
0025     error('Wrong number of arguments');
0026 end
0027 
0028 cl = class(cl, 'Classifier');

Generated on Sun 29-Sep-2013 01:25:24 by m2html © 2005