cannot import name 'BisectingKMeans' from 'sklearn.cluster' (C:UsersAdministratoranaconda3libsite-packagessklearncluster__init__.py)

Question:

When I try to use sklearn.cluster.BisectingKMeans in my jupyter notebook, an ImportError occured. It is said in the document that this method is new in version 1.1, and my scikit-learn version is 1.1.3.
I was using the base environment so it’s not an issue of lacking package in current environment.
enter image description here

I’ve tried upgrade the scikit-learn package, but it doesn’t help.
Can anyone give me a hint of what is going on here? Thanks a lot!

Asked By: heptapods

||

Answers:

This works on my machine:

from sklearn.cluster import BisectingKMeans

Also:

import sklearn
sklearn.__version__
> 1.1.2

Maybe you have a typo?

Answered By: Yasen