aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDavies Liu <davies@databricks.com>2015-02-04 08:54:20 -0800
committerXiangrui Meng <meng@databricks.com>2015-02-04 08:54:20 -0800
commit38a416f0360fa68fc445af14910fb253ff9ad493 (patch)
treeb3db4645c39c97822c3b8c47d50916aa78356ec8 /python
parent5aa0f219d1f8e8d3bb083dd547532ebb72ba7a15 (diff)
downloadspark-38a416f0360fa68fc445af14910fb253ff9ad493.tar.gz
spark-38a416f0360fa68fc445af14910fb253ff9ad493.tar.bz2
spark-38a416f0360fa68fc445af14910fb253ff9ad493.zip
[SPARK-5585] Flaky test in MLlib python
Add a seed for tests. Author: Davies Liu <davies@databricks.com> 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
Diffstat (limited to 'python')
-rw-r--r--python/pyspark/mllib/tests.py2
1 files changed, 1 insertions, 1 deletions
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)