Algorithm 2 Pseudo-code of the algorithm to predict with a CRS model. |
-
1:
INPUT:
-
2:
s: test row with antecedent attributes
-
3:
: Classification Rule Set
-
4:
USE: RSS: Rule subset
-
5:
START ALGORITHM
-
6:
forto 1 do
-
7:
RSS ← {Ri ∈ CRS / c attributes of s are equal to c attributes of Ri}
-
8:
if RSS then
-
9:
R ← R1 {/* R1 is the first rule of RSS */}
-
10:
for
to
do
-
11:
if R.supp < Rj.supp then
-
12:
R ← Rj
-
13:
else if R.supp = Rj.supp and R.conf < Rj.conf then
-
14:
R ← Rj
-
15:
end if
-
16:
return R.consequent
-
17:
end for
-
18:
end if
-
19:
end for
-
20:
return The resulting predicted class for row s (the consequent of a rule of CRS) {/*OUTPUT*/}
-
21:
END ALGORITHM
|