I'm new to python and really need help with this.Trying to use the SilhouetteVisualizer but its giving an error : AttributeError: 'NoneType' object has no attribute 'split'. Please tell me what should I do?
from sklearn.metrics import silhouette_score
from yellowbrick.cluster import SilhouetteVisualizer
import yellowbrick
import matplotlib.pyplot as plt
for i in range(2,10):
km = KMeans(n_clusters=i,random_state=100)
km.fit(df)
sil_score = silhouette_score(df,km.labels_) # needs minimum 2 is required
print('Silhouette score for ',i,' clusters :',sil_score)
sil_km = SilhouetteVisualizer(km)
sil_km.fit(df)
plt.show()