LDA for 2 classes only, why have 3 classes?

3 vues (au cours des 30 derniers jours)
Matlaber
Matlaber le 5 Mar 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

Réponses (0)

Catégories

En savoir plus sur Statistics and Machine Learning Toolbox dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by