LDA for 2 classes only, why have 3 classes?

3 Ansichten (letzte 30 Tage)
Matlaber
Matlaber am 5 Mär. 2019
Hi,
I am trying to use the original code Link here LDA link
I found strange is the dataset have 3 classes, but the plotted graph is X as input and Y as output. The graph does not do any dimensional reduction and classification.
%Load Data
data=load('iris_dataset');
X = data.irisInputs';
T = data.irisTargets';
L = vec2ind(T')';
[Y, W, lambda] = LDA2(X, L);
%Plot Results
figure;
D = size(X,2);
for d=1:D
% Original Data
subplot(D,2,2*d-1);
plot(X(:,d));
ylabel(['x_' num2str(d)]);
if d==D
xlabel('Sample Index');
end
if d==1
title('Original Data');
end
grid on;
% Transformed Data
subplot(D,2,2*d);
plot(Y(:,d));
ylabel(['y_' num2str(d)]);
if d==D
xlabel('Sample Index');
end
if d==1
title('LDA Output');
end
grid on;
end
Thank you

Antworten (0)

Kategorien

Mehr zu Statistics and Machine Learning Toolbox finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by