Marketing teams rank customers by model score and contact the top slice. Cumulative gain at the top q fraction is the share of all positives captured there; lift is gain divided by q.
Implement gains(y, scores, quantiles) returning a list of (q, gain, lift) for each q in quantiles. Sort by score descending (stable on ties), take the top ceil(q * n) rows, and assume at least one positive.