📄 linclass.m
字号:
function [Ipred, Fx ]=linclass(X,alpha,theta)
% LINCLASS classifier based on linear discriminat function.
% [Ipred, Fx ]=linclass(X,alpha,theta)
%
% LINCLASS is the classifier based on a linear decision rule.
% The matrix X contains patterns to be classified into to classes.
% The linear classifier is detrmined by the vector alpha and
% the threshold theta.
% The result of the classifier is the vector J containing class labels.
%
% The classifier rule is:
% class 1 -> alpha'*x >= theta
% class 2 -> alpha'*x < theta
%
% Statistical Pattern Recognition Toolbox, Vojtech Franc, Vaclav Hlavac
% (c) Czech Technical University Prague, http://cmp.felk.cvut.cz
% Written Vojtech Franc (diploma thesis) 02.01.2000
% Modifications
% 24. 6.00 V. Hlavac, comments polished.
K=size(X,2); % # of samples
DIM=size(X,1); % dimension
E=ones(1,K);
Fx=alpha(:)'*X-theta*E;
Ypred = sign( Fx );
Ypred( find( Ypred == 0 )) = 1;
Ipred = sgntoi( Ypred );
return;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -