Learning Decision Trees
- When I think of learning decision trees, I think of
C4.5. This is closely related to what
Russell and Norvig describe.
- The key bit is to take the data, and see what feature splits apart
the data best.
- Yellow 2:3, Purple 2:3; Small 2:2; Large 2:4; Stretch 4:2; Dip 0:4;
Adult 4:2; Child 0:4.
- In this case, both Age and Act split the data perfectly.
- Train
Colour | Size | Act | Age | Category/Inflated |
YELLOW | SMALL | STRETCH | ADULT | T |
YELLOW | SMALL | DIP | ADULT | F |
YELLOW | LARGE | STRETCH | ADULT | T |
YELLOW | LARGE | STRETCH | CHILD | F |
YELLOW | LARGE | DIP | CHILD | F |
PURPLE | SMALL | STRETCH | ADULT | T |
PURPLE | SMALL | DIP | ADULT | F |
PURPLE | LARGE | STRETCH | ADULT | T |
PURPLE | LARGE | STRETCH | CHILD | F |
PURPLE | LARGE | DIP | CHILD | F |
- I picked Stretch, and if it's False(Dip), it gives the correct answer.
- Pull all of those out, and do it again.
- Modified Train
Colour | Size | Act | Age | Category/Inflated |
YELLOW | SMALL | STRETCH | ADULT | T |
YELLOW | LARGE | STRETCH | ADULT | T |
YELLOW | LARGE | STRETCH | CHILD | F |
PURPLE | SMALL | STRETCH | ADULT | T |
PURPLE | LARGE | STRETCH | ADULT | T |
PURPLE | LARGE | STRETCH | CHILD | F |
- In this case age splits perfectly, and you get the decision tree.
- If a feature is integer or floating point you may need to
pick ranges.