You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by gu...@apache.org on 2023/12/04 02:16:34 UTC
(spark) branch master updated: [SPARK-46224][PYTHON][MLLIB][TESTS] Test string representation of TestResult (pyspark.mllib.stat.test)
This is an automated email from the ASF dual-hosted git repository.
gurwls223 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 108e25086e07 [SPARK-46224][PYTHON][MLLIB][TESTS] Test string representation of TestResult (pyspark.mllib.stat.test)
108e25086e07 is described below
commit 108e25086e07e9bcc8290ec946aa421068f4cd59
Author: Hyukjin Kwon <gu...@apache.org>
AuthorDate: Mon Dec 4 11:16:17 2023 +0900
[SPARK-46224][PYTHON][MLLIB][TESTS] Test string representation of TestResult (pyspark.mllib.stat.test)
### What changes were proposed in this pull request?
This PR adds a test for `toString` on the model via `TestResult` within `pyspark.mllib.stat.test`.
### Why are the changes needed?

https://app.codecov.io/gh/apache/spark/blob/master/python%2Fpyspark%2Fmllib%2Fstat%2Ftest.py#L28
This is not being tested.
### Does this PR introduce _any_ user-facing change?
No, test-only
### How was this patch tested?
Manually ran the new unittest.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #44138 from HyukjinKwon/SPARK-46041.
Authored-by: Hyukjin Kwon <gu...@apache.org>
Signed-off-by: Hyukjin Kwon <gu...@apache.org>
---
python/pyspark/mllib/tests/test_stat.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/python/pyspark/mllib/tests/test_stat.py b/python/pyspark/mllib/tests/test_stat.py
index 4fcd49f11bdc..c851768a1fb5 100644
--- a/python/pyspark/mllib/tests/test_stat.py
+++ b/python/pyspark/mllib/tests/test_stat.py
@@ -65,6 +65,7 @@ class ChiSqTestTests(MLlibTestCase):
observed = Vectors.dense([4, 6, 5])
pearson = Statistics.chiSqTest(observed)
+ self.assertIn("Chi squared test summary", str(pearson))
# Validated against the R command `chisq.test(c(4, 6, 5), p=c(1/3, 1/3, 1/3))`
self.assertEqual(pearson.statistic, 0.4)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org