diff options
author | Joseph K. Bradley <joseph@databricks.com> | 2015-07-10 21:25:09 -0700 |
---|---|---|
committer | Xiangrui Meng <meng@databricks.com> | 2015-07-10 21:25:09 -0700 |
commit | 0c5207c66db8cf76950d53404abd43e085f8d45b (patch) | |
tree | 9bf92fac4219804229de9799c3e633cfac894256 /mllib | |
parent | 7f6be1f24d4f2fcb3d3ec181b5abf241709a8b6d (diff) | |
download | spark-0c5207c66db8cf76950d53404abd43e085f8d45b.tar.gz spark-0c5207c66db8cf76950d53404abd43e085f8d45b.tar.bz2 spark-0c5207c66db8cf76950d53404abd43e085f8d45b.zip |
[SPARK-8994] [ML] tiny cleanups to Params, Pipeline
Made default impl of Params.validateParams empty
CC mengxr
Author: Joseph K. Bradley <joseph@databricks.com>
Closes #7349 from jkbradley/pipeline-small-cleanups and squashes the following commits:
4e0f013 [Joseph K. Bradley] small cleanups after SPARK-5956
Diffstat (limited to 'mllib')
-rw-r--r-- | mllib/src/main/scala/org/apache/spark/ml/Pipeline.scala | 2 | ||||
-rw-r--r-- | mllib/src/main/scala/org/apache/spark/ml/param/params.scala | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/ml/Pipeline.scala b/mllib/src/main/scala/org/apache/spark/ml/Pipeline.scala index a1f3851d80..aef2c019d2 100644 --- a/mllib/src/main/scala/org/apache/spark/ml/Pipeline.scala +++ b/mllib/src/main/scala/org/apache/spark/ml/Pipeline.scala @@ -95,6 +95,8 @@ class Pipeline(override val uid: String) extends Estimator[PipelineModel] { /** @group setParam */ def setStages(value: Array[PipelineStage]): this.type = { set(stages, value); this } + // Below, we clone stages so that modifications to the list of stages will not change + // the Param value in the Pipeline. /** @group getParam */ def getStages: Array[PipelineStage] = $(stages).clone() diff --git a/mllib/src/main/scala/org/apache/spark/ml/param/params.scala b/mllib/src/main/scala/org/apache/spark/ml/param/params.scala index 50c0d85506..d034d7ec6b 100644 --- a/mllib/src/main/scala/org/apache/spark/ml/param/params.scala +++ b/mllib/src/main/scala/org/apache/spark/ml/param/params.scala @@ -341,9 +341,7 @@ trait Params extends Identifiable with Serializable { * those are checked during schema validation. */ def validateParams(): Unit = { - params.filter(isDefined).foreach { param => - param.asInstanceOf[Param[Any]].validate($(param)) - } + // Do nothing by default. Override to handle Param interactions. } /** |