FIX fix comparison between array-like parameters when detecting non-default params for HTML representation - #31528
Conversation
|
Instead of wrapping it in a try except, we could use which should work because |
|
Please also add a non regression test and a changelog entry. You can reuse the snippet from the issue. |
We probably want to do that only if one of the two parameters is an array-like. Otherwise, we want to use the Python comparison for scalars.
I'm wondering if we could strengthen the non-regression test by checking different combination of parameters (int, float, bool, array-like, ndarray, etc.). |
This reverts commit 4556bf2.
|
Thank you both @jeremiedbb and @glemaitre If a default parameter is |
I'm okay to show it as the same because we don't have a way to differentiate for scalar values anyway (since we're not using sentinels for default values, but we're not going to do that).
Why only for array-likes ? it also works for scalar values being any kind of object. |
Do you want to call |
|
@glemaitre @jeremiedbb |
RideCV diagram representation with non-default alphas
Yes because it works (at least for our use cases as far as I can tell) with a single condition :) |
|
I added a couple of cases: 2 different size arrays, and one int vs float. Also removed the the |
|
Have you considered using hypothesis to test/find edge cases? I mean in general, in the past. I don't mean it should be used now. It's quite good to find them, as you might know. |
There is a discussion that have been started here: #13846 |
|
I added the PR into the 1.7.1 milestone. Thanks @DeaMariaLeon |
|
We special case |
…efault params for HTML representation (scikit-learn#31528)
…efault params for HTML representation (scikit-learn#31528)
…efault params for HTML representation (scikit-learn#31528)
…efault params for HTML representation (scikit-learn#31528)
…efault params for HTML representation (scikit-learn#31528)
Reference Issues/PRs
Fixes #31525
What does this implement/fix? Explain your changes.
As @glemaitre commented, we were comparing 2 different-size arrays:
param_value != init_default_params[param_name]Any other comments?
😱