Skip to content

Fix oversized LightGBM default for CATE scoring #1037 - #1042

Open
su-jin1425 wants to merge 1 commit into
uber:masterfrom
su-jin1425:fix-issue-1037
Open

Fix oversized LightGBM default for CATE scoring #1037#1042
su-jin1425 wants to merge 1 commit into
uber:masterfrom
su-jin1425:fix-issue-1037

Conversation

@su-jin1425

Copy link
Copy Markdown
Contributor

Proposed changes

Reduce the default num_leaves for the LightGBM learners used by CATE scoring from 64 to 31.

These learners are fit per fold and per treatment arm, so the previous default was unnecessarily large for the smaller training subsets and could result in unnecessary computation.

This updates the defaults in:

  • compute_dr_pseudo_outcomes
  • dr_score
  • plug_in_t_score

Also adds/strengthens tests covering the default learner paths.

Fixes #1037.

Before and After

image

Test

$ErrorActionPreference="Stop"; $Base="$env:TEMP\causalml-1037-check"; if(Test-Path $Base){Remove-Item $Base -Recurse -Force}; git clone -q https://github.com/uber/causalml.git "$Base\before"; git clone -q https://github.com/su-jin1425/causalml.git "$Base\after"; Set-Location "$Base\before"; git checkout -q 9a2327811406240925e9b8c0ce16734a04da52d7; Write-Host "`n========== BEFORE #1037 ==========" -ForegroundColor Cyan; Select-String -Path "causalml\metrics\cate_scoring.py" -Pattern "num_leaves"; Set-Location "$Base\after"; git checkout -q f53395ac8085ae44f46bbf5f3a826b23ba536b2e; Write-Host "`n========== AFTER #1037 ==========" -ForegroundColor Green; Select-String -Path "causalml\metrics\cate_scoring.py" -Pattern "num_leaves"; Write-Host "`n========== RESULT ==========" -ForegroundColor Yellow; Write-Host "BEFORE: 64 leaves"; Write-Host "AFTER : 31 leaves"; Write-Host "Issue #1037 fix verified."

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Further comments

The change keeps the existing LightGBM learner configuration unchanged apart from num_leaves, reducing the model size for the per-fold, per-arm fitting pattern without changing the public API.

Copilot AI balanced review requested due to automatic review settings August 28, 2026 15:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

cate_scoring default learner is oversized for its own per-fold, per-arm call pattern

2 participants