Skip to content

Commit 0c5207c

Browse files
jkbradleymengxr
authored andcommitted
[SPARK-8994] [ML] tiny cleanups to Params, Pipeline
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
1 parent 7f6be1f commit 0c5207c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mllib/src/main/scala/org/apache/spark/ml/Pipeline.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ class Pipeline(override val uid: String) extends Estimator[PipelineModel] {
9595
/** @group setParam */
9696
def setStages(value: Array[PipelineStage]): this.type = { set(stages, value); this }
9797

98+
// Below, we clone stages so that modifications to the list of stages will not change
99+
// the Param value in the Pipeline.
98100
/** @group getParam */
99101
def getStages: Array[PipelineStage] = $(stages).clone()
100102

mllib/src/main/scala/org/apache/spark/ml/param/params.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,7 @@ trait Params extends Identifiable with Serializable {
341341
* those are checked during schema validation.
342342
*/
343343
def validateParams(): Unit = {
344-
params.filter(isDefined).foreach { param =>
345-
param.asInstanceOf[Param[Any]].validate($(param))
346-
}
344+
// Do nothing by default. Override to handle Param interactions.
347345
}
348346

349347
/**

0 commit comments

Comments
 (0)