Error when evaluating clusters of a dataset

1 Ansicht (letzte 30 Tage)
Alberto
Alberto am 28 Apr. 2015
Beantwortet: Rasmita Ardu am 29 Apr. 2024
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.

Akzeptierte Antwort

Tom Lane
Tom Lane am 28 Apr. 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.

Weitere Antworten (1)

Rasmita Ardu
Rasmita Ardu am 29 Apr. 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