How to code a decision tree in Python from scratch ?
Decision trees are a popular machine learning algorithm used for both classification and regression tasks due to their interpretability and ability to handle non-linear relationships. In this project, you'll learn the fundamentals of Decision trees with the aim of establishing a foundation in this model to better understand more complex ones.
All our Data Science projects include bite-sized activities to test your knowledge and practice in an environment with constant feedback.
All our activities include solutions with explanations on how they work and why we chose them.
Select the Gini index for the entire dataset
Suppose we want to split the dataset based on color. Compute the Gini index for each subset of the dataset that results from this split.
Suppose we want to split the dataset based on taste. Compute the Gini index for each subset of the dataset that results from this split. Which split, based on color or taste, results in a lower Gini index?
What is the Gini index of the initial split of the decision tree