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
Allow components which are not "leaf" children in the class hierarchy #2021
Comments
Options: Next step: schedule a discussion to decide how to go about doing this. |
My opinion is that we shouldn't change anything unless we want to make inheritance of non base classes a more common pattern in our codebase. We currently don't do that so building a system to allow for that seems low priority to me. This issue isn't blocking the target imputer or any short-term work we have ahead of us and the current system for identifying subclasses "works". If we really want 3 then that's another story hehe and I'd be down to hear arguments for it but I don't think there's a need to do it. And if we wanted to leverage the SimpleImputer in the TargetImputer in the future we can use composition over inheritance, which I think is what option 1 is referring to. |
Agreed with @freddyaboulton here, also worth noting that we defined Also okay with the idea of some composition-esque technique if that gets the job done. |
@angela97lin Do you think we can close this? I think we agree that we don't need to make changes to |
@freddyaboulton Sure, we haven't really made inheritance of non base classes a more common pattern in our codebase. Perhaps we can reopen and revisit when/if we actually have a use case again :) |
In working on #1989, @freddyaboulton suggested that we make
TargetImputer
a subclass ofSimpleImputer
. Unfortunately, when looking for viable components in_get_subclasses
,_get_subclasses
will only collect classes that are at the very bottom of the hierarchy. For example:The issue is, if we subclass SimpleImputer, we will have access to TargetImputer, but
SimpleImputer
will no longer be found by EvalML as a useable component:I believe the original intent is to not grab classes that are not useful (ex: Transformer), but this is a problem if we want to build upon useful components to create new ones.
Original comment here: #1989 (comment)
The text was updated successfully, but these errors were encountered: