'ordered' set of rules

86 Views Asked by At

I have the following decision tree:

X = t
    Y = t
        Z = t: false
        Z = f: true
    Y = f
        Z = t: true
        Z = f: false
X = f
    Y = t
        Z = t: true
        Z = f: false
    Y = f: false   

and the question is to construct a set of ordered classification rules. What exactly does it mean for a set of rules to be ordered?

My answer was:
if X = 1 then 
    if Y = 1 and Z = 0 then true 
    else if Y = 0 and Z = 1 then true
else if X = 0 then
    if Y = 1 and Z = 1 then true
    else if Y = 0 then false

not quite sure about the 'ordering' though

1

There are 1 best solutions below

0
On BEST ANSWER

What you wrote is not a set of rules. A set of rules looks like

  • If $A$ and $B$ and $C$, then True
  • If $A$ and $x$ and $Y$, then True
  • If not $A$ and not $C$, then False

And so on.


In order to do that, you need to flatten your nested if-clauses, and then remove redundant parts. For example, the rule set

  • If $\neg A$, then False
  • If $A$ and $B$, then True
  • If $A$ and $\neg B$, then False

can be reduced to

  • If $\neg A$, then False
  • If $B$, then True
  • If $\neg B$, then False

This reduction is possible because rules are read from top to bottom, and once one rule applies, we stop reading them.