what is the best way(plot or....) to show my error according to benchmark in clustering?
    2 views (last 30 days)
  
       Show older comments
    
    alireza kooshafar
 on 23 Nov 2018
  
    
    
    
    
    Commented: Image Analyst
      
      
 on 23 Nov 2018
            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 Comments
Accepted Answer
  Image Analyst
      
      
 on 23 Nov 2018
        Use a "confusion matrix".  There are several function for that in the Statistics and Machine Learning Toolbox, and the Deep Learning Toolbox.
2 Comments
  Image Analyst
      
      
 on 23 Nov 2018
				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
More Answers (0)
See Also
Categories
				Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
