diff options
author | Xiangrui Meng <meng@databricks.com> | 2015-04-15 23:49:42 -0700 |
---|---|---|
committer | Xiangrui Meng <meng@databricks.com> | 2015-04-15 23:49:42 -0700 |
commit | 57cd1e86d1d450f85fc9e296aff498a940452113 (patch) | |
tree | 10e973e431fc3ca3e92c823eed077dae5772f5f5 /mllib/src/test | |
parent | 52c3439a8a107ce1fc10e4f0b59fd7881e851622 (diff) | |
download | spark-57cd1e86d1d450f85fc9e296aff498a940452113.tar.gz spark-57cd1e86d1d450f85fc9e296aff498a940452113.tar.bz2 spark-57cd1e86d1d450f85fc9e296aff498a940452113.zip |
[SPARK-6893][ML] default pipeline parameter handling in python
Same as #5431 but for Python. jkbradley
Author: Xiangrui Meng <meng@databricks.com>
Closes #5534 from mengxr/SPARK-6893 and squashes the following commits:
d3b519b [Xiangrui Meng] address comments
ebaccc6 [Xiangrui Meng] style update
fce244e [Xiangrui Meng] update explainParams with test
4d6b07a [Xiangrui Meng] add tests
5294500 [Xiangrui Meng] update default param handling in python
Diffstat (limited to 'mllib/src/test')
-rw-r--r-- | mllib/src/test/scala/org/apache/spark/ml/param/TestParams.scala | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/mllib/src/test/scala/org/apache/spark/ml/param/TestParams.scala b/mllib/src/test/scala/org/apache/spark/ml/param/TestParams.scala index 8f9ab687c0..641b64b42a 100644 --- a/mllib/src/test/scala/org/apache/spark/ml/param/TestParams.scala +++ b/mllib/src/test/scala/org/apache/spark/ml/param/TestParams.scala @@ -17,16 +17,13 @@ package org.apache.spark.ml.param +import org.apache.spark.ml.param.shared.{HasInputCol, HasMaxIter} + /** A subclass of Params for testing. */ -class TestParams extends Params { +class TestParams extends Params with HasMaxIter with HasInputCol { - val maxIter = new IntParam(this, "maxIter", "max number of iterations") def setMaxIter(value: Int): this.type = { set(maxIter, value); this } - def getMaxIter: Int = getOrDefault(maxIter) - - val inputCol = new Param[String](this, "inputCol", "input column name") def setInputCol(value: String): this.type = { set(inputCol, value); this } - def getInputCol: String = getOrDefault(inputCol) setDefault(maxIter -> 10) |