Interactive Decision Tree Split

This simulation demonstrates how a decision tree evaluates a feature to split data. Move the slider to define a threshold. The goal is to separate the Blue and Orange dots as cleanly as possible.

What is Entropy?

Entropy ($H$) is a measure of impurity or randomness in a group. A perfectly mixed group (50/50) has an entropy of 1.0. A completely pure group (all one color) has an entropy of 0.0.

What is Information Gain?

Information Gain ($IG$) measures the reduction in entropy after splitting the data. Decision trees algorithmically choose the split that maximizes this gain.

Data Visualization

Feature Value: 0 Current Split: 50 Feature Value: 100

Total Information Gain

0.000

Goal: Find the split with the highest number.

Left Node Entropy

0.000
0 items

Right Node Entropy

0.000
0 items

Mathematical Formulas

1. Calculate Parent Entropy:

H(S) = -p₁ log₂(p₁) - p₂ log₂(p₂)
Parent Entropy: 0.000

2. Calculate Information Gain:

IG = H(Parent) - [ (N_L / N) * H(L) + (N_R / N) * H(R) ]