seljukgulcan/comparing-trajectory-clustering-methods

about silhouette method

NiuWenYu12138 opened this issue · 1 comments

When I tested the kmedios clustering method with my own dataset, I called the silhouette method to evaluate the clustering effect, but why the results of the same data are not the same each time?
This is how I call the method:silhoutte_score = metrics.silhouette_score(D, labels),Where D denotes distance matrix, labels denotes labels corresponding to each track。When I do the calculation with the same k value, I get different results.

Are you using sample_size parameter? If so, that's the reason you get different results. It may select a different sample at each execution. Use random_state parameter if you want consistent results.

More info about the parameters can be found in the scikit-learn docs: https://scikit-learn.org/stable/modules/generated/sklearn.metrics.silhouette_score.html