Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/5820#discussion_r29737671
--- Diff: mllib/src/main/scala/org/apache/spark/ml/param/params.scala ---
@@ -408,34 +434,21 @@ trait Params extends Identifiable with Serializable {
private def shouldOwn(param: Param[_]): Unit = {
require(param.parent.eq(this), s"Param $param does not belong to
$this.")
}
-}
-/**
- * :: DeveloperApi ::
- *
- * Helper functionality for developers.
- *
- * NOTE: This is currently private[spark] but will be made public later
once it is stabilized.
- */
-@DeveloperApi
-private[spark] object Params {
-
- /**
- * Copies parameter values from the parent estimator to the child model
it produced.
- * @param paramMap the param map that holds parameters of the parent
- * @param parent the parent estimator
- * @param child the child model
- */
- def inheritValues[E <: Params, M <: E](
- paramMap: ParamMap,
- parent: E,
- child: M): Unit = {
- val childParams = child.params.map(_.name).toSet
- parent.params.foreach { param =>
- if (paramMap.contains(param) && childParams.contains(param.name)) {
- child.set(child.getParam(param.name), paramMap(param))
+ /**
+ * Copies param values from this instance to another instance for params
shared by them.
+ * @param to the target instance
+ * @param extra extra params to be copied
+ * @return the target instance with param values copied
+ */
+ protected def copyValues[T <: Params](to: T, extra: ParamMap =
ParamMap.empty): T = {
--- End diff --
Unfortunately, we cannot overload `copyValues` that is generic. So Java
users need to provide `extra`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]