File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
main/scala/org/apache/spark/ml
test/java/org/apache/spark/ml/param Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -366,13 +366,11 @@ trait Params extends Identifiable with Serializable {
366366 /**
367367 * Sets default values for a list of params.
368368 *
369- * Note: Java developers should use the single-parameter [[setDefault() ]].
370- * Annotating this with varargs causes compilation failures.
371- *
372369 * @param paramPairs a list of param pairs that specify params and their default values to set
373370 * respectively. Make sure that the params are initialized before this method
374371 * gets called.
375372 */
373+ @ varargs
376374 protected final def setDefault (paramPairs : ParamPair [_]* ): this .type = {
377375 paramPairs.foreach { p =>
378376 setDefault(p.param.asInstanceOf [Param [Any ]], p.value)
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ class CrossValidator extends Estimator[CrossValidatorModel] with CrossValidatorP
105105
106106 override def fit (dataset : DataFrame ): CrossValidatorModel = {
107107 val schema = dataset.schema
108- transformSchema(dataset. schema, logging = true )
108+ transformSchema(schema, logging = true )
109109 val sqlCtx = dataset.sqlContext
110110 val est = $(estimator)
111111 val eval = $(evaluator)
@@ -159,6 +159,7 @@ class CrossValidatorModel private[ml] (
159159 }
160160
161161 override def transform (dataset : DataFrame ): DataFrame = {
162+ transformSchema(dataset.schema, logging = true )
162163 bestModel.transform(dataset)
163164 }
164165
Original file line number Diff line number Diff line change @@ -59,5 +59,6 @@ public JavaTestParams() {
5959 ParamValidators .inArray (validStrings ));
6060 setDefault (myIntParam , 1 );
6161 setDefault (myDoubleParam , 0.5 );
62+ setDefault (myIntParam .w (1 ), myDoubleParam .w (0.5 ));
6263 }
6364}
You can’t perform that action at this time.
0 commit comments