Cumulative Gain Calculator

Analyze ranked outcomes using flexible inputs and charts. Track positive capture at every cutoff level. Understand model ordering performance with confidence clearly today always.

Calculator Input

Use 1 and 0, or yes and no. Commas or new lines both work.
Leave blank if labels are already ranked in the desired order.

Example Data Table

Rank Predicted Score Actual Label Interpretation
10.981Highest ranked case is positive.
20.931Second ranked case is positive.
30.910Third ranked case is negative.
40.871Fourth ranked case is positive.
50.760Fifth ranked case is negative.
60.650Sixth ranked case is negative.

Formula Used

Cumulative Positives at rank k
CP(k) = sum of actual positive labels from rank 1 to k
Cumulative Gain at rank k
CG(k) = CP(k) / Total Positives
Cumulative Gain Percentage
CG%(k) = [CP(k) / Total Positives] × 100
Population Percentage at rank k
Pop%(k) = [k / Total Records] × 100
Lift at rank k
Lift(k) = CG%(k) / Pop%(k)

Cumulative gain shows how many true positives your ranking captures as you move from the highest ranked records toward the full dataset. Better models climb faster and stay closer to the ideal curve.

How to Use This Calculator

  1. Enter a dataset name for reporting clarity.
  2. Paste actual labels using 1 for positive and 0 for negative.
  3. Paste predicted scores if you want automatic descending ranking.
  4. Choose a display step size for the results table.
  5. Select score sorting or use the existing record order.
  6. Click the calculate button to generate metrics and curves.
  7. Review gain percentages at 10%, 25%, and 50% population cutoffs.
  8. Download the results as CSV or PDF when needed.

Frequently Asked Questions

1. What does cumulative gain measure?

Cumulative gain measures how quickly a ranked model captures actual positives as you move through the population from highest score to lowest score.

2. When should I use cumulative gain instead of accuracy?

Use cumulative gain when ranking matters. It is especially useful for lead scoring, fraud review, uplift targeting, and other tasks where you act on only top segments.

3. What is a good cumulative gain curve?

A good curve rises steeply early, meaning top-ranked cases contain many positives. It should stay well above the random baseline and closer to the ideal line.

4. Do I need predicted probabilities?

No. You only need ranked observations. Probabilities help because the calculator can sort automatically, but pre-ranked labels also work correctly.

5. What does top 10% gain mean?

Top 10% gain tells you the percentage of all positives captured within the first tenth of ranked records. Higher values indicate stronger prioritization.

6. Why is lift shown with cumulative gain?

Lift compares your captured positive rate against random selection. It helps show how much better the model performs than picking records without ranking.

7. Can I use imbalanced datasets?

Yes. Cumulative gain is often most useful on imbalanced datasets because it focuses on ranking quality and positive capture, not just overall correctness.

8. Why does the calculator require both positive and negative labels?

A meaningful gain curve needs class contrast. If every record is positive or every record is negative, ranking quality cannot be evaluated properly.

Related Calculators

median rank calculatorideal dcg calculator

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.