资源简介
包括主流的几种动态聚类算法:K-means,K-means的改进算法,DBSCAN算法等等,还有数据作图代码,代码详细明晰!适合想学习动态聚类算法的朋友!
代码片段和文件信息
function [centroid result] = Clustering(data method varargin)
% Currently following clustering algorithms are supported:
% 1. Kmeans
% 2. Kmeans++
% 3. ISODATA (Iterative Self-Organizing Data Analysis)
% 4. Mean Shift
% 5. DBSCAN (Density-based Spatial Clustering of Application with Noise)
% 6. Gaussian Mixture Model /* Numerical instability problem not completely solved*/
% 7. LVQ (Learning Vector Quantization)
addpath(‘.\lib‘);
addpath(‘.\tool‘);
% Check input validity
if((strcmp(method‘kmeans‘) || strcmp(method‘kmeans++‘)) && (size(varargin2) ~= 2))
error(‘The value of K should be predefined when using k-means and k-means++.‘);
elseif((strcmp(method‘isodata‘) || strcmp(method‘ISODATA‘)) && (size(varargin2) < 5))
error(‘Not enough input for ISODATA. Please use help for more information.‘);
elseif((strcmp(method‘mean_shift‘) || strcmp(method‘Mean_Shift‘)) && (size(varargin2) ~= 1))
error(‘Invalid number of input for mean shift.‘);
elseif((strcmp(method‘dbscan‘) || strcmp(method‘DBSCAN‘)) && (size(varargin 2) ~= 2))
error(‘Invalid number of input for dbscan.‘);
elseif((strcmp(method‘GMM‘) || strcmp(method‘gmm‘)) && (size(varargin 2) ~= 2))
error(‘Invalid number of input for Gaussian Mixture Model‘);
elseif((strcmp(method‘LVQ‘) || strcmp(method‘lvq‘)) && (size(varargin 2) ~= 5))
error(‘Invalid number of input for Learning Vector Quantization‘);
end
% Method entries
% Kmeans
if(strcmp(method‘kmeans‘))
k = varargin{11};
iteration = varargin{12};
[centroid result] = Kmeans(data k iteration);
PlotData(data result centroid);
% Kmeans++
elseif(strcmp(method‘kmeans++‘) || strcmp(method‘kmeanspp‘))
k = varargin{11};
iteration = varargin{12};
[centroid result] = Kmeanspp(data k iteration);
PlotData(data result centroid);
% ISODATA
elseif(strcmp(method‘ISODATA‘) || strcmp(method‘isodata‘))
desired_k = varargin{11}; % desired number of classes
iteration = varargin{12}; % maximum iteration time
minimum_n = varargin{13}; % minimum number of samples in one class
maximum_variance = varargin{14}; % maximum allowed variance of samples in one class
minimum_d = varargin{15}; % minimum distance between two classes
[centroid result] = ISODATA(data iteration desired_k minimum_n maximum_variance minimum_d);
PlotData(data result centroid);
% Mean Shift
elseif(strcmp(method‘mean_shift‘) || strcmp(method‘Mean_Shift‘))
thr = varargin{11}; % distance threshold
[centroid result] = Mean_Shift(data thr);
PlotData(data result centroid);
% DBSCAN
elseif(strcmp(method‘dbscan‘) || strcmp(method‘DBSCAN‘))
epsilon = varargin{11}; % distance threshold for finding neighbors
minPts = varargin{12};% minimum required number of neighbor points for adding one core object
centroid = nan; % DBSCAN will not calculate centroid
result = DBSCAN(data epsilon minPts);
PlotData(data result);
% Gaussi
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-01-28 14:31 Clustering-master\
文件 3744 2019-01-28 14:31 Clustering-master\Clustering.m
文件 2707 2019-01-28 14:31 Clustering-master\README.md
文件 135 2019-01-28 14:31 Clustering-master\Subspace_Clustering.m
目录 0 2019-01-28 14:31 Clustering-master\data\
文件 2753 2019-01-28 14:31 Clustering-master\data\toy_clustering.mat
文件 3596 2019-01-28 14:31 Clustering-master\data\toy_subspace_clustering.mat
目录 0 2019-01-28 14:31 Clustering-master\lib\
文件 3843 2019-01-28 14:31 Clustering-master\lib\DBSCAN.m
文件 2089 2019-01-28 14:31 Clustering-master\lib\Entropy_Weighting_Subspace_Kmeans.m
文件 2685 2019-01-28 14:31 Clustering-master\lib\Gaussian_Mixture.m
文件 3552 2019-01-28 14:31 Clustering-master\lib\ISODATA.m
文件 1470 2019-01-28 14:31 Clustering-master\lib\Kmeans.m
文件 2712 2019-01-28 14:31 Clustering-master\lib\Kmeanspp.m
文件 1949 2019-01-28 14:31 Clustering-master\lib\LVQ.m
文件 3347 2019-01-28 14:31 Clustering-master\lib\Mean_Shift.m
文件 2875 2019-01-28 14:31 Clustering-master\lib\Subspace_Kmeans.m
目录 0 2019-01-28 14:31 Clustering-master\tool\
文件 927 2019-01-28 14:31 Clustering-master\tool\GenerateDataset.m
文件 229 2019-01-28 14:31 Clustering-master\tool\OptimalDecisionBoundary.m
文件 1378 2019-01-28 14:31 Clustering-master\tool\PlotData.m
- 上一篇:ArcGIS9.2全套
- 下一篇:STM32F105_Temp工程模板
相关资源
- 各类反褶积函数汇总
- 图像GaussLaplacian金字塔+图像融合
- 现代信号处理练习-古典功率谱、现代
- 基于帧间差分
- IEEE30节点数据268694
- 七个RBF神经网络的源程序
- voicebox工具箱
- UWB system
- 图像亚像素平移
- 模型与模型验证.zip
- coursera斯坦福机器学习公开课支持向量
- FastSLAM算法模型
- SAX符号化序列范例源码
- 傅里叶特征描述子图像匹配
- 光伏三相逆变的有功无功调节锁相环
- 光流图像配准
- SVM with mosek for banana
- 应用牛顿法求方程cos(x)cosh(x)-
- 电动汽车有序充放电.rar
- 二自由度机械臂模糊PID控制.zip
- ldpc完整的系统编译仿真
- 降维的相关方法
- 图像融合代码
- attachment_1487958_16b_win64_2017-05-10
- FMCW Waveform Design.rar
- 自适应信号 利用自适应信号分离器,
- 车牌识别.rar
- 2011经典EPSDE文章源代码
- 动态避障仿真.rar
- NcutClustering图像分割算法
评论
共有 条评论