-
Notifications
You must be signed in to change notification settings - Fork 9
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] skbase
clone
vs sklearn
clone
- comparison and actions
#280
Comments
These are likely due to changes that were merged in The forking was conscious, as discussed in #275 - for instance, the more recently added
The simple reason is that
Yes, this stuff was added recently in For instance, sth like Feels a bit like a gradual "Lasagna-fication" of once crisp architecture...
Yes, given that it happens in the same place where the |
skbase
clone
vs sklearn
clone
- comparison and actionsskbase
clone
vs sklearn
clone
- comparison and actions
#281 improves the structure, but does not add support for |
#### Reference Issues/PRs #280 #### What does this implement/fix? Explain your changes. - Simplify `.clone()`'s implementation to 3 easy-to-understand steps: 1. clone `self` 2. if `check_clone`, run extra checks 3. return cloned object - Refactor extra clone checks into a private `_check_clone()` function - Refactor the private `._check()` method into a private `_check()` function - I think this is more idiomatic since the current `._check()` implementation was not accessing any instance (`self`) attributes or methods. It would only recursively call itself again as `self._clone(...)`, in practice making it a static method. - I don't think this function should ever depend on any private instance attributes or ever mutate the state of the object being cloned. - In practice, this is 100% equivalent in behaviour but I think it's a more _intentional_ and idiomatic implementation. - As a bonus (but probably not coincidentally), makes it more in line with sklearn's reference implementation
posted by @tpvasconcelos in #275 - opening a new issue to discuss design and actions arising, if any
Just for reference, I'm attaching a visual diff between the current
BaseObject._clone()
implementation and sklearn's_clone_parametrized()
:Summary of differences:
_metadata_request
and_sklearn_output_config
attributesI need to think more about this to give any meaningful input here.
@fkiraly definitely
Originally posted by @tpvasconcelos in #275 (comment)
The text was updated successfully, but these errors were encountered: