LINCLASS |
Linear classifier.
Synopsis:
[y,dfce] = linclass( X, model)
Description:
This function classifies input data X using linear
discriminant function:
y(i) = argmax W(:,y)'*X(:,i) + b(y)
y
where parameters W [dim x nfun] and b [1 x nfun] are given
in model and nfun is number of discriminant functions.
In the binary case (nfun=1) the classification rule is following
y(i) = 1 if W'*X(:,i) + b >= 0
2 if W'*X(:,i) + b < 0
where W [dim x 1], b [1x1] are parameters given in model.
Input:
X [dim x num_data] Data to be classified.
model [struct] Parameters of linear classifier:
.W [dim x nfun] Linear term.
.b [nfun x 1] Bias.
Output:
y [1 x num_data] Predicted labels.
dfce [nfun x num_data] Values of discriminat function.
Examples:
trn = load('riply_trn');
tst = load('riply_tst');
model = fld( trn );
ypred = linclass( tst.X, model );
cerror( ypred, tst.y )
figure; ppatterns( trn ); pline( model );
See also
PERCEPTRON, MPERCEPTRON, FLD, ANDERSON.
About: Statistical Pattern Recognition Toolbox
(C) 1999-2003, Written by Vojtech Franc and Vaclav Hlavac
Czech Technical University Prague
Faculty of Electrical Engineering
Center for Machine Perception
Modifications:
2-may-2004, VF