CalcWorldHub
Free online calculator · no signup

Decision tree split information gain calculator

Compare entropy and Gini reduction for a binary split from aligned class counts.

4,000 tools
Decision tree split information gain calculator — Left child class counts, Right child class counts and calculation method
Decision tree split information gain calculator: inputs and calculation method.

How to use this calculator

Compare entropy and Gini reduction for a binary split from aligned class counts.

  1. Enter Left child class counts, Right child class counts. Match the units shown beside each field and review the result together with the assumptions below.
  2. Read the worked example below to check the expected input format and result.
  3. Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Calculation guide

Decision tree split information gain explained

Entropy information gain0.3973bits
Entropy information gain: 0.39731261 bits in the worked scenario.

How the calculation works

Parent impurity minus weighted child impurity

Add corresponding child counts to reconstruct the parent. Compute entropy with base-two logs or Gini as 1−Σp², then subtract the child impurities weighted by their sample shares.

Set up the calculation

a — Left child class counts
Class counts in the left child, with one nonnegative integer per class in a fixed class order.
b — Right child class counts
Class counts in the right child using that same class order. The parent counts are reconstructed by adding left and right counts.

Limits of this model

Counts must represent the same classes and partition one parent. No split-search bias correction or significance test is applied.

Check this example

Left child class counts = 8, 2; Right child class counts = 1, 9.

  • Entropy information gain: 0.39731261 bits
  • Gini impurity decrease: 0.245

The parent contains 9 and 11 observations of the two classes. The entropy gain is 0.3973126097 bits; the Gini decrease is 0.245.

A perfectly separating split

With left counts (10, 0) and right counts (0, 10), the parent is evenly mixed but both children are pure. Entropy information gain is 1 bit and Gini decrease is 0.5, the maximum for this two-class parent.

Reading the outputs

Information gain is the parent impurity minus the weighted impurity of the two children. A larger reduction means this candidate split separates the observed classes more cleanly, but it does not establish that the split will generalize to new data.

Frequently asked questions

Are class counts required in the same order?

Yes.

Does higher gain select the best overall tree?

No, it is a local split criterion.

Can a class have zero observations?

Yes, zero entropy contributions are treated as zero.

How do I use the Decision tree split information gain calculator?

Enter Left child class counts, Right child class counts. Match the units shown beside each field and review the result together with the assumptions below.

What is a worked example of Decision tree split information gain?

Left child class counts = 8, 2; Right child class counts = 1, 9. Entropy information gain: 0.39731261 bits Gini impurity decrease: 0.245 The parent contains 9 and 11 observations of the two classes. The entropy gain is 0.3973126097 bits; the Gini decrease is 0.245.

Method reference: scikit-learn decision-tree impurity criteria. The guide defines class impurity, Shannon entropy, Gini, and weighted child impurity used to compare a candidate split.