Skip to content

fix(preprocessor): report the Box-Cox width in get_feature_info - #140

Open
xillig wants to merge 1 commit into
OpenTabular:mainfrom
xillig:fix/feature-info-boxcox-dimension
Open

xillig wants to merge 1 commit into
OpenTabular:mainfrom
xillig:fix/feature-info-boxcox-dimension

Conversation

@xillig

@xillig xillig commented Nov 11, 2026

Copy link
Copy Markdown

Problem

get_feature_info() measures a numerical block's width by transforming a one-row probe with the block's last step. Box-Cox needs strictly positive input, but the probe is only positive (1e-5) for a block with a "minmax" step. With scaling="standardization" or scaling=None the probe is 0.0, the transform fails, and the feature is reported with dimension=None.

pre = Preprocessor(numerical_method="box-cox", scaling=None).fit(df)
pre.get_feature_info(verbose=False)[0]["a"]["dimension"]  # None, expected 1

Fix

When the probe cannot be transformed, the width comes from the block's fitted span in output_indices_ (each block holds one feature). The change is local: #136 edits the one-hot branch of the same function, and the two merge cleanly.

Tests

tests/compose/test_inspection.py, plus an invariant in tests/integration/test_preprocessor.py: the reported dimension equals output_dims_ for nine methods under all three scaling values.

Validation

Checks: full suite (2574 passed, 59 skipped, 7 xfailed, coverage >= 94.79%), ruff format / ruff check, pyright (no new diagnostics), docs build with -W, scripts/quickstart.py. Merges cleanly with main and with #136.

get_feature_info() measures a numerical block's width by transforming a
one-row probe with the block's last step. Box-Cox needs strictly positive
input, but the probe is only positive (1e-5) for a block with a "minmax"
step, i.e. under the default scaling. With scaling="standardization" or
scaling=None the probe is 0.0, the transform fails, and the feature was
reported with dimension=None although it has one column.

When the probe cannot be transformed, the width now comes from the
block's fitted span in output_indices_, which is the feature's true
output dimension.

This branch has not been deployed

No deployments
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