spectralcluster error during kmeans for large number of clusters

5 次查看(过去 30 天)
Hello, I made this call:
idx = spectralcluster(D,1000,'Distance','precomputed');
where size(D) = ~[14k,14k]. I get the error given below. When I greatly reduce the number of clusters (~30), the function runs successfully.
What can I do to get more clusters?
Error using kmeans (line 166)
Invalid data type. The first argument to KMEANS must be a real array.
Error in spectralcluster>clusterEigenvectors (line 191)
idx = kmeans(V,k,'Replicates',5);
Error in spectralcluster (line 179)
labels = clusterEigenvectors(Vnonan,k,clustMethod);

回答(1 个)

Dheeraj Singh
Dheeraj Singh 2019-11-4
For estimating the number of clusters, you can use the following Tips:
  1. Consider using spectral clustering when the clusters in your data do not naturally correspond to convex regions
  2. From the spectral clustering algorithm, you can estimate the number of clusters k as:
  • The number of eigenvalues of the Laplacian matrix that are equal to 0.
  • The number of connected components in your similarity graph representation. Use graph to create a similarity graph from a similarity matrix, and use conncomp to find the number of connected components in the graph.
Refer to the following link for an example:

类别

Help CenterFile Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by