CalcWorldHub
Free online calculator · no signup

Top-K Cumulative Gain and Lift Calculator

Measure how many positive outcomes appear in a ranked top-K group compared with random selection.

4,000 tools
Top-K Cumulative Gain and Lift Calculator — Total evaluated records, Positive outcomes in population, Records selected in top-K group and calculation method
Top-K Cumulative Gain and Lift Calculator: inputs and calculation method.

How to use this calculator

Measure how many positive outcomes appear in a ranked top-K group compared with random selection.

  1. Enter Total evaluated records, Positive outcomes in population, Records selected in top-K group, Positive outcomes found in top-K group. 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.
Data science calculation

How this calculation works

Ranking models are often used to select a limited number of records for review or action. Enter the population size, the total number of positive outcomes, and the true positives found in the selected top-K records; the results compare that group with the population's baseline rate.

Inputs and units

population — Total evaluated records
Number of records in the evaluation population.
positiveCount — Positive outcomes in population
Total labeled positive records in the same population.
topK — Records selected in top-K group
Number of highest-ranked records included at the chosen cutoff.
truePositivesTopK — Positive outcomes found in top-K group
Count of labeled positives among the selected top-K records.

Formula

Displayed formula

Base positive rate = positives ÷ population. Precision@K = top-K positives ÷ K. Cumulative gain@K = top-K positives ÷ total positives. Lift@K = cumulative gain@K ÷ (K ÷ population) = precision@K ÷ base positive rate.

Method

The inputs describe one ranked cutoff chosen elsewhere. Cumulative gain is the share of all positive cases captured by that cutoff; lift compares this capture against the same-size random population share.

Worked example

In a population of 1,000 records with 100 positives, a top-100 group containing 40 positives has 40% precision, captures 40% of all positives, and has 4.0× lift over the 10% random baseline.

Assumptions and limits

This calculator does not score or rank records and does not generate a full gains curve. It assumes the selected group is the top K records from the same evaluated population and that the positive count is known; use consistent labels, score direction, and evaluation data.

Frequently asked questions

What does lift at K mean?

It is the positive capture rate in the selected portion divided by the portion's share of the population. A value of 1 means random-level capture.

Is precision at K the same as cumulative gain?

No. Precision divides captured positives by K; cumulative gain divides captured positives by all positive cases in the population.

How should I choose K?

Use the number of cases your real workflow can review, contact, or otherwise act on, then evaluate the same cutoff on held-out data.

Can I enter zero positive outcomes?

No. Lift and cumulative gain need at least one positive outcome in the evaluation population.

How do I use the Top-K Cumulative Gain and Lift Calculator?

Enter Total evaluated records, Positive outcomes in population, Records selected in top-K group, Positive outcomes found in top-K group. Match the units shown beside each field and review the result together with the assumptions below.