DistrictDataLabs / yellowbrick

Visual analysis and diagnostic tools to facilitate machine learning model selection.
http://www.scikit-yb.org/
Apache License 2.0
4.3k stars 559 forks source link

Can't use SilhouetteVisualizer for Spectral Clustering #1192

Closed LSYS closed 3 years ago

LSYS commented 3 years ago

When I try to do it, I get the following error:

AttributeError: 'SpectralClustering' object has no attribute 'predict'

pdamodaran commented 3 years ago

Hi @LSYS - thank you for checking out Yellowbrick and trying out the SilhouetteVisualizer. The reason you are running into this error is because unlike most of the clustering algorithms in scikit-learn, the Spectral Clustering algorithm does not have a predict() method, which is used to get the labels that are subsequently used to get the silhouette scores.

bbengfort commented 3 years ago

Closing due to inactivity.