Github user petro-rudenko commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5510#discussion_r28339279
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/tuning/ParamGridBuilder.scala ---
    @@ -100,10 +100,11 @@ class ParamGridBuilder {
        * Builds and returns all combinations of parameters specified by the 
param grid.
        */
       def build(): Array[ParamMap] = {
    -    var paramMaps = Array(new ParamMap)
    +    var paramMaps = Array.empty[ParamMap]
    --- End diff --
    
    Do you mean like this:
    ```scala
    def build(): Array[ParamMap] = {
        if (paramGrid.isEmpty) Array.empty[ParamMap]
        else {
          var paramMaps = Array(new ParamMap)
          paramGrid.foreach { case (param, values) =>
            val newParamMaps = values.flatMap { v =>
              paramMaps.map(_.copy.put(param.asInstanceOf[Param[Any]], v))
            }
            paramMaps = newParamMaps.toArray
          }
          paramMaps
        }
      }
    ```
    ?


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