This repository was made for an assignment regarding Decision Tree and Naive Bayes Theorem.
Here are the instruction to run the Decision Tree program :
- Make sure that you have sklearn version >=0.21 installed for
plot_tree
to work.import sklearn print(sklearn.__version__)
- Install python package, Matplotlib
- Create a
figures
directory if it is not existed. - Next run the python file, and you will see a
.png
image in thefigures
directory.
This tree was generated using the Breast Cancer
data set in scikit-learn
package.
How to run :
- To run this program first you need to create a directory called
data
and download thegolf.csv
then save in the directory. - After that, you can run the program and see the result being printed in the terminal :
Outlook Temp Humidity Windy Play Golf prediction 2 2 83 78 False Yes No 8 1 69 70 False Yes No 4 3 68 80 False Yes Yes Naive Bayes Accuracy : 0.3333333333333333