From the course: Machine Learning with scikit-learn
Unlock this course with a free trial
Join today to access over 25,100 courses taught by industry experts.
Build a decision tree - scikit-learn Tutorial
From the course: Machine Learning with scikit-learn
Build a decision tree
Decision trees are one of the most interpretable and powerful models in machine learning. They don't rely on overly complex math or hidden layers. Instead, they mimic how people make decisions. At each step, the model asks a simple question about one feature, splits the data in a way that maximizes the information gained, and continues branching until it reaches a conclusion. By the end of this lesson, you'll be able to build and visualize a decision tree that shows exactly how your model makes predictions. Open the notebook 0207 Decision Tree in Google Colab. Now examine this sample decision tree for Should you wear a rain jacket? A decision tree works by starting at a root node, asking a simple yes or no question, branching based on the answer, and eventually landing on a leaf node that represents the final outcome. Here, start with is it raining, which is the root node, and follow the branches until you reach a leaf like wear rain jacket or take umbrella only. This is the same…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Predict values with supervised learning2m 44s
-
(Locked)
Format your data4m 33s
-
(Locked)
Perform a train-test split3m 58s
-
(Locked)
Create a linear regression model4m 16s
-
(Locked)
Leverage logistic regression3m 43s
-
(Locked)
Evaluate classification models4m 46s
-
(Locked)
Build a decision tree4m 47s
-
(Locked)
Rapidly build models with random forest3m 42s
-
(Locked)
Boost model performance3m 31s
-
(Locked)
-
-
-