Skip to main content
Calcimator

Information Gain Calculator

Calculate information gain, gain ratio, Gini gain, and feature importance for decision trees.

Inputs

bits
bits
bits

Results

Information Gain

0.38 bits

Information Gain Ratio

0.391

Feature Importance

0.38

Gini Gain-0.24
Entropy Reduction38%
How to Use This Calculator
  1. Enter the class distribution of the parent node (e.g., 40 positive, 60 negative).
  2. Input the class distribution for each child node after splitting on a feature.
  3. Review the calculated entropy of the parent, entropy of each child, and information gain.
  4. Select the feature with the highest information gain for the next decision tree split.
  5. Use Gini impurity as an alternative splitting criterion for faster computation in large datasets.

How the result changes with Parent Entropy

Parent EntropyInformation GainInformation Gain RatioFeature Importance
10.38 bits0.3910.38
3.52.88 bits2.9660.823
6.55.88 bits6.0560.905
98.38 bits8.6310.931

What each input means

Parent Entropy
Entropy of parent node
Left Child Entropy
Entropy of left child node
Right Child Entropy
Entropy of right child node
Left Weight
Proportion of samples in left child
Right Weight
Proportion of samples in right child

How this is calculated

Formula

IG = H(Parent) - Σ(Weight × H(Child))

Worked example, using the default values

  1. Identify Input Parameters
    4 parameters
    Parent Entropy = 1, Left Child Entropy = 0.5, Right Child Entropy = 0.8, Left Weight = 0.6 = 5 input(s) provided
  2. Calculate Information Gain
    Information Gain
    0.38 = 0.38
  3. Calculate Information Gain Ratio
    Information Gain Ratio
    0.391 = 0.391
  4. Calculate Feature Importance
    Feature Importance
    0.38 = 0.38
  5. Calculate Gini Gain
    Gini Gain
    -0.24 = -0.24
  6. Calculate Entropy Reduction
    Entropy Reduction
    38 = 38%

Engine last updated . Checked against 2 independently-derived tests how we verify calculators.

The questions that sit next to this one — chosen by subject, including calculators filed under a different category.

More in Technology & Computing.