Skip to content

Add explicit top-k group validation in uplift_at_k#226

Open
RiukaRin wants to merge 1 commit into
maks-sh:devfrom
RiukaRin:fix/uplift-at-k-empty-group-check
Open

Add explicit top-k group validation in uplift_at_k#226
RiukaRin wants to merge 1 commit into
maks-sh:devfrom
RiukaRin:fix/uplift-at-k-empty-group-check

Conversation

@RiukaRin

@RiukaRin RiukaRin commented Jul 8, 2026

Copy link
Copy Markdown

name: "Pull request"
about: Make changes in scikit-uplift

📑 Description of the Change

This PR adds explicit validation to uplift_at_k(..., strategy="overall") so the top-k slice must contain both treatment and control samples.
Previously, this edge case could return nan. Now it raises a clear ValueError with a helpful message instead.

Verification Process

Verified the updated code path with direct runtime checks.
Confirmed that uplift_at_k(..., strategy="overall") raises ValueError when one group is missing in the selected top-k slice.
Confirmed that valid inputs still return a finite score.

Release Notes

Improve uplift_at_k validation for empty-group top-k edge cases.

Additional info

This PR is intentionally focused on the uplift_at_k fix only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant