-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.m
43 lines (35 loc) · 1.18 KB
/
main.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
clear
clc
Path;
sinifSayi = [6 2];
nitelikSayi = [10 13];
global Data
global DataSinif
global NitelikSize
global ClassSize
global birinciGizliKatman
global ikinciGizliKatman
global cikisKatman
birinciGizliKatman = 3;
ikinciGizliKatman = 4;
algorithms = {'sos'};
dataName = ["avila.xlsx", "Data_for_UCI_named.xlsx"];
for algorithmIndex = 1 : length(algorithms)
algorithm = str2func(char(algorithms(algorithmIndex)));
for dataIndex = 1 : 1
NitelikSize = nitelikSayi(dataIndex);
ClassSize = sinifSayi(dataIndex);
cikisKatman = sinifSayi(dataIndex);
% cikisKatman = 1;
[Data, DataSinif] = getDataSet(dataName(dataIndex), 1001:2000);
for runIndex = 1 : 4
[bestSolution, bestFitness, iter] = algorithm();
bestYSA(:, runIndex) = bestSolution;
bestHata(runIndex) = bestFitness;
algorithmIter(runIndex) = iter;
end
xlswrite(strcat(func2str(algorithm), '_avila', '.xlsx'), bestHata, "Hata");
xlswrite(strcat(func2str(algorithm), '_avila', '.xlsx'), algorithmIter, "Iter");
xlswrite(strcat(func2str(algorithm), '_avila', '.xlsx'), bestYSA, "YSA");
end
end