最近在跟着sklearn文档学习sklearn库的用法,把自己学习中遇到的问题和做的练习记录在这里。
class sklearn.cluster.
KMeans
(n_clusters=8, init='k-means++', n_init=10, max_iter=300, tol=0.0001, precompute_distances='auto', verbose=0, random_state=None, copy_x=True, n_jobs=None, algorithm='auto')
参数解析:
n_clusters:整数,默认为8。要聚成几类。
init:初始方法,可选三种情况:{‘k-means++’, ‘random’} or ndarray of shape (n_clusters, n_features), 默认为’k-means++’,
‘k-means++’ : 用一种智能的可加快聚合速度的方法选择初始质心。
‘random’: 随机选择K个观察值作为质心。
ndarray of shape (n_clusters, n_features):给定初始质心。
n_init:整数,默