Fix: mean_squared_error ignores the squared argument if multioutput='raw_values'#16323
Merged
qinhanmin2014 merged 10 commits intoscikit-learn:masterfrom Feb 1, 2020
Merged
Fix: mean_squared_error ignores the squared argument if multioutput='raw_values'#16323qinhanmin2014 merged 10 commits intoscikit-learn:masterfrom
squared argument if multioutput='raw_values'#16323qinhanmin2014 merged 10 commits intoscikit-learn:masterfrom
Conversation
swierh
reviewed
Jan 31, 2020
agramfort
reviewed
Jan 31, 2020
agramfort
reviewed
Jan 31, 2020
agramfort
approved these changes
Jan 31, 2020
Contributor
Author
|
Thanks for the approval @agramfort |
NicolasHug
reviewed
Jan 31, 2020
Member
NicolasHug
left a comment
There was a problem hiding this comment.
Thanks for the PR @rushabh-v , minor comments but it looks good otherwise
| np.sum(1 / y_true) / (4 * n)) | ||
|
|
||
|
|
||
| def test_mean_squared_error_multioutput_raw_value_squared(): |
Member
There was a problem hiding this comment.
Please add a comment e.g.
# non-regression test for https://github.com/scikit-learn/scikit-learn/pull/16323
| mse2 = mean_squared_error( | ||
| [[1]], [[10]], multioutput="raw_values", squared=False | ||
| ) | ||
| assert_allclose(np.sqrt(mse1), mse2) |
Member
There was a problem hiding this comment.
we avoid using those helpers now, you can directly use:
assert np.sqrt(mse1) == pytest.approx(mse2)
thomasjpfan
pushed a commit
to thomasjpfan/scikit-learn
that referenced
this pull request
Feb 22, 2020
panpiort8
pushed a commit
to panpiort8/scikit-learn
that referenced
this pull request
Mar 3, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #16313