MATLAB Answers

0

spectralcluster error during kmeans for large number of clusters

Asked by KARL BEUTNER on 25 Oct 2019
Latest activity Answered by Dheeraj Singh on 4 Nov 2019
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);

  0 Comments

Sign in to comment.

1 Answer

Answer by Dheeraj Singh on 4 Nov 2019

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:

  0 Comments

Sign in to comment.