Decision Tree (ID3)
A supervised learning algorithm that recursively splits data based on attributes yielding the highest Information Gain to form a predictive tree.
Node Data
Subset: Root
A supervised learning algorithm that recursively splits data based on attributes yielding the highest Information Gain to form a predictive tree.
Subset: Root
A Decision Tree is one of the most intuitive and interpretable models in machine learning. It makes predictions by learning a series of simple "if-then-else" rules from the data, forming a tree-like structure. This lab visualizes the ID3 (Iterative Dichotomiser 3) algorithm, which builds the tree by asking one simple question at each step: "Which feature gives me the most information to help classify my data?"
The goal of the ID3 algorithm is to build a tree that separates the data into pure groups (i.e., groups containing only a single class) as efficiently as possible. It does this by choosing the best feature to split on at each node. The "best" feature is the one that results in the most significant reduction in uncertainty, a concept measured by Information Gain.
First, we measure the "impurity" or "randomness" of a set of data using a metric called Entropy. A dataset with a perfect mix of all classes (e.g., 50% 'Yes', 50% 'No') has the highest entropy (maximum uncertainty). A dataset with only one class (e.g., 100% 'Yes') has zero entropy (perfect certainty).
For each feature, the algorithm calculates what the entropy would be after splitting the data based on that feature's values. Information Gain is simply the initial entropy minus the weighted average entropy after the split. The feature with the highest information gain is chosen for the split because it does the best job of creating purer, more organized subgroups.
This lab lets you manually build a decision tree step-by-step to understand the ID3 algorithm's logic.
Follow these steps to see the algorithm in action.
A supervised learning algorithm that recursively splits data based on attributes yielding the highest Information Gain to form a predictive tree.