-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClust_ERACF.m
54 lines (38 loc) · 1.11 KB
/
Clust_ERACF.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
49
50
51
52
53
clear; clc; close all;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Loading
addpath Data Figure_Output Package/Clust Package/Vis/ Package/Val/
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Setting
% Data
param.h = .03;
param.x = -5: param.h : 10;
param.val = 2;
abnormal_params = {
{[0.15, 2.5], sqrt([.4, .4])}
{[0.3, 2.2], sqrt([.4, .4])}
};
% Simulate data and true labels using the SimPDFAbnormal function
[Data, param.truelabels] = SimPDFAbnormal( ...
{ ...
linspace(0, 1, 10*50), ...
linspace(4, 5, 10), ...
linspace(6, 6.5, 10*10)}, ...
sqrt([.5, .5 .5]), ...
param.x);
% FCM
param.L = 0.2;
param.epsilon = 1e-10;
param.maxIter = 500;
param.val = 2;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Clustering via alg
results = ERACF_(Data, param);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Plotting
figure;
PlotPDFeachIteration(Data, results.Cluster.IDX, param.x); legend("Location","eastoutside"); hold on;
plot(param.x,results.Data.fv, "LineWidth", 3, "DisplayName", "Representative PDF"); hold off;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Validation
results = validityClustering(results, param);