Scikit Source Code Rea 4000 ding(2015.05.31)
2015-05-31 19:31
766 查看
Today’s Job
Today’s job is main about the source reading of plot_color_quantization.py and k_means_.py under scikit-learn-0.15.2\sklearn\cluster in scikit-learn-0.15.2.Gains
pairwise_distances_argmin:Compute minimum distances between one point and a set of points.
shuffle:
Shuffle arrays or sparse matrices in a consistent way
Lloyd’s algorithm and Vorlonoi Diagram
check_random_state(seed):
Turn seed into a np.random.RandomState instance
inertia:
Sum of distances of samples to their closest cluster center.
labels assignment is also called the E-step of EM
computation of the means is also called the M-step of EM
_tolerance(X, tol):
Return a tolerance which is independent of the dataset
Quesions to be solved
def _k_init(X, n_clusters, x_squared_norms, random_state, n_local_trials=None):“”“Init n_clusters seeds according to k-means++
Selects initial cluster centers for k-mean clustering in a smart way
to speed up convergence. see: Arthur, D. and Vassilvitskii, S.
“k-means++: the advantages of careful seeding”. ACM-SIAM symposium
on Discrete algorithms. 2007
Version ported from http://www.stanford.edu/~darthur/kMeansppTest.zip,
which is the implementation used in the aforementioned paper.
Grid Search
相关文章推荐
- Python动态类型的学习---引用的理解
- Python3写爬虫(四)多线程实现数据爬取
- 垃圾邮件过滤器 python简单实现
- 下载并遍历 names.txt 文件,输出长度最长的回文人名。
- install and upgrade scrapy
- Scrapy的架构介绍
- Centos6 编译安装Python
- 使用Python生成Excel格式的图片
- 让Python文件也可以当bat文件运行
- [Python]推算数独
- Python中zip()函数用法举例
- Python中map()函数浅析
- Python在CAM软件Genesis2000中的应用
- 使用Shiboken为C++和Qt库创建Python绑定
- FREEBASIC 编译可被python调用的dll函数示例
- Python 七步捉虫法
- Python实现的基于ADB的Android远程工具