Affinity Propagation
1. 调用方法:
AffinityPropagation(damping=0.5, max_iter=200, convergence_iter=15, copy=True, preference=None, affinity=’euclidean’, verbose=False)
参数:
damping : float, optional, default: 0.5 防止更新过程中数值震荡
max_iter : int, optional, default: 200
convergence_iter : int, optional, default: 15
如果类簇数目在达到这么多次迭代以后仍然不变的话,就停止迭代。
copy : boolean, optional, default: True
Make a copy of input data.
preference : array-like, shape (n_samples,) or float, optional
每个points的preference。具有更大preference的点更可能被选为exemplar。类簇的数目受此值的影响,如果没有传递此参数,它们 会被设置成input similarities的中值。???
affinity : string, optional, default=``euclidean``
度量距离的方式,推荐precomputed and euclidean这两种,euclidean uses the negative squared euclidean distance between points.
verbose : boolean, optional, default: False
属性:
cluster_centers_indices_ : array, shape (n_clusters,)
类簇中心的索引
cluster_centers_ : array, shape (n_clusters, n_features)
类簇中心 (if affinity != precomputed)
labels_ : array, shape (n_samples,)
每个point的标签
affinity_matrix_ : array, shape (n_samples, n_samples)
Stores the affinity matrix used in fit.
n_iter_ : int
达到收敛需要的迭代次数。
2. scikit-learn介绍
http://scikit-learn.org/stable/modules/clustering.html#affinity-propagation
3. 算法复杂性
,与样本数成正比。
4.算法描述


引入阻尼因子:


Affinity Propagation的更多相关文章
- AP(affinity propagation)研究
待补充…… AP算法,即Affinity propagation,是Brendan J. Frey* 和Delbert Dueck于2007年在science上提出的一种算法(文章链接,维基百科) 现 ...
- Affinity Propagation Algorithm
The principle of Affinity Propagation Algorithm is discribed at above. It is widly applied in many f ...
- Affinity Propagation Demo2学习【可视化股票市场结构】
这个例子利用几个无监督的技术从历史报价的变动中提取股票市场结构. 使用报价的日变化数据进行试验. Learning a graph structure 首先使用sparse inverse(相反) c ...
- Affinity Propagation Demo1学习
利用AP算法进行聚类: 首先导入需要的包: from sklearn.cluster import AffinityPropagation from sklearn import metrics fr ...
- AP聚类算法(Affinity propagation Clustering Algorithm )
AP聚类算法是基于数据点间的"信息传递"的一种聚类算法.与k-均值算法或k中心点算法不同,AP算法不需要在运行算法之前确定聚类的个数.AP算法寻找的"examplars& ...
- knn/kmeans/kmeans++/Mini Batch K-means/Affinity Propagation/Mean Shift/层次聚类/DBSCAN 区别
可以看出来除了KNN以外其他算法都是聚类算法 1.knn/kmeans/kmeans++区别 先给大家贴个简洁明了的图,好几个地方都看到过,我也不知道到底谁是原作者啦,如果侵权麻烦联系我咯~~~~ k ...
- [Python] 机器学习库资料汇总
声明:以下内容转载自平行宇宙. Python在科学计算领域,有两个重要的扩展模块:Numpy和Scipy.其中Numpy是一个用python实现的科学计算包.包括: 一个强大的N维数组对象Array: ...
- 【转帖】Python在大数据分析及机器学习中的兵器谱
Flask:Python系的轻量级Web框架. 1. 网页爬虫工具集 Scrapy 推荐大牛pluskid早年的一篇文章:<Scrapy 轻松定制网络爬虫> Beautiful Soup ...
- {Reship}{Code}{CV}
UIUC的Jia-Bin Huang同学收集了很多计算机视觉方面的代码,链接如下: https://netfiles.uiuc.edu/jbhuang1/www/resources/vision/in ...
随机推荐
- 谁再问elasticsearch集群Red怎么办?把这篇笔记给他
前言 可能你经历过这些Red. ...等等 那ES的Red是神么意思? 这里说的red,是指es集群的状态,一共有三种,green.red.yellow.具体含义: 冷静分析 从上图可知,集群red是 ...
- 【转】python及其工具包安装基本流程
昨天晚上在家里的旧电脑上安装了<利用python进行数据分析>的部分环境,遇到若干问题,在此予以记录. 部分细节转:http://blog.csdn.net/huanbia/article ...
- 《工具》centos 7.x 下安装 JDK,超详细总结一看就会
第一步 检查 JDK 查看JDK版本,在命令行输入:java -version [root@test ~]# java -version bash: java: command not found 如 ...
- 【转】你应该关注的几个Eclipse超酷插件
本文由 ImportNew - 唐尤华 翻译自 Anton Arhipov.如需转载本文,请先参见文章末尾处的转载要求. 来自非营利性Eclipse基金会的Eclipse IDE以其插件生态系统著称. ...
- Nginx模块讲解
Nginx模块分为:nginx官方模块.第三方模块 通过nginx -V查看编译参数,可以看到官方编译的模块 --with-compat --with-file-aio --with-threads ...
- Windows10内嵌Ubuntu子系统初始化设置
第一次启动 重启ubuntu Since Windows 10 version 1803, closing all WSL terminal windows won't kill background ...
- RegExp正则表达式基础
什么是正则表达式 正则表达式用于对字符串模式匹配及检索替换 如何创建正则 有两种创建正则的方法: js风格 new RegExp(pattern [, flags]) perl风格 /pattern/ ...
- pandas DF去重
实例 import pandas as pd data=pd.DataFrame({'产品':['A','A','A','A'],'数量':[50,50,30,30]}) 去重 data.drop_d ...
- xLua下使用lua-protobuf
本文发表于程序员刘宇的博客,转载请注明来源:https://www.cnblogs.com/xiaohutu/p/12168781.html protobuf作为一种通用套接字格式,各种插件里,最本质 ...
- Java框架之SpringMVC 04-视图解析-Spring表单-JSON-上传下载
SpringMVC 视图解析 请求处理方法(controller方法)执行完成后,最终返回一个 ModelAndView 对象,即使出现异常也会返回一个 ModelAndView 对象.对于那些返回 ...