No module named ‘sklearn.datasets.samples_generator’

In the latest versions of scikit-learn, there is no module sklearn.datasets.samples_generator – it has been replaced with sklearn.datasets (see the docs); so, according to the make_blobs documentation, your import should simply be:

from sklearn.datasets import make_blobs

As a general rule, the official documentation is your best friend, and you should definitely consult it first before anything else.

Leave a Comment

tech