LDA for 2 classes only, why have 3 classes?

3 ビュー (過去 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 Center および File ExchangeStatistics 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