Change default high cardinality encoder to StringEncoder - #1354
Conversation
|
Two tests are failing and I am not sure what's the best way to address the issues When testing the I tried to address the TableVectorizer test by adding a filterwarning, but I managed to turn that into an internal error of pytest by doing that |
|
@glemaitre talking with @rcap107 we were thinking the simplest thing here would be to warn in |
|
I have a high bias towards what scikit-learn do. However, I'm not sure that our encoders are passing the test suite so maybe we could avoid it. |
|
Also I see that you are using a |
in this case (change the default value of an argument) what is the "canonical" approach? |
|
Indeed, we use the We document it here: https://scikit-learn.org/dev/developers/contributing.html#change-the-default-value-of-a-parameter |
ok but then the attribute is "warn" so we cannot set params on the subestimator if we use the default right. which is why the current defaults are what they are and we clone in the init -- I don't know if you remember that discussion from way back |
|
I'm fine being a bit more brutal here than in scikit-learn with backwards compatibility.
…On Apr 30, 2025, 17:23, at 17:23, "Jérôme Dockès" ***@***.***> wrote:
jeromedockes left a comment (skrub-data/skrub#1354)
> Indeed, we use the "warn" string in __init__ and check in fit.
ok but then the attribute is "warn" so we cannot set params on the
subestimator if we use the default right. which is why the current
defaults are what they are and we clone in the init -- I don't know if
you remember that discussion from way back
--
Reply to this email directly or view it on GitHub:
#1354 (comment)
You are receiving this because you are subscribed to this thread.
Message ID: ***@***.***>
|
|
Yep. I'm fine to be pragmatic and have something working. |
|
In this case, which one is the "pragmatic approach"? |
I think issuing the warning in |
|
should the deprecation be more evident in the changelog? |
| # TODO: remove when StringEncoder is set as default high cardinality encoder | ||
| 'ignore:.*default high_cardinality encoder*:FutureWarning', |
There was a problem hiding this comment.
I guess we can remove this?
I think so, maybe by putting it at the top of the directive? also in the docstring itself, at the end of the paragraph about this encoder, you can use a directive similar to: (search for "versionchanged" in the scikit-learn codebase and you will find many examples) |
jeromedockes
left a comment
There was a problem hiding this comment.
LGTM, thanks a lot @rcap107 ! this will speed-up a lot of pipelines that use the tablevectorizer :)
Vincent-Maladiere
left a comment
There was a problem hiding this comment.
LGTM! Thanks @rcap107
This is a draft PR for changing the default encoders from Gap (in the TableVectorizer) and Minhash (in the tabular_learner) to StringEncoder in both cases.