BANA409BANA409

Decision Tree

A decision tree splits the data into increasingly pure groups. We first work out how those splits are chosen by hand on the golf dataset, then fit a tree with scikit-learn and submit predictions to Kaggle.

Topics

  • Decision Tree Basics — purity and entropy, information gain, and the ID3 algorithm worked through by hand; split points for numeric features, overfitting, and pruning.
  • Decision Tree Prediction — fit a DecisionTreeClassifier, predict on the test set, build the Kaggle submission file, visualize the tree, and copy the complete script from the end of the page.

Datasets and Notebooks

On this page