MNT fix test following scipy.stats.mode change in scipy development version #25393
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partially address #25202.
One of the failure of scipy-dev see https://dev.azure.com/scikit-learn/scikit-learn/_build/results?buildId=50872&view=logs&j=dfe99b15-50db-5d7b-b1e9-4105c42527cf&t=ef785ae2-496b-5b02-9f0e-07a6c3ab3081
scipy.stats.mode
has changed its returned array shape whenaxis=None
andkeepdims=True
. See scipy/scipy#17561 for more details.prints 2 in scipy development version and 1 in scipy latest release.
To be honest I am not sure about our exit strategy with this
_mode
thing ... because there will be a point where we still have to deal with the fact thatsklearn.utils.extmath.weighted_mode
is inconsistent withscipy.stats.mode
for recent scipy versions.Related to #23633