Skip to content

Fix array-like inputs in ClassTransformationReg - #227

Open
ktz03 wants to merge 1 commit into
maks-sh:devfrom
ktz03:fix/regression-arraylike-0121
Open

ktz03 wants to merge 1 commit into
maks-sh:devfrom
ktz03:fix/regression-arraylike-0121

Conversation

@ktz03

@ktz03 ktz03 commented Oct 16, 2026

Copy link
Copy Markdown

📑 Description of the Change

ClassTransformationReg.fit documents one-dimensional array-like targets and treatment labels, but the transformed outcome is currently calculated using the input containers directly. A list or tuple treatment raises TypeError with a constant propensity. Two pandas Series with different indices are label-aligned during multiplication and produce missing target values even though their positional samples are valid.

Convert both vectors to NumPy arrays for this calculation. The propensity estimation and regression formula are unchanged. Add regressions for lists, tuples, and differently indexed Series with constant and estimated propensity.

Verification Process

  • Windows, Python 3.9.25, NumPy 1.23.5, pandas 1.5.3, scikit-learn 1.1.3: 357 tests passed across the model, metric, visualization, and import test files. Dataset download tests were not run.
  • With the new tests against unmodified dev, four regressions fail and two pass; all six pass with the fix.
  • A separate 32-case public API matrix on Python 3.11.16 covers mixed input containers: ten failures become correct results, and all 22 working cases retain their exact predictions. Caller inputs remain unchanged.
  • The complete model file on scikit-learn 1.2.2 retains 96 pre-existing mixed-column-name failures in other models; none are added by this change.

Release Notes

Fix array-like target and treatment handling in ClassTransformationReg.fit.

Additional info

This preserves the transformed-outcome model introduced by @mcullan in #111.

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