I have a similarity matrix which considers the similarity between each two users among the 80 users. I want to cluster the users based on this similarity matrix.
label = SpectralClustering(n_clusters=5 ,affinity='precomputed').fit_predict(lena)
is this the right way to call the similarity matrix and get the label? example: if we have three users, the matrix like[1,0.8,0;0.8,1,0;0,0,1] and get label like(1,1,2).
Furthermore, I want to use the Elbow method https://en.wikipedia.org/wiki/Determining_the_number_of_clusters_in_a_data_set to set the right number of clusters. But its difficult to have right measurement for the performance. Any suggestions?
lenais an image, not a distance matrix. - Has QUIT--Anony-Mousselenaaka: Lenna but a matrix of yours, don't call the variablelena, please. That is misleading, because this is a very popular example. - Has QUIT--Anony-Mousse