Skip to content

Outcomes shape handling in predict_dte #147

Description

@msukiasyan

This issue is in relation to JOSS review thread openjournals/joss-reviews#11047

predict_dte, at least for the SimpleDistributionEstimator class, seems to return incorrect output when the outcomes array has a single column shape. This might be a common slip-up for users so would be good to do better shape validation and cover with tests. Here is an example:

from dte_adj import SimpleDistributionEstimator

X = np.zeros((4, 1))
D = np.array([0, 0, 1, 1])
Y = np.array([0., 1., 2., 3.])

for outcomes in (Y, Y[:, None]):
    est = SimpleDistributionEstimator().fit(X, D, outcomes)
    effect, _, _ = est.predict_dte(1, 0, np.array([1.]), display_progress=False)
    print(effect.shape, effect.ravel())
# (1,)   [-1.]
# (4, 1) [0. 0. 0. 0.]```

Activity

added a commit that references this issue on Oct 6, 2026

TomeHirata commented on Oct 6, 2026

@TomeHirata
Collaborator

Fixed in #150. fit now flattens single-column outcomes, treatment_arms, strata and treatment_indicator to 1-D, so Y and Y[:, None] give the same predict_dte output. Any other shape now raises a ValueError. Tests cover both cases.


Generated by Claude Code

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions