From the course: Supervised Learning Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

How to build a decision tree

How to build a decision tree - Python Tutorial

From the course: Supervised Learning Essential Training

Start my 1-month free trial

How to build a decision tree

- [Instructor] Let's learn how to build our tree from scratch. First, our algorithm selects the best attribute to split the record first. This is our root node. Then, we build the tree by repeating this process recursively for each child node until we reach a certain criterion. The most common criteria are that there are no more attributes or features to use these decision nodes, or the leftover values are in the same class, or there are no more samples or instances to sort. Before we get to building our decision tree, we want to prepare our data by checking for the criteria we need to make sure our tree works properly. First, we can confirm we're dealing with labeled data, or this would be an unsupervised learning course. Decision trees are fairly simple but prone overfitting. Despite being weak on their own, they can be combined giving birth to bagging or boosting models that are very powerful. There are two main…

Contents