Github user mengxr commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5930#discussion_r29789121
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/param/params.scala ---
    @@ -311,7 +324,11 @@ trait Params extends Identifiable with Serializable {
        */
       protected final def set[T](param: Param[T], value: T): this.type = {
         shouldOwn(param)
    -    paramMap.put(param.asInstanceOf[Param[Any]], value)
    +    if (param.isInstanceOf[StringArrayParam] && 
value.isInstanceOf[Seq[_]]) {
    --- End diff --
    
    This is specialized for `StringArrayParam`. If user adds other `Param` 
types, they cannot modify the code. We can add `set` (or `setAll`) with varargs 
that takes `ParamPair[_]*`, and let users to create `ParamPair` first if the 
value type is different from the param type. For this function, 
`paramMap.put(param.w(value))` should be sufficient.


---
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]

Reply via email to