资源简介
这是近邻传播聚类算法创始人Frey & Dueck在2007年Science杂志上面发表的“Clustering by Passing Messages between data points”论文里面方法的MATLAB实现程序代码,俗称AP聚类代码。里面包含两个版本:一个是普通版的,一个是稀疏版本的,下载后,先添加数据集,再调用这两个方法就行了。
代码片段和文件信息
%APCLUSTER Affinity Propagation Clustering (Frey/Dueck Science 2007)
% [idxnetsimdpsimexpref]=APCLUSTER(sp) clusters data using a set
% of real-valued pairwise data point similarities as input. Clusters
% are each represented by a cluster center data point (the “exemplar“).
% The method is iterative and searches for clusters so as to maximize
% an objective function called net similarity.
%
% For N data points there are potentially N^2-N pairwise similarities;
% this can be input as an N-by-N matrix ‘s‘ where s(ik) is the
% similarity of point i to point k (s(ik) needn抰 equal s(ki)). In
% fact only a smaller number of relevant similarities are needed; if
% only M similarity values are known (M < N^2-N) they can be input as
% an M-by-3 matrix with each row being an (ijs(ij)) triple.
%
% APCLUSTER automatically determines the number of clusters based on
% the input preference ‘p‘ a real-valued N-vector. p(i) indicates the
% preference that data point i be chosen as an exemplar. Often a good
% choice is to set all preferences to median(s); the number of clusters
% identified can be adjusted by changing this value accordingly. If ‘p‘
% is a scalar APCLUSTER assumes all preferences are that shared value.
%
% The clustering solution is returned in idx. idx(j) is the index of
% the exemplar for data point j; idx(j)==j indicates data point j
% is itself an exemplar. The sum of the similarities of the data points to
% their exemplars is returned as dpsim the sum of the preferences of
% the identified exemplars is returned in expref and the net similarity
% objective function returned is their sum i.e. netsim=dpsim+expref.
%
% [ ... ]=apcluster(sp‘NAME‘VALUE...) allows you to specify
% optional parameter name/value pairs as follows:
%
% ‘maxits‘ maximum number of iterations (default: 1000)
% ‘convits‘ if the estimated exemplars stay fixed for convits
% iterations APCLUSTER terminates early (default: 100)
% ‘dampfact‘ update equation damping level in [0.5 1). Higher
% values correspond to heavy damping which may be needed
% if oscillations occur. (default: 0.9)
% ‘plot‘ (no value needed) Plots netsim after each iteration
% ‘details‘ (no value needed) Outputs iteration-by-iteration
% details (greater memory requirements)
% ‘nonoise‘ (no value needed) APCLUSTER adds a small amount of
% noise to ‘s‘ to prevent degenerate cases; this disables that.
%
% Copyright (c) B.J. Frey & D. Dueck (2006). This software may be
% freely used and distributed for non-commercial purposes.
% (RUN APCLUSTER WITHOUT ARGUMENTS FOR DEMO CODE)
function [idxnetsimdpsimexpref]=apcluster(spvarargin);
if nargin==0 % display demo
fprintf(‘Affinity Propagation (APCLUSTER) sample/demo code\n\n‘);
fprintf(‘N=100; x=rand(N2); % Create N 2-D data points\n‘);
fprintf(‘M=N*N-N; s=zeros(M3); % Mak
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-05-01 18:55 ap_clustering\
目录 0 2013-02-19 20:08 ap_clustering\原始版本AP程序\
文件 11193 2014-01-13 15:54 ap_clustering\原始版本AP程序\apcluster.m
文件 13411 2014-01-13 15:55 ap_clustering\原始版本AP程序\apclusterSparse.m
- 上一篇:Camshift跟踪 Matlab实现
- 下一篇:朴素贝叶斯算法matlab实现
相关资源
- 朴素贝叶斯算法matlab实现
- Camshift跟踪 Matlab实现
- 三种esprit算法实现doa估计
- matlab各种图像压缩源代码
- matlab小波变换合集
- 最大后验概率 MAP 准则matlab源码
- 非线性系统辨识
- 异步电机matlab仿真
- matlab 数字升余弦仿真
- 多重网格法求解微分方程-matlab
- 批量读取温度数据
- MATLAB实现DPCM编码
- lz复杂度计算的matlab程序
- 最小二乘法Matlab代码
- matlab 程序\\\\多项式拟合插值.rar
- matlab水准网平差
- 关于汽车的制动性的MAtlab仿真
- 使用Matlab和CCS设计FIR滤波器
- 用matlab语言实现编解码
- 模拟退火算法进行函数优化 matlab
- 通信原理仿真实验 matlab
- 数学物理方程大作业 matlab
- VIBE-MEX--
- 复化Simpson公式
- 基于MATLAB的模糊控制表计算程序.m
- BCH matlab 编码
- matlab guide 选择文件夹
- Matlab_2013_64bit支持VS2013 的配置文件
- 基于视频的matlab光流法
- matlab串口实时波形显示
评论
共有 条评论