Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6b91d0e6f8
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (16 sloc) 0.917 kb
%% Performs LDA on the KnollB data, applies the results to both the training and
%% the test data, plots the results and prints the error percentages for both sets.
Btrain=loadknoll('knollB-train.dt');
Btest=loadknoll('knollB-test.dt');
[mu1B mu2B sigmaB pcB1 pcB2] = lda(Btrain)
[mB bB]=getdecisionbound(mu1B, mu2B, sigmaB, pcB1, pcB2);
plotdecisionbound(Btrain, mu1B, mu2B, mB, bB, -2.5, 2.5, -2, 2);
title('Knoll B Training');
print -dpsc ldaKnollBtrain.eps;
[errTrain margTrain]=ldaerror(mu1B, mu2B, sigmaB, pcB1, pcB2, Btrain);
plotdecisionbound(Btest, mu1B, mu2B, mB, bB, -2.5, 2.5, -2, 2);
title('Knoll B Test');
print -dpsc ldaKnollBtest.eps;
[errTest margTest]=ldaerror(mu1B, mu2B, sigmaB, pcB1, pcB2, Btest);
disp(sprintf('Knoll B: Error for training set: %f, for test set: %f', errTrain, errTest));
disp(sprintf('Knoll B: Margin for training set: %f, for test set: %f', margTrain, margTest));
Jump to Line
Something went wrong with that request. Please try again.