Clustering by MATLAB GA tool box

버전 1.0.0.0 (653 KB) 작성자: RMS Danaraj
This program creates clusters by GA tool box
다운로드 수: 2.1K
업데이트 날짜: 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