Clustering by MATLAB GA tool box

バージョン 1.0.0.0 (653 KB) 作成者: RMS Danaraj
This program creates clusters by GA tool box
ダウンロード: 2.2K
更新 2014/3/24

ライセンスの表示

unzip the folder 'mk'and run test1.m which clusters random sample od 10,000 two dimension data into 5 clusters by K emans algorithm.
*************
clear;
clc;
% x is the vector of centroids of the cluser gropr. x(1),x(2) coordinates
% of first cluster and so on.so if no of clusters id k the dimension of x
% is 2*k
data=rand(10000,2);
% random data to be grouped as clusters
k=5;
save data
save k
options = gaoptimset('PopulationSize', 50,'Generations', 500,'StallGenLimit',500,'TimeLimit', 2000,'StallTimeLimit', 2000,'PlotFcns', {@gaplotbestf,@gaplotbestindiv});
[x F]=ga(@clust1,2*k,options)
% x=rand(1,10);
[F s1]=clust1(x);
pause;
close('Genetic Algorithm')
aa1=find(s1==1);
x1=data(aa1',1);
y1=data(aa1',2);
aa2=find(s1==2);
x2=data(aa2',1);
y2=data(aa2',2);
aa3=find(s1==3);
x3=data(aa3',1);
y3=data(aa3',2);
aa4=find(s1==4);
x4=data(aa4',1);
y4=data(aa4',2);
aa5=find(s1==5);
x5=data(aa5',1);
y5=data(aa5',2);
cx1=x([1 3 5 7 9]);
cy1=x([1 3 5 7 9]+1);
plot(x1,y1,'*',x2,y2,'+ ',x3,y3,'s ',x4,y4,'. ',x5,y5,'v ');
hold on
plot(cx1,cy1,'kd');
% each cluster is chown is different colors and symbols, the centroids are pointed as dimond

引用

RMS Danaraj (2024). Clustering by MATLAB GA tool box (https://www.mathworks.com/matlabcentral/fileexchange/46008-clustering-by-matlab-ga-tool-box), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R14SP3
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
タグ タグを追加

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0