Error when evaluating clusters of a dataset

1 vue (au cours des 30 derniers jours)
Alberto
Alberto le 28 Avr 2015
I'm trying to evaluate the number of a dataset, data is described bellow and clust are the results of a clustering algorithm (vector of classes):
eva=evalclusters(data,clust,'CalinskiHarabasz');
Depending on the data input I'm receiving almost all time the error:
Error using clustering.evaluation.ClusterCriterion (line 447)
The number of clusters to be evaluated must be different for different clustering solutions.
How can I solve the error? Columns are properties and rows are observations in the data array. Error seems to be in the clust array:
1 2 3 3 4 5 6 7 9 8
1 2 3 4 5 6 7 8 7 10
1 1 2 2 2 3 3 4 3 5
1 1 2 2 2 3 3 4 3 5
1 1 2 2 3 4 4 5 5 6
1 1 2 2 2 3 3 4 4 4
1 1 1 1 1 2 2 2 1 1
1 1 2 2 2 3 3 4 3 5
1 2 3 3 4 5 6 7 9 8
1 1 2 2 2 3 3 4 4 4
1 2 3 4 5 6 7 8 7 10
1 1 2 2 3 4 4 5 5 6
1 2 3 3 4 5 5 6 9 7
1 2 3 4 5 6 7 8 8 9
1 1 1 1 1 2 2 2 2 1
1 1 2 2 3 4 4 5 5 6
1 2 3 3 4 5 5 6 9 7
1 1 1 1 1 1 1 1 2 2
1 2 3 4 5 6 7 8 8 9
1 1 2 2 3 4 4 5 5 6
1 1 1 1 1 1 1 1 2 2
1 2 3 4 5 6 7 8 8 9
1 1 2 2 3 4 4 5 5 6
1 1 1 1 1 1 1 3 2 3
1 2 3 3 4 5 5 6 9 7
Thank you.

Réponse acceptée

Tom Lane
Tom Lane le 28 Avr 2015
It looks like your next-to-last column, which has cluster numbers up to 9, is missing cluster 6 so it only has 8 clusters. I believe the evalclusters function wants to help choose the number of clusters, and it's not prepared to deal with two different clustering solutions both with 8 clusters.
  1 commentaire
Alberto
Alberto le 29 Avr 2015
It worked!, Thank you

Connectez-vous pour commenter.

Plus de réponses (1)

Rasmita Ardu
Rasmita Ardu le 29 Avr 2024
Hey!
I am facing the same error. Here, the number of clusters are 5 and I see that all clusters have some data points assigned as seen in the histogram plot. Can you help me understand how to resolve this ?
Thanks!

Community Treasure Hunt

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

Start Hunting!

Translated by