Skip to content

dr_score and plug_in_t_score document learner as optional but raise without it #1028

Description

@jeongyoonlee

The docstrings of dr_score and plug_in_t_score (causalml/metrics/cate_scoring.py) describe learner as optional, but _resolve_outcome_learners (cate_scoring.py:37) raises unless learner or both of control_outcome_learner/treatment_outcome_learner are passed:

from causalml.metrics import dr_score
dr_score(df, X=X, outcome_col="y", treatment_col="w")
# ValueError: Either `learner` or both `control_outcome_learner` and
# `treatment_outcome_learner` must be specified.

Observed on master (18ebfb0).

Suggestion: either supply a default learner (the sibling metrics in causalml.metrics default to LightGBM elsewhere) or change the docstrings to mark the argument required. Independent of #1026/#1027; touches only the learner-resolution path of cate_scoring.py.

🤖 Generated with Claude Code

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions