-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
FeatureUnion not working when aggregating data and pandas transform output selected #25730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
As noted in the glossery, Scikit-learn transformers expects that To better understand your use case, how do you intend to use the |
I haven't known that. Good to know. What is the correct way to aggregate or drop rows in a pipeline? Isn't that supported?
The actual use case: I have a time series ( |
As I see there is the same "problem" in |
I have a look at how https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/utils/_set_output.py#L55-L62 Is there any reason to set index here? If transformer returned a With index restoration it is also expected for transformers that index should not be changed (or if it is changed by transformer then What is the design decision to not allow changing index and row count in data by transformers? In time series problems I think it is very common to aggregate raw data and modify original index. |
Yea, changing the number of rows is not supported. There is a lengthy discussion about it in #3855 As for this specific issue, I think we can get away with not setting the index so your use case just works. I opened #25747 to propose this change. |
@thomasjpfan Thank you very much! |
Describe the bug
I would like to use
pandas
transform output and use a custom transformer in a feature union which aggregates data. When I'm using this combination I got an error. When I use defaultnumpy
output it works fine.Steps/Code to Reproduce
Expected Results
No error is thrown when using
pandas
transform output.Actual Results
Versions
The text was updated successfully, but these errors were encountered: