LDA for 2 classes only, why have 3 classes?

3 次查看(过去 30 天)
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by