Skip to content

[BUG] Fix Pipeline._transform not chaining transformer outputs#790

Open
WHOIM1205 wants to merge 1 commit intosktime:mainfrom
WHOIM1205:fix/pipeline-transform-chaining
Open

[BUG] Fix Pipeline._transform not chaining transformer outputs#790
WHOIM1205 wants to merge 1 commit intosktime:mainfrom
WHOIM1205:fix/pipeline-transform-chaining

Conversation

@WHOIM1205
Copy link
Contributor

Title

Fix Pipeline._transform to correctly chain transformer outputs during prediction


Summary

This PR fixes a critical bug in Pipeline._transform where transformer outputs were not chained during inference.

Previously, each transformer in the pipeline received the original, untransformed X, and only the last transformer's output (applied to raw input) was passed to the regressor.

This caused:

  • Silent prediction corruption for pipelines with 2+ transformers
  • Incorrect probabilistic outputs (predict_proba, predict_interval, predict_quantiles, predict_var)
  • Invalid cross-validation and evaluation results
  • UnboundLocalError for regressor-only pipelines (0 transformers)

The fix mirrors the chaining logic already used in _fit by reassigning X inside the loop.


Root Cause

In _transform, the output of each transformer was assigned to Xt, but X was never updated:

Xt = transformer.transform(X=X)

Signed-off-by: WHOIM1205 <rathourprateek8@gmail.com>
@WHOIM1205
Copy link
Contributor Author

@fkiraly
fixes a bug in Pipeline._transform where transformer outputs were not chained during prediction
each transformer was incorrectly applied to the original X causing silent prediction errors for multi transformer pipelines the fix reassigns X inside the loop (matching _fit) so transformations are properly chained also resolves UnboundLocalError for regressor only pipelines

Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

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

I think this is a duplicate of #780?

@fkiraly fkiraly added bug module:regression probabilistic regression module labels Mar 5, 2026
@WHOIM1205
Copy link
Contributor Author

I think this is a duplicate of #780?

so should i close this ??

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

Labels

bug module:regression probabilistic regression module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants