Skip to content

Commit

Permalink
[SPARK-8994] [ML] tiny cleanups to Params, Pipeline
Browse files Browse the repository at this point in the history
Made default impl of Params.validateParams empty
CC mengxr

Author: Joseph K. Bradley <[email protected]>

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

4e0f013 [Joseph K. Bradley] small cleanups after SPARK-5956
  • Loading branch information
jkbradley authored and mengxr committed Jul 11, 2015
1 parent 7f6be1f commit 0c5207c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions mllib/src/main/scala/org/apache/spark/ml/Pipeline.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 1 addition & 3 deletions mllib/src/main/scala/org/apache/spark/ml/param/params.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}

/**
Expand Down

0 comments on commit 0c5207c

Please sign in to comment.