Skip to content
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

[ENH] make TabularToSeriesAdaptor compatible with sklearn transformers that accept only y, e.g., LabelEncoder #5982

Merged
merged 2 commits into from Apr 26, 2024

Conversation

fkiraly
Copy link
Collaborator

@fkiraly fkiraly commented Feb 22, 2024

This PR makes TabularToSeriesAdaptor compatible with sklearn transformers that accept only y, e.g., LabelEncoder.

If provided with such a transformer, it plugs in the outer X to the inner y, along the lines of the a suggested design resolution at the root of the problem in sklearn, discussed in #5867.

Towards #5867

FYI @yarnabrina

Question: do you know of a transformer that has (a) only y, and (b) accepts float input? This is to ensure we can test it with the default framework, which currently does not make distinctions in input types.

@fkiraly fkiraly added module:transformations transformations module: time series transformation, feature extraction, pre-/post-processing enhancement Adding new functionality labels Feb 22, 2024
@yarnabrina
Copy link
Collaborator

FYI @yarnabrina

Question: do you know of a transformer that has (a) only y, and (b) accepts float input? This is to ensure we can test it with the default framework, which currently does not make distinctions in input types.

Can you not use LabelEncoder itself, with a categorical variable whose levels are numbers?

I don't know of other transformers specifically for real variables.

@fkiraly
Copy link
Collaborator Author

fkiraly commented Feb 23, 2024

Can you not use LabelEncoder itself, with a categorical variable whose levels are numbers?

That would result in failure (I guess but have not tried), as currently all transformers are tested with all data scenarios, and these are float.

We could do sth similar as #5964 for transformations, but then we'd have to introduce tags for the types both in transformers and scenarios, and ensure there is logic to match them (in is_applicable).

@fkiraly
Copy link
Collaborator Author

fkiraly commented Feb 25, 2024

Hm, I think this cannot be properly tested without having some version of #5886 functioning first. At least, that is required to add #5867 as test case.

@fkiraly fkiraly merged commit 633a766 into main Apr 26, 2024
53 checks passed
@fkiraly fkiraly deleted the sklearn-adapt-only-y branch April 26, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding new functionality module:transformations transformations module: time series transformation, feature extraction, pre-/post-processing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants