This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new eec9fec [SPARK-37522][PYTHON][TESTS] Fix
MultilayerPerceptronClassifierTest.test_raw_and_probability_prediction
eec9fec is described below
commit eec9fecf5e3c1d0631caed427d4d468f44f98de9
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Thu Dec 2 10:30:19 2021 -0800
[SPARK-37522][PYTHON][TESTS] Fix
MultilayerPerceptronClassifierTest.test_raw_and_probability_prediction
### What changes were proposed in this pull request?
This PR aims to update a PySpark unit test case by increasing the tolerance
by `10%` from `0.1` to `0.11`.
### Why are the changes needed?
```
$ java -version
openjdk version "17.0.1" 2021-10-19 LTS
OpenJDK Runtime Environment Zulu17.30+15-CA (build 17.0.1+12-LTS)
OpenJDK 64-Bit Server VM Zulu17.30+15-CA (build 17.0.1+12-LTS, mixed mode,
sharing)
$ build/sbt test:package
$ python/run-tests --testname 'pyspark.ml.tests.test_algorithms
MultilayerPerceptronClassifierTest.test_raw_and_probability_prediction'
--python-executables=python3
...
======================================================================
FAIL: test_raw_and_probability_prediction
(pyspark.ml.tests.test_algorithms.MultilayerPerceptronClassifierTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/Users/dongjoon/APACHE/spark-merge/python/pyspark/ml/tests/test_algorithms.py",
line 104, in test_raw_and_probability_prediction
self.assertTrue(np.allclose(result.rawPrediction,
expected_rawPrediction, rtol=0.102))
AssertionError: False is not true
----------------------------------------------------------------------
Ran 1 test in 7.385s
FAILED (failures=1)
```
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Manually on native AppleSilicon Java 17.
Closes #34784 from dongjoon-hyun/SPARK-37522.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
---
python/pyspark/ml/tests/test_algorithms.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/python/pyspark/ml/tests/test_algorithms.py
b/python/pyspark/ml/tests/test_algorithms.py
index d1a5dea..bf74988 100644
--- a/python/pyspark/ml/tests/test_algorithms.py
+++ b/python/pyspark/ml/tests/test_algorithms.py
@@ -101,7 +101,7 @@ class
MultilayerPerceptronClassifierTest(SparkSessionTestCase):
expected_rawPrediction = [-11.6081922998, -8.15827998691, 22.17757045]
self.assertTrue(result.prediction, expected_prediction)
self.assertTrue(np.allclose(result.probability, expected_probability,
atol=1e-4))
- self.assertTrue(np.allclose(result.rawPrediction,
expected_rawPrediction, rtol=0.1))
+ self.assertTrue(np.allclose(result.rawPrediction,
expected_rawPrediction, rtol=0.11))
class OneVsRestTests(SparkSessionTestCase):
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]