一:利用kmeans聚类分析时,出现了如下的错误。
代码如下:
from sklearn.cluster import KMeans
clf = KMeans(max_iter=20, n_clusters=2, init='k-means++', tol=1e-12)
clf.fit(numb_data_arr)
# # 簇中心
print(clf.cluster_centers_)
# # 整体平方误差和
print(clf.inertia_)
clf.labels_
运行之后出现了如下的错误。
D:\ProgramData\anaconda3\lib\site-packages\sklearn\cluster\_kmeans.py:870: FutureWarning: The default value of `n_init` will change from 10 to 'auto' in 1.4. Set the value of `n_init` explicitly to suppress the warning warnings.warn( D:\ProgramData\anaconda3\lib\site-packages\sklearn\cluster\_kmeans.py:1382: UserWarning: KMeans is known to have a memory leak on Windows with MKL, when there are less chunks than available threads.