File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
mllib/src/main/scala/org/apache/spark/ml/param Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -131,23 +131,28 @@ trait Params extends Identifiable with Serializable {
131131 m.invoke(this ).asInstanceOf [Param [Any ]]
132132 }
133133
134- /** Checks whether a param is explicitly set. */
135- private [ml] def isSet (param : Param [_]): Boolean = paramMap.contains(param)
136-
137134 /**
138135 * Internal param map.
139136 */
140137 protected val paramMap : ParamMap = ParamMap .empty
141138
139+ /** Checks whether a param is explicitly set. */
140+ protected def isSet (param : Param [_]): Boolean = paramMap.contains(param)
141+
142142 /**
143143 * Sets a parameter in the own parameter map.
144144 */
145145 protected def set [T ](param : Param [T ], value : T ): this .type = {
146+ require(param.parent.eq(this ))
146147 paramMap.put(param.asInstanceOf [Param [Any ]], value)
147148 this
148149 }
149150
151+ /**
152+ * Gets the value of a parameter.
153+ */
150154 protected def get [T ](param : Param [T ]): T = {
155+ require(param.parent.eq(this ))
151156 paramMap(param)
152157 }
153158}
You can’t perform that action at this time.
0 commit comments