値の一般化
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
以下のプログラムで値を一般化しクラスに分類しプロットしたですが、一般化がうまくできていいないようなのですが何かアドバイス頂けると幸いです。
xfilename =('average.txt');
x = load(xfilename);
yfilename =('variarance.txt');
y = load(yfilename);
a=15;
rng default;
X = [x;y];
X = reshape(X,10368,2);
%NX = normc(X);
opts = statset('Display','final');
[idx,C] = kmeans(X,2,'Distance','cityblock','Replicates',5,'Options',opts);
plot(X(idx==1,1),X(idx==1,2),'r.','MarkerSize',12);
hold on;
plot(X(idx==2,1),X(idx==2,2),'b.','MarkerSize',12);
%plot(X(idx==3,1),X(idx==3,2),'g.','MarkerSize',12);
plot(C(:,1),C(:,2),'kx','MarkerSize',15,'LineWidth',3);
legend('Cluster 1','Cluster 2','Centroids','Location','NW');
title 'Cluster Assignments and Centroids';
hold off;
2 commentaires
Image Analyst
le 28 Oct 2016
I don't know what the question is, but you forgot to attach 'average.txt' and 'variarance.txt' so we can't run your code.
michio
le 28 Oct 2016
「一般化」とはどういう処理のことでしょうか。 できれば回答者が現象を再現できる形でのコード・ファイルを提供していただいて、具体的にどううまくできていないのか、どういう結果を求めていらっしゃるのかを指示頂けますと回答も得られやすいかと思います。 お手数かとは思いますがよろしくお願いします。
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Statistics and Machine Learning Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!