[MINOR][PYTHON] Fix MultilayerPerceptronClassifierTest.test_raw_and_probability_prediction#35997
Closed
harupy wants to merge 1 commit intoapache:masterfrom
Closed
[MINOR][PYTHON] Fix MultilayerPerceptronClassifierTest.test_raw_and_probability_prediction#35997harupy wants to merge 1 commit intoapache:masterfrom
MultilayerPerceptronClassifierTest.test_raw_and_probability_prediction#35997harupy wants to merge 1 commit intoapache:masterfrom
Conversation
MultilayerPerceptronClassifierTest.test_raw_and_probability_prediction
harupy
commented
Mar 29, 2022
| result.rawPrediction, | ||
| expected_rawPrediction, | ||
| rtol=0.15, | ||
| rtol=0.3, |
Contributor
Author
There was a problem hiding this comment.
Test
import numpy as np
a = np.array([-14.190332, -10.063731, 26.570715])
b = np.array([-11.608192, -8.15828, 22.17757])
atol = 1e-08
print(np.max((np.abs(a - b) - atol) / np.abs(b))) # 0.2335603816000433
rtol = 0.3
np.testing.assert_allclose(a, b, rtol=rtol, atol=rtol)
HyukjinKwon
approved these changes
Mar 29, 2022
Member
|
im gonna merge this first, and montior if the test is still flaky. |
Member
|
Merged to master and branch-3.3. |
HyukjinKwon
pushed a commit
that referenced
this pull request
Mar 29, 2022
…probability_prediction` ### What changes were proposed in this pull request? - A follow-up for #35778 - Increase `rtol` to de-flake the test. https://github.com/apache/spark/runs/5725350556 ``` Not equal to tolerance rtol=0.15, atol=1e-08 Mismatched elements: 3 / 3 (100%) Max absolute difference: 4.39314499 Max relative difference: 0.23356037 x: array([-14.190332, -10.063731, 26.570715]) y: array([-11.608192, -8.15828 , 22.17757 ]) ``` ### Why are the changes needed? ### Does this PR introduce _any_ user-facing change? ### How was this patch tested? Closes #35997 from harupy/fix-test_raw_and_probability_prediction-2. Authored-by: Harutaka Kawamura <hkawamura0130@gmail.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org> (cherry picked from commit 264dbd7) Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
Member
|
Thank you, @harupy and @HyukjinKwon . |
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.
What changes were proposed in this pull request?
MultilayerPerceptronClassifierTest.test_raw_and_probability_prediction#35778rtolto de-flake the test.https://github.com/apache/spark/runs/5725350556
Why are the changes needed?
Does this PR introduce any user-facing change?
How was this patch tested?