There are a number of ways to model a decision tree. In this video, learn how to make a visualization based on a decision tree model using the Python libraries scikit-learn and Matplotlib.
- [Instructor] How do you understand … how decision tree makes predictions? … One of the strengths of decision trees, … are they're relatively easy to interpret, … as you can make a visualization based on your model. … This is not only a powerful way to understand your model, … but also to communicate how a model works as stakeholders. … In this video, I'll show you how decision trees, … can be plotted with Matplotlid . … The first thing you have to do, is import libraries. … Take note that you're also importing tree. … This is what actually plots to the decision tree. … The next step is a loaded dataset, … in this case is the Iris dataset. … From there, you can split … your data into training and test sets. … This is really important for decision trees, as they tend … to be a high variance algorithm. … What this means, is they tend to overfit … on the training set. … The next step is to create a decision tree model. … Before you can make a visualization based … on a decision tree, you need to make a decision tree first. …
This course was created by Madecraft. We are pleased to host this content in our library.
- Why use scikit-learn?
- Supervised vs. unsupervised learning
- Linear and logistic regression
- Decision trees and random forests
- K-means clustering
- Principal component analysis (PCA)