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] customizable special attrs in clone #380

Closed
wants to merge 5 commits into from
Closed

Conversation

fkiraly
Copy link
Contributor

@fkiraly fkiraly commented Oct 30, 2024

This PR adds a clone_attrs config field which lets users specify a list of strings, attribute names which are retained in clone beyond the configs and init parameters.

This is by default None, so retains current behaviour.

An approach to sktime/sktime#7333, which would be solved if we set the sklearn specific attribute responsible for set_output in this list, in sktime only.

The main drawback of this would be that sklearn compatibility is not automatic, but contingent on setting this hard-to-find config.

@fkiraly fkiraly added the enhancement Adding new functionality label Oct 30, 2024
fkiraly added a commit that referenced this pull request Nov 13, 2024
This PR refactors the current `_clone` logic, which had a lot of if/else
case distinctions (as in the `sklearn` native code) to a list of plugins
that can be extended.

Above the refactor, it also adds a `sklearn` specific plugin that
dispatches to `sklearn` clone, ensuring that configs get cloned as well.

An approach to sktime/sktime#7333, which would
be solved directly after update.

An alternative to #380, with
advantages:

* `sklearn` compatibility is automatic, for any dependency of `skbase`
* the plugins can later be extended easily, for instance in a case like
the missing `dict` support

A test for sktime/sktime#7333, namely that
output configs are retained in `sklearn` objects, has been added.
@fkiraly
Copy link
Contributor Author

fkiraly commented Nov 13, 2024

superseded by #381 and #383

@fkiraly fkiraly closed this Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant