Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import Error of Kmeans in python3.5

In [1]: import sqlite3

In [2]: import pandas as pd

In [3]: import numpy as np

In [4]: import matplotlib.pyplot as plt
In [5]: from sklearn.cluster import Kmeans

ImportError                               Traceback (most recent call last)
<ipython-input-5-0125bea01c25> in <module>()
----> 1 from sklearn.cluster import Kmeans

ImportError: cannot import name 'Kmeans'

Scikit-learn version is 0.18.2

like image 364
gogetakakaroot Avatar asked Jan 04 '23 16:01

gogetakakaroot


1 Answers

It's just a typo. The "m" in KMeans should be capital:

from sklearn.cluster import KMeans
like image 197
lukess Avatar answered Jan 06 '23 04:01

lukess