Dataset drift histogram comparison calculator

Calculate total variation distance and L1 histogram distance with your own figures.

Your numbers

Use the units shown. Results update as you change valid inputs.

Use total variation distance and L1 histogram distance to compare changes to your inputs. The method and limits below explain the scope.

Examples

Examples

Try the starting example

Reference same-bin counts
20,30,50
Current same-bin counts
30,30,40
Total variation distance
0.1
L1 histogram distance
0.2
Maximum bin probability change
0.1

Try another scenario

Reference same-bin counts
20,30,50
Current same-bin counts
10,20,70
Total variation distance
0.2
L1 histogram distance
0.4
Maximum bin probability change
0.2
Calculation method

Calculation method

Total variation distance

sum(abs(u/sum(a)-v/sum(b)) for u,v in zip(a,b))/2

L1 histogram distance

sum(abs(u/sum(a)-v/sum(b)) for u,v in zip(a,b))

Maximum bin probability change

max(abs(u/sum(a)-v/sum(b)) for u,v in zip(a,b))

Symbols and units
a
Reference same-bin counts
b
Current same-bin counts

Use the units shown. A list keeps the order in which you enter its values. The symbol ^ means “raised to the power of”.

Calculation steps and notation

sum(list) adds all entries in the list.

Assumptions & limits

Assumptions & limits

  • Common bin boundaries fixed before entry; equal-length nonnegative count arrays with positive totals. Named probability distances, no automatic drift alarm threshold. Supported limits: All numeric inputs must be finite. Only the explicitly described mathematical scenario is supported.
Are these inputs private?

These calculations run in your browser. A shared link contains the values you choose to share. Only questions submitted to the separate AI finder are sent to OpenAI.

Share this page
Share this calculator

Leave unchecked to share the page without your entered values.