Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/5431#discussion_r28290695
--- Diff: mllib/src/main/scala/org/apache/spark/ml/param/params.scala ---
@@ -179,52 +179,96 @@ trait Params extends Identifiable with Serializable {
/**
* Sets a parameter (by name) in the embedded param map.
*/
- private[ml] def set(param: String, value: Any): this.type = {
+ protected final def set(param: String, value: Any): this.type = {
set(getParam(param), value)
}
/**
- * Gets the value of a parameter in the embedded param map.
+ * Optionally returns the user-supplied value of a param.
+ */
+ final def get[T](param: Param[T]): Option[T] = {
--- End diff --
I made this change in my last commit. `set` cannot be public because
`Model` also extends `Params` and some params should be immutable in models.
Maybe `clear` shouldn't be public either. But for get, getDefault, and
getOrDefault, I think those could be public.
---
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]