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 2025/05/06 23:09:47 UTC
(spark) branch master updated: [MINOR][TESTS] Reduce the number of iterations in tuning tests
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 9e7bfc54b2ce [MINOR][TESTS] Reduce the number of iterations in tuning tests
9e7bfc54b2ce is described below
commit 9e7bfc54b2ce6d8ce5b23aac366d9d9dbc80911d
Author: Ruifeng Zheng <ru...@apache.org>
AuthorDate: Wed May 7 08:09:35 2025 +0900
[MINOR][TESTS] Reduce the number of iterations in tuning tests
### What changes were proposed in this pull request?
Reduce the number of iterations in tuning tests:
- test_legacy_mode_tuning
- test_connect_tuning
### Why are the changes needed?
to speed up tests, they sometimes take more than 300sec, after this change 150sec
### Does this PR introduce _any_ user-facing change?
no. test-only
### How was this patch tested?
ci
### Was this patch authored or co-authored using generative AI tooling?
no
Closes #50802 from zhengruifeng/test_legacy_num_iter.
Authored-by: Ruifeng Zheng <ru...@apache.org>
Signed-off-by: Hyukjin Kwon <gu...@apache.org>
---
python/pyspark/ml/tests/connect/test_legacy_mode_tuning.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/python/pyspark/ml/tests/connect/test_legacy_mode_tuning.py b/python/pyspark/ml/tests/connect/test_legacy_mode_tuning.py
index 6cee852247ad..c3da3dc6ed08 100644
--- a/python/pyspark/ml/tests/connect/test_legacy_mode_tuning.py
+++ b/python/pyspark/ml/tests/connect/test_legacy_mode_tuning.py
@@ -201,7 +201,7 @@ class CrossValidatorTestsMixin:
lorv2 = LORV2(numTrainWorkers=2, featuresCol="scaled_features")
pipeline = Pipeline(stages=[scaler, lorv2])
- grid2 = ParamGridBuilder().addGrid(lorv2.maxIter, [2, 200]).build()
+ grid2 = ParamGridBuilder().addGrid(lorv2.maxIter, [2, 5]).build()
cv = CrossValidator(
estimator=pipeline,
estimatorParamMaps=grid2,
@@ -219,7 +219,7 @@ class CrossValidatorTestsMixin:
)
pd.testing.assert_frame_equal(transformed_result, expected_transformed_result)
- assert cv_model.bestModel.stages[1].getMaxIter() == 200
+ assert cv_model.bestModel.stages[1].getMaxIter() == 5
# trial of index 2 should have better metric value
# because it sets higher `maxIter` param.
@@ -246,7 +246,7 @@ class CrossValidatorTestsMixin:
assert cv_model.bestModel.uid == loaded_cv_model.bestModel.uid
assert cv_model.bestModel.stages[0].uid == loaded_cv_model.bestModel.stages[0].uid
assert cv_model.bestModel.stages[1].uid == loaded_cv_model.bestModel.stages[1].uid
- assert loaded_cv_model.bestModel.stages[1].getMaxIter() == 200
+ assert loaded_cv_model.bestModel.stages[1].getMaxIter() == 5
np.testing.assert_allclose(cv_model.avgMetrics, loaded_cv_model.avgMetrics)
np.testing.assert_allclose(cv_model.stdMetrics, loaded_cv_model.stdMetrics)
@@ -270,7 +270,7 @@ class CrossValidatorTestsMixin:
lorv2 = LORV2(numTrainWorkers=2)
- grid2 = ParamGridBuilder().addGrid(lorv2.maxIter, [2, 200]).build()
+ grid2 = ParamGridBuilder().addGrid(lorv2.maxIter, [2, 5]).build()
cv = CrossValidator(
estimator=lorv2,
estimatorParamMaps=grid2,
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org