필터 지우기
필터 지우기

what is the best way(plot or....) to show my error according to benchmark in clustering?

조회 수: 1 (최근 30일)
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.

채택된 답변

Image Analyst
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
alireza kooshafar
alireza kooshafar 2018년 11월 23일
thanks a lot .
i found ''plotconfusion'' and it is exactly what i wanted, but the problem is diffrent between numbers assigned to clusters in my code and in benchmark data(for example the data in cluster number 2 of benchmark are in cluster number 5 in result of my code ),is there any way to solve this?
Image Analyst
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개)

카테고리

Help CenterFile Exchange에서 Cluster Analysis and Anomaly Detection에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by