Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn What is Decision Tree | Decision Tree
Classification with Python

bookWhat is Decision Tree

For many real-life problems, we can build a Decision Tree. In a Decision Tree, we ask a question (decision node), and based on the answer, we either come up with a decision (leaf node) or ask more questions (decision node), and so on.

Here is an example of a duck/not a duck test:

Applying the same logic to the training data allows us to derive one of the most important machine learning algorithms, which can be used for both regression and classification tasks. In this course, we will focus on classification.

The following video illustrates how it works:

Note
Note

In the video above, 'Classes' shows the number of data samples of each class at a node. For example, root node holds all the data samples (4 'cookies', 4 'not cookies'). And the leaf node at the left has only 3 'not cookies'.

With each decision node, we aim to split the training data so that the data points of each class are separated into their own leaf nodes.

A Decision Tree also handles multiclass classification with ease:

And classification with multiple features can also be handled by the decision tree. Now each decision node can split the data using any of the features.

Note
Note

In the video above, the training set is scaled using StandardScaler. It is not necessary for the Decision Tree. It will perform just as well on the unscaled data. But scaling improves the performance of all other algorithms, so it's a good idea to always add the scaling to your preprocessing.

question mark

Choose the INCORRECT statement.

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 3. ChapterΒ 1

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Awesome!

Completion rate improved to 4.17

bookWhat is Decision Tree

Swipe to show menu

For many real-life problems, we can build a Decision Tree. In a Decision Tree, we ask a question (decision node), and based on the answer, we either come up with a decision (leaf node) or ask more questions (decision node), and so on.

Here is an example of a duck/not a duck test:

Applying the same logic to the training data allows us to derive one of the most important machine learning algorithms, which can be used for both regression and classification tasks. In this course, we will focus on classification.

The following video illustrates how it works:

Note
Note

In the video above, 'Classes' shows the number of data samples of each class at a node. For example, root node holds all the data samples (4 'cookies', 4 'not cookies'). And the leaf node at the left has only 3 'not cookies'.

With each decision node, we aim to split the training data so that the data points of each class are separated into their own leaf nodes.

A Decision Tree also handles multiclass classification with ease:

And classification with multiple features can also be handled by the decision tree. Now each decision node can split the data using any of the features.

Note
Note

In the video above, the training set is scaled using StandardScaler. It is not necessary for the Decision Tree. It will perform just as well on the unscaled data. But scaling improves the performance of all other algorithms, so it's a good idea to always add the scaling to your preprocessing.

question mark

Choose the INCORRECT statement.

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 3. ChapterΒ 1
some-alt