You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by me...@apache.org on 2015/07/11 06:25:16 UTC

spark git commit: [SPARK-8994] [ML] tiny cleanups to Params, Pipeline

Repository: spark
Updated Branches:
  refs/heads/master 7f6be1f24 -> 0c5207c66


[SPARK-8994] [ML] tiny cleanups to Params, Pipeline

Made default impl of Params.validateParams empty
CC mengxr

Author: Joseph K. Bradley <jo...@databricks.com>

Closes #7349 from jkbradley/pipeline-small-cleanups and squashes the following commits:

4e0f013 [Joseph K. Bradley] small cleanups after SPARK-5956


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/0c5207c6
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/0c5207c6
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/0c5207c6

Branch: refs/heads/master
Commit: 0c5207c66db8cf76950d53404abd43e085f8d45b
Parents: 7f6be1f
Author: Joseph K. Bradley <jo...@databricks.com>
Authored: Fri Jul 10 21:25:09 2015 -0700
Committer: Xiangrui Meng <me...@databricks.com>
Committed: Fri Jul 10 21:25:09 2015 -0700

----------------------------------------------------------------------
 mllib/src/main/scala/org/apache/spark/ml/Pipeline.scala     | 2 ++
 mllib/src/main/scala/org/apache/spark/ml/param/params.scala | 4 +---
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/0c5207c6/mllib/src/main/scala/org/apache/spark/ml/Pipeline.scala
----------------------------------------------------------------------
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 a1f3851..aef2c01 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()
 

http://git-wip-us.apache.org/repos/asf/spark/blob/0c5207c6/mllib/src/main/scala/org/apache/spark/ml/param/params.scala
----------------------------------------------------------------------
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 50c0d85..d034d7e 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.
   }
 
   /**


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org