📄 mse_classifier.m
字号:
function a = mse_classifier(feature1,feature2);
%-----------------------------------------------------
% a = mse_classifier(feature1,feature2)
% Function calculates the weight vector for the linear discriminant function
% for the two-category data based on the minimum squared-error and
% pseudoinverse
% Input variables:
% - feature1 - augmented feature vector for the first class
% - feature2 - augmented feature vector for the second class
% Output:
% a - Weight vector (a0,a1,a2)' for the linear discriminant of the form:
% g(x) = a0 + a1*x1 + a2*x2
% --------------------------------------------------
% Evgeny Krestyannikov
% krestyan@cs.tut.fi
% Institute of Signal Processing
% Room TE 313
% Creating of augmented feature vector
sz= size(feature1,2);
feature2=-feature2;
Y = [feature1 feature2]';
b1=ones(1,sz);
b2=ones(1,sz);
b=[b1 b2]';
% Finding the matrix Y pseudoinverse
Y_pseudoinv=inv(Y'*Y)*Y';
a=Y_pseudoinv*b;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -