Entropy Curve Calculator

Explore entropy across probabilities, classes, datasets, and decision thresholds while comparing information gain, Gini impurity, classification error, and optimal machine learning splits interactively online.

Results

Choose a mode and calculate entropy.

Binary entropy

Calculator settings


Shared chart and calculation options

Detailed data table

Sort or filter the current calculation output.

No rows

Formula used

H(X) = -Σ pᵢ log_b(pᵢ)

Entropy measures uncertainty within a probability distribution. Pure nodes have zero entropy. Balanced classes produce larger entropy values.

Decision-tree information gain subtracts weighted child entropy from parent entropy. Better splits reduce uncertainty more strongly. Gain ratio can reduce preference for highly fragmented splits.

Information Gain = H(parent) − [nₗ/n · H(left) + nᵣ/n · H(right)]

How to use

  1. Select binary, multiclass, dataset, split, or comparison mode.
  2. Enter probabilities, class counts, or labeled feature data.
  3. Choose the logarithm base and visualization settings.
  4. Calculate to view metrics, curves, markers, and detailed rows.
  5. Export the result, chart, table, configuration, or report.

Example data

Feature valueClass labelSample weight
1.2No1
1.8No1
2.4Yes1
3.0Yes1.5
3.8Yes1

Frequently asked questions

What does entropy measure in machine learning?

Entropy measures uncertainty or class disorder. A pure class distribution has zero entropy.

Why is binary entropy highest at probability 0.5?

Both outcomes are equally likely there. The model therefore has maximum uncertainty.

Which logarithm base should I use?

Base two reports bits. Natural logarithms report nats. Comparisons remain valid when one base is used consistently.

What is normalized entropy?

Normalized entropy divides entropy by its maximum possible value. This produces a scale from zero through one.

How does information gain select a split?

It measures uncertainty reduction after splitting. The threshold with larger gain usually separates classes better.

What is gain ratio?

Gain ratio divides information gain by split information. It can discourage overly fragmented decision-tree splits.

How is entropy different from Gini impurity?

Both quantify impurity. Gini is computationally simpler, while entropy has an information-theoretic interpretation.

Can this calculator use sample weights?

Yes. Split mode accepts an optional third weight column for weighted counts and entropy.

How are zero probabilities handled?

The mathematical limit of zero times log zero is treated as zero. This prevents numerical errors.

Related Calculators

Cost Function CurveGradient Descent Path PlotContour Plot3D Loss SurfaceLearning-Rate Comparison PlotRegularisation CurveSigmoid Function GraphSoftmax Probability PlotGini Impurity CurveCross-Entropy Loss Curve

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.