-
Notifications
You must be signed in to change notification settings - Fork 2
/
demo_acde.m
48 lines (41 loc) · 1.88 KB
/
demo_acde.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
%% DEMO: Evaluation of clustering solutions generated by ACDE algorithm
% ------------------------------------------------------------------------
% The Cluster Validity Index Tooolbox (CVIT) for automatic determination
% of clusters from clustering solution contains more than 70 functions (m-files)
% This toolbox was developed with MATLAB R2014a.
%
% Developed by
% Adan Jose-Garcia ([email protected])
% Wilfrido Gomez Flores ([email protected])
%
% IMPORTANT: First run "RUN_ME_FIRST.m" file to add this toolbox to search path.
% ------------------------------------------------------------------------
clc; clear all; close all;
addpath([pwd '/datasets']);
addpath([pwd '/proximity']);
addpath([pwd '/cvi']);
addpath([pwd '/clustering']);
addpath([pwd '/utils']);
% List of available cluster validity indices (CVIs)
CVInames = {'xb','ch','sf','pbm','cs','gd31','gd41','gd51','gd33','gd43',...
'gd53','db2','db','cop','sil','dunn','sv','sym','sdunn','sdb',...
'sdbw','cind'};
% List of available distances
Distnames = {'euc','neuc','cos','pcorr','scorr','lap'};
% List of datasets provided
DSnames = {'Data_4_3','Data_5_2','Moon', 'Iris'};
%%-------------------------------------------------------------------------
%% Parameters related to the automatic clustering problem
D = load('Data_4_3');
X = D.data(:,1:end-1);
Kmax = 10; % Maximum number of clusters
NP = 10*size(X,2); % Population size
Gmax = 100; % Number of generations
CVI = 'ch'; % CVI name
Dist = 'euc'; % Distance funtion
% ------------------------------------------------------------------------
%% Run the ACDE algorithm
[Yb,Pb,bFit] = acde(X, Kmax, NP, Gmax, CVI, Dist);
%% Exeternal evaluation of the resulting clustering solution
plotclusters(X,D.data(:,end),Yb,Pb);
% ARI = pairwiseindex(T,Yb); % The adjusted rand index