Cannot reproduce output for the loop that saves the WCSS for any number of clusters
The following code produces an AttributeError at kmeans.fit(x): (AttributeError: 'NoneType' object has no attribute 'split'). The same error also appears with the jupyter notebook solution downloaded from the resources. How do I solve this error?
wcss = []
for i in range(1,7):
kmeans = KMeans(i)
kmeans.fit(x)
wcss_iter = kmeans.inertia_
wcss.append(wcss_iter)
Seems the issue is with conda using an outdated version of threadpoolctl.
Solve this by running pip install --upgrade threadpoolctl, then restarting your notebook kernel and run everything again.
I'm surprised Python has so many dependency errors, I thought these kind of errors were usually JS and npm territory ^^
I have the same error, you can fix it by changing the range to (2,7).
Maybe there was a change in the library, and KMeans (1) isn't working any more, as does not make a lot of sense.