-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathget_epsilon_indicator.m
executable file
·85 lines (68 loc) · 2.33 KB
/
get_epsilon_indicator.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
% PAL (Pareto Active Learning) Algorithm
%
% Copyright (c) 2014 ETH Zurich
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
function [epsilon_perc_obj1,epsilon_perc_obj2,avg_min_obj1,avg_min_obj2] = get_epsilon_indicator(real_pareto_set,pareto_01list,real_obj1,real_obj2,range_obj1,range_obj2)
real_pareto_obj1 = real_pareto_set{1};
real_pareto_obj2 = real_pareto_set{2};
max_epsilon = 0;
predicted_pareto_obj1 = -1;
predicted_pareto_obj2 = -1;
for i=1:length(pareto_01list)
if ((pareto_01list(i)==1))
predicted_pareto_obj1 = append(predicted_pareto_obj1,real_obj1(i));
predicted_pareto_obj2 = append(predicted_pareto_obj2,real_obj2(i));
end
end
min_list=-1;
for i=1:length(real_pareto_obj1)
for j=1:length(predicted_pareto_obj1)
diff_obj1 = (predicted_pareto_obj1(j) - real_pareto_obj1(i))*100/range_obj1;
diff_obj2 = (real_pareto_obj2(i) - predicted_pareto_obj2(j))*100/range_obj2;
if diff_obj1<0
diff_obj1 = 0;
end
if diff_obj2<0
diff_obj2 = 0;
end
if diff_obj1>diff_obj2
max_diff = diff_obj1;
else
max_diff = diff_obj2;
end
if j==1
min_epsilon = max_diff;
else
if max_diff < min_epsilon
min_epsilon = max_diff;
end
end
end
min_list = append(min_list,min_epsilon);
if min_epsilon>max_epsilon
max_epsilon = min_epsilon;
end
end
% max_epsilon=max_epsilon
%min_list=min_list
% avg_min = mean(min_list)
%
% pause
avg_min_obj1 = mean(min_list);
avg_min_obj2 = mean(min_list);
epsilon_perc_obj1 = max_epsilon;
epsilon_perc_obj2 = max_epsilon;
end