带离群点去除的Kmeans聚类numpy实现
kmor的Python项目详细描述
KMOR Numpy公司
基于k-means聚类算法的python实现
安装
pip install kmor
也可以由conda安装
^{pr2}$示例
importnumpyasnpfromkmorimportkmorX=np.array([[1,0,0],[0,1,0],[0,0,1],[0,0,100]])U=kmor(X,1)print(U)# [0,0,0,1]
异常值被分配到额外的集群k
文件
kmor(X,k,y,nc0,max_迭代,gamma)
Parameter | Description |
---|---|
X | Your data. |
k | Number of clusters. |
y | Parameter for outlier detection. (default=3) Increase this to make outlier removal subtle. |
nc0 | Maximum percentage of your data that can be assigned to outlier cluster. (default=0.1) |
max_iteration | Maximum number of iterations. |
gamma | Used to check the convergence. |
参考文献
[1]甘、国俊、郭伯昂。”K-均值聚类与离群值去除〉,《模式识别字母90》(2017):8-14。在
- 项目
标签: