what is the best way(plot or....) to show my error according to benchmark in clustering?
2 ビュー (過去 30 日間)
古いコメントを表示
alireza kooshafar
2018 年 11 月 23 日
コメント済み: Image Analyst
2018 年 11 月 23 日
I have my own clustering and i'm going to compare it precision according to benchmark .benchmark clustered in 7 clusters and each point has the number (1:7)which shows which cluster it belongs to. in my code I clustered data in 7 clusters and assign them a number(1:7)but surely the clusters numbers are not the same as benchmark.
so Im looking for the best way(plot or....) to show my error according to benchmark in clustering.
thanks for any help.
0 件のコメント
採用された回答
Image Analyst
2018 年 11 月 23 日
Use a "confusion matrix". There are several function for that in the Statistics and Machine Learning Toolbox, and the Deep Learning Toolbox.
2 件のコメント
Image Analyst
2018 年 11 月 23 日
Yes. To get the cluster numbers for kmeans() to match up with the cluster number for your reference, then you have to get the centroids for all clusters in both data sets. Then you can use sqrt() or pdist2() to figure out what reference cluster is closest to what test cluster (which cluster has the min distance). Then you can keep a list of what cluster is the desired cluster and use intlut() to relabel the classes. Let's say that cluster 1-4 in the ref set were actually closest to sets [1,4,2,3]. In other words, cluster 1 is closest to red cluster 1, test cluster 4 is actually closest to cluster 2 of the ref set, and test cluster 2 was actually closest to ref cluster 3, and test cluster 3 was closest to ref cluster 4. So then you'd relabel the the indexes
[testClassNumbers, testClassCentroids] = kmeans(.....
% Make correspondence vector
newTestClassNumbers = intlut(v);
% Then reorder the Centroids in the same order, if you need to
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!