This repository is my implementation of Decision Trees from scratch. No use of Machine Learning libraries. I even skipped on Pandas and Numpy. So, basically everything is from scratch.
Sure the algorithm can be tuned at a lot of places for better results. But, the point of this implementation is to get a clear idea about how the algorithm works :)
That said, I plan on improving my code as I learn new techniques.
Using KCrossValidation using 3
folds on the banknote
dataset, this is the output
NOTE: Data preprocessing is not taken much into account
- Clone the repo
git clone https://github.com/iArunava/Decision-Trees.git
- Move into the cloned repo
cd Decision-Trees
- Run the
main.py
file
python3 main.py
- You can pass the
max_depth=
andmin_size=
as arguments while calling themain.py
file.
python3 main.py 12 10
NOTE: max_depth
is the first argument and min_size
is the second argument.
NOTE: Missing one argument will set default arguments for max_depth
and min_size
with a warning shown.
NOTE: The default parameters for max_depth
is 9
and min_size
is 8
.
Distributed under MIT. Have fun!