还不错的网站:
http://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html
https://keras.io/search.html?q=Dense
http://keras-cn.readthedocs.io/en/latest/
第三个是keras中文文档
kmeans 遇到的用法
import先
from sklearn.cluster import KMeans
kmeans默认算法为kmeans++
常用examples
from sklearn.cluster import KMeans
import numpy as np
X = np.array([[1, 2], [1, 4], [1, 0], [4, 2], [4, 4], [4, 0]])
kmeans = KMeans(n_clusters=3, random_state=0).fit(X)
distances = kmeans.transform(X)
output:
In [21]: kmeans.cluster_centers_
out[21]: array([[1., 2.],
[4., 1.],
[4., 4.]])
In [20]: distances
Out[20]:
array([[0. , 3.16227766, 3.60555128],
[2. , 4.24264069, 3. ],
[2. , 3.16227766, 5. ],
[3. , 1. , 2. ],
[3.60555128, 3. , 0. ],
[3.60555128, 1. , 4. ]])