Github user hhbyyh commented on the issue:

    https://github.com/apache/spark/pull/16194
  
    Sorry but I would still strongly prefer to override the toString() in Model 
or Params. The default implementation can provide more information about the 
params. And only in a few cases you need to override the default implementation.
    More specifically,
    ```
      override def toString = s"${this.logName}(uid=$uid)" +
        this.params.map(p => p.name + ": " + $(p)).mkString(" {\n  ", "\n  ", 
"\n}")
        // or use this.extractParamMap().toString()
    ```
    
    would give a result:
    ```
    org.apache.spark.ml.clustering.NewModel(uid=1122) {
      featuresCol: features
      initMode: k-means||
      initSteps: 2
      k: 2
      maxIter: 20
      predictionCol: prediction
      seed: 1387313927
      tol: 1.0E-4
    }
    ```



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