/ML-HW2

Hand written digits classification; implementation of the Decision Tree Classifier

Primary LanguagePython

COMS 4771: Homework 2
Question 4: Understanding model complexity and overfitting
Steven Liu (xl2948)

First put digits.mat in the current directory. Then, either enter "python main.py" on Terminal or use PyCharm to run.
You can change K (max depth of the tree) and rate_of_training (percentage of training data in the dataset) in the main function (Line 192-193).




Sample output:

/Users/stevenliu/PycharmProjects/ml-hw2/venv/bin/python /Users/stevenliu/PycharmProjects/ml-hw2/main.py
============================================================
Loading data...
============================================================
Splitting data...
============================================================
Total data: 10000
train_num: 8000
test_num: 2000
============================================================
Benchmarking...
Training Error: 0.01925
============================================================
Benchmarking...
Testing Error: 0.173

Process finished with exit code 0