Skip to content

Conversation

@glemaitre
Copy link
Member

Related to #23626

minimize validates the input and x0 should be a 1D array in the future.

Copy link
Member

@lesteve lesteve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine.

It looks like we were using a slightly unsupported behaviour. It seems to be working as expected even if the array was multi-dimensional and scipy.optimize.minimize expects a 1d array for its x0 parameter.

Edit: in this case we are using LBFGS which does the x0.ravel() anyway so we were fine I think: https://github.com/scipy/scipy/blob/5f92e82876e876bb8132c6ad9ed53c500e05f93e/scipy/optimize/_lbfgsb_py.py#L277

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirm that this fixed fixes the test_estimators[NeighborhoodComponentsAnalysis() test with -Werror::DeprecationWarning

LGTM

@thomasjpfan thomasjpfan merged commit 67c7984 into scikit-learn:main Jun 21, 2022
ogrisel pushed a commit to ogrisel/scikit-learn that referenced this pull request Jul 11, 2022
glemaitre added a commit to glemaitre/scikit-learn that referenced this pull request Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants