Algorithm 1 Pseudo-code of the algorithm of the intuitive classifier . |
-
1:
INPUT:
-
2:
S: training data sample with C columns and N rows
-
3:
attributes are the antecedent
-
4:
1 class variable is the consequent
-
5:
START ALGORITHM
-
6:
CRS {/*initialized as void set*/}
-
7:
for each row in S do
-
8:
if there exists a rule Rj in such that Antecedent(Rj) = Antecedent(row) and Consequent(Rj) = Consequent(row) then
-
9:
for all Ri in such that Antecedent(Ri) = Antecedent(row) do
-
10:
Ri.supp ← Ri.supp + 1
-
11:
end for
-
12:
Rj.conf ← Rj.conf + 1
-
13:
else
-
14:
R ← New Rule
-
15:
R.antecedent ← Antecedent(row)
-
16:
R.consequent ← Consequent(row)
-
17:
R.supp ← 1
-
18:
R.conf ← 1
-
19:
for all Ri in such that Antecedent(Ri) = Antecedent(row) do
-
20:
Ri.supp ← Ri.supp + 1
-
21:
end for
-
22:
← CRS + R {/*add R to */}
-
23:
end if
-
24:
end for
-
25:
return: Classification Rule Set {/*OUTPUT*/}
-
26:
END ALGORITHM
|