MAINT refactoring get_feature_names_out to define it in encoders#1634
Conversation
|
This is the first part of an issue on refactoring the |
glemaitre
left a comment
There was a problem hiding this comment.
As a first step, it looks good. We can further see if we want to limit the code redundancy but since the remaining duplicated code are in different files, I'm not sure that in terms of maintenance and code complexity, it is better to get an abstraction just for the get_feature_names_out and encoder exposing a n_components_ attribute.
glemaitre
left a comment
There was a problem hiding this comment.
Just pushed a small fixed to make sure that _SplineEncoder follows the scikit-learn API (not overwrite attributes) and make sure that we cover the line that was not covered before.
…ub-data#1634) Co-authored-by: Guillaume Lemaitre <guillaume@probabl.ai>
Co-authored-by: Guillaume Lemaitre <guillaume@probabl.ai>
Remove
get_feature_names_outfrom theSingleColumnTransformerclass and add it to the specialized encoders since they might specialized depending on their own parameters.