Less verbose estimator tags mechanism#14892
Conversation
|
So if at least one tag is run-time dependent, I don't know how I feel about that. Apart from saving 2 lines of code, what's the real benefit? |
you mean half a line, if none is runtime dependent and adding half a line if any are?
It's a property if any is runtime dependent and a class attribute otherwise. |
|
This saves a couple of characters but makes the runtime dependence of the tags implicit. Not sure if that's worth it. I think it's better to think about what mechanism we want, not how long the code is. I could add a helper in #14644 to make it similarly short, but I'm not sure it would add clarity. |
|
btw most of the "allow_nan" ones are actually runtime dependent, like they are in KNNImputer. The other imputers don't implement the tag correctly, I think. |
|
At this point, I'm -1.
I want it to be obvious to a developer that the tags are a function of the
parameters. I don't think the benefit afforded by slightly less code
portrays the right functional abstraction.
|
Alternative to #14644
We should pick one of these two PRs.
This uses the current tag estimator mechanism but changes it from,
to a less verbose,
_more_tagscan also be a property.The previous behavior still works with a deprecation warning.
Tried to also address @thomasjpfan's comment from #14884 (comment)
but the description can certainly be improved.
cc @amueller