How can I fix a MemoryError when executing scikit-learns silhouette score?

前端 未结 1 1397
清歌不尽
清歌不尽 2021-01-03 23:12

I run a clustering algorithm and want to evaluate the result by using silhouette score in scikit-learn. But in the scikit-learn, it needs to calculate the distance matrix: d

1条回答
  •  迷失自我
    2021-01-03 23:59

    Set the sample_size parameter in the call to silhouette_score to some value smaller than 300K. Using this parameter will sample datapoints from X and calculate the silhouette_score on those instead of the entire array.

    0 讨论(0)
提交回复
热议问题