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

    https://github.com/apache/spark/pull/15881#discussion_r87883345
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala ---
    @@ -171,7 +171,10 @@ class LinearRegression @Since("1.3.0") 
(@Since("1.3.0") override val uid: String
        * @group setParam
        */
       @Since("1.6.0")
    -  def setSolver(value: String): this.type = set(solver, value)
    +  def setSolver(value: String): this.type = {
    +    require(Array("auto", "l-bfgs", "normal").contains(value), s"Solver 
$value was not supported.")
    --- End diff --
    
    Thanks for the reply. I assume `solver` is different from other params as 
it's inherited from a trait where we cannot define valid options. I don't mean 
to change any convention here. For this case, I simply mean we can add the 
available options in the error message in the `require`.
    
    And surely we can discuss how to improve ParamValidator elsewhere.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to