aboutsummaryrefslogtreecommitdiff
path: root/mllib/src
diff options
context:
space:
mode:
authorXiangrui Meng <meng@databricks.com>2015-04-15 23:49:42 -0700
committerXiangrui Meng <meng@databricks.com>2015-04-15 23:49:42 -0700
commit57cd1e86d1d450f85fc9e296aff498a940452113 (patch)
tree10e973e431fc3ca3e92c823eed077dae5772f5f5 /mllib/src
parent52c3439a8a107ce1fc10e4f0b59fd7881e851622 (diff)
downloadspark-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')
-rw-r--r--mllib/src/main/scala/org/apache/spark/ml/Identifiable.scala2
-rw-r--r--mllib/src/test/scala/org/apache/spark/ml/param/TestParams.scala9
2 files changed, 4 insertions, 7 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/ml/Identifiable.scala b/mllib/src/main/scala/org/apache/spark/ml/Identifiable.scala
index a50090671a..a1d49095c2 100644
--- a/mllib/src/main/scala/org/apache/spark/ml/Identifiable.scala
+++ b/mllib/src/main/scala/org/apache/spark/ml/Identifiable.scala
@@ -25,7 +25,7 @@ import java.util.UUID
private[ml] trait Identifiable extends Serializable {
/**
- * A unique id for the object. The default implementation concatenates the class name, "-", and 8
+ * A unique id for the object. The default implementation concatenates the class name, "_", and 8
* random hex chars.
*/
private[ml] val uid: String =
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)