##README
This README describes how to compile and run the program as requested in ML Practical Test.pdf:
dectree input-file output-attribute-index
where the output should be a set of rules defining the built decision tree in the following format:
Attr1 = Val1 & Attr2 = Val2 ... => AttrN = ValN
Download
Click here to download the entire project as a tarball or a zip file.
Prerequisites
None, basically:
- A C++ compiler supporting the
-std=c++11
flag. - A shell (
sh
,bash
,dash
, etc.) to run the compiled program from the command line.
Compile
cd src && make clean all
Run
./dtree ../data/adult.csv 0
Run using shortcuts
make adult0 Shortcut for: ./dtree ../data/adult.csv 0
make adult1
make adult2
...
Using a smaller dataset:
make small0 Shortcut for: ./dtree ../data/adult14.csv 0
make small1
make small2
...
Other datasets:
make party0
make party1
...
make weather0
make weather1
...
Resources
- The Wikipedia article about ID3
- This tutorial explains very well the concepts about about Decision Trees, ID3 , using figures, tables, pseudo-code, and Python code snippets.
- Decision Tree Classifier (C++)
- This Python github project prints out a tree as a flow chart, which makes the whole idea of Decision Trees very easy to grasp