Applying Decision Trees
Over the past two lessons of this decision trees course, we learned about how decision trees are constructed. We used a modified version of ID3, which is a bit simpler than the most common tree building algorithms, C4.5 and CART. The basics are the same, however, so we can apply what we learned about how decision trees work to any tree construction algorithm. In this lesson, we’ll learn about when to use decision trees, and how to use them most effectively.
In the previous lessons, we covered on implementing decision trees by hand. While having conceptual knowledge about how a decision tree works and knowing how to build one is handy, there’s bound to be some robust implementation available so you don’t have the build the decision tree from scratch. In this case, we can use the scikit-learn package to construct a decision tree and use it to make predictions.
While exploring when to use decision trees and when to use them most effectively, you’ll continue to work with United States Census data from 1994 in efforts to try and predict if someone makes above or below 50,000 USD per year based on factors such as marital status, age, type of work, and other data reported.
As you work through each concept, you’ll get to apply what you’ve learned from within your browser so that there’s no need to use your own machine to do the exercises. The Python environment inside of this course includes answer checking so you can ensure that you’ve fully mastered each concept before learning the next concept.
- Learn how to train a decision tree model using Scikit-learn.
- Learn how to evaluate error using AUC.
- Learn how to reduce overfitting with decision trees.
- Introduction to the Data Set
- Using Decision Trees With scikit-learn
- Splitting the Data into Train and Test Sets
- Evaluating Error With AUC
- Computing Error on the Training Set
- Decision Tree Overfitting
- Reducing Overfitting With a Shallower Tree
- Tweaking Parameters to Adjust AUC
- Tweaking Tree Depth to Adjust AUC
- Underfitting in Simplistic Trees
- The Bias-Variance Tradeoff
- Exploring Decision Tree Variance
- Pruning Leaves to Prevent Overfitting
- Knowing When to Use Decision Trees