LDA for 2 classes only, why have 3 classes?

조회 수: 1 (최근 30일)
Matlaber
Matlaber 2019년 3월 5일
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