资源简介
用于k-means聚类的MATLAB代码的编写,实现数据的聚类分析
代码片段和文件信息
% Demo for the kmeans algorithm
% First generate sample data
% We will test with 4 clusters in 3 dimensions
% by generating random data with gaussian density variance 1
% with means (000) (006) (060) and (600)
% and Ndata 200 300 100 and 500
K = 4;
dim = 3;
variance = 1;
sdev = sqrt(variance);
cluster1 = sdev*randn(200dim) + kron(ones(2001)[000]);
cluster2 = sdev*randn(300dim) + kron(ones(3001)[006]);
cluster3 = sdev*randn(100dim) + kron(ones(1001)[060]);
cluster4 = sdev*randn(500dim) + kron(ones(5001)[600]);
% Build data matrix
X = [cluster1 ; cluster2 ; cluster3; cluster4];
% Now apply K-means algorithm
% Note that order of results may vary
maxerr = 0;
[proto Nproto] = simple_kmeans(XKmaxerr)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2343 2011-04-22 15:25 fuzzykmeans.m
----------- --------- ---------- ----- ----
2343 1
- 上一篇:Matlab自回归分析程序
- 下一篇:课程设计时用的数据挖掘论文
评论
共有 条评论