From 38a416f0360fa68fc445af14910fb253ff9ad493 Mon Sep 17 00:00:00 2001 From: Davies Liu Date: Wed, 4 Feb 2015 08:54:20 -0800 Subject: [SPARK-5585] Flaky test in MLlib python Add a seed for tests. Author: Davies Liu Closes #4358 from davies/flaky_test and squashes the following commits: 02371c3 [Davies Liu] Merge branch 'master' of github.com:apache/spark into flaky_test ced499b [Davies Liu] add seed for test --- python/pyspark/mllib/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python/pyspark') diff --git a/python/pyspark/mllib/tests.py b/python/pyspark/mllib/tests.py index 42aa228737..49e5c9d58e 100644 --- a/python/pyspark/mllib/tests.py +++ b/python/pyspark/mllib/tests.py @@ -285,7 +285,7 @@ class ListTests(PySparkTestCase): self.assertTrue(dt_model.predict(features[3]) > 0) rf_model = RandomForest.trainRegressor( - rdd, categoricalFeaturesInfo=categoricalFeaturesInfo, numTrees=100) + rdd, categoricalFeaturesInfo=categoricalFeaturesInfo, numTrees=100, seed=1) self.assertTrue(rf_model.predict(features[0]) <= 0) self.assertTrue(rf_model.predict(features[1]) > 0) self.assertTrue(rf_model.predict(features[2]) <= 0) -- cgit v1.2.3