-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathUpdateBeliefSystem.asv
More file actions
51 lines (46 loc) · 1.9 KB
/
UpdateBeliefSystem.asv
File metadata and controls
51 lines (46 loc) · 1.9 KB
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
function Beliefs = UpdateBeliefSystem( Beliefs, newBeliefs, worst, start )
%
%File name: UpdateBeliefSystem.m
%
% Programmed by Oloruntoba Oluwabunmi
% Last revised: Sept 2019
% Reference: Oloruntoba O., Cosma G., Liotta A. (2019). Clan-based CUltural Algorithm for Feature Selection. In:
% IEEE International Conference on Data Minning (ICDM 2019), November 8-11, 2019, Beijing China
%
% Copyright (c) 2019 Oloruntoba Oluwabunmi<bunmiotoba@gmail.com>.
% Rights Reserved
%
%
% Function to update the BeliefSystem repository of the Clan-Based Cultural Algorithm
% The function takes as input the complete belief systema and the updates
% to be incorporated into the beliefsystem. The new updates are tested to
% determine their suitability for update. If the are deemed suitable, the
% are incorporated into the belief system otherwise they are discarded.
%%
% determine the number of elements in newBeliefs
newBeliefsCount = size(newBeliefs,1);
% % determine the feature size of each belief in the newBeliefs i.e. the
% % number of columns in the dataset
%
% % if the accessment is at the start of the algorithm, update the belief system
if start == true
Beliefs.Situational = newBeliefs(1); %% the best individual is usually the first
% get the best individual
Beliefs.Normative.Max = newBeliefs(1);
%get the worst individual
Beliefs.Normative.Min = worst;
else
% Situational beliefs
if newBeliefs(1).accuracy > Beliefs.Situational.accuracy
% better than previous best
Beliefs.Situational = newBeliefs(1);
end
% Normative beliefs
if Beliefs.Normative.Max.accuracy < newBeliefs(1).accuracy
Beliefs.Normative.Max = newBeliefs(1);
end
if Beliefs.Normative.Min.accuracy > worst.accuracy
Beliefs.Normative.Min = worst; newBeliefs(newBeliefsCount);
end
end
end