Error when evaluating clusters of a dataset

3 ビュー (過去 30 日間)
Alberto
Alberto 2015 年 4 月 28 日
編集済み: Alberto 2015 年 4 月 29 日
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.

採用された回答

Tom Lane
Tom Lane 2015 年 4 月 28 日
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 件のコメント
Alberto
Alberto 2015 年 4 月 29 日
It worked!, Thank you

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by