Simple decision trees
Update (2016-02-09): It has been brought to my attention that one of the decision trees is not being generated correctly so please don’t use these diagrams. I’m too lazy to debug this code though.
Decision trees are commonly used in machine learning because they work surprisingly well. A simple algorithm to make a decision tree is ID3. We choose the feature that maximizes information gain , defined as:
where is the entropy given by
and the conditional entropy is given by
Type the data here (space delimited; first column is the output).
1 ID3 Tree
2 C4.5 Tree
3 SVG diagram code
This is provided here so that you can save the diagrams by copying the following code into your favourite text editor and then saving it as an SVG file.
3.1 ID3
3.2 C4.5