aboutsummaryrefslogtreecommitdiff
path: root/mllib/src/main/scala/org/apache/spark/ml/param/params.scala
diff options
context:
space:
mode:
Diffstat (limited to 'mllib/src/main/scala/org/apache/spark/ml/param/params.scala')
-rw-r--r--mllib/src/main/scala/org/apache/spark/ml/param/params.scala11
1 files changed, 7 insertions, 4 deletions
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 8fd46aef4b..4b4340af54 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
@@ -17,13 +17,12 @@
package org.apache.spark.ml.param
-import java.lang.reflect.Modifier
-
-import org.apache.spark.annotation.AlphaComponent
-
import scala.annotation.varargs
import scala.collection.mutable
+import java.lang.reflect.Modifier
+
+import org.apache.spark.annotation.AlphaComponent
import org.apache.spark.ml.Identifiable
/**
@@ -221,7 +220,9 @@ class ParamMap private[ml] (private val map: mutable.Map[Param[Any], Any]) exten
/**
* Puts a list of param pairs (overwrites if the input params exists).
+ * Not usable from Java
*/
+ @varargs
def put(paramPairs: ParamPair[_]*): this.type = {
paramPairs.foreach { p =>
put(p.param.asInstanceOf[Param[Any]], p.value)
@@ -282,6 +283,7 @@ class ParamMap private[ml] (private val map: mutable.Map[Param[Any], Any]) exten
* where the latter overwrites this if there exists conflicts.
*/
def ++(other: ParamMap): ParamMap = {
+ // TODO: Provide a better method name for Java users.
new ParamMap(this.map ++ other.map)
}
@@ -290,6 +292,7 @@ class ParamMap private[ml] (private val map: mutable.Map[Param[Any], Any]) exten
* Adds all parameters from the input param map into this param map.
*/
def ++=(other: ParamMap): this.type = {
+ // TODO: Provide a better method name for Java users.
this.map ++= other.map
this
}