Github user hhbyyh commented on a diff in the pull request: https://github.com/apache/spark/pull/17862#discussion_r146168660 --- Diff: mllib/src/main/scala/org/apache/spark/ml/classification/LinearSVC.scala --- @@ -42,7 +44,26 @@ import org.apache.spark.sql.functions.{col, lit} /** Params for linear SVM Classifier. */ private[classification] trait LinearSVCParams extends ClassifierParams with HasRegParam with HasMaxIter with HasFitIntercept with HasTol with HasStandardization with HasWeightCol - with HasAggregationDepth with HasThreshold { + with HasAggregationDepth with HasThreshold with HasSolver { + + /** + * Specifies the loss function. Currently "hinge" and "squared_hinge" are supported. + * "hinge" is the standard SVM loss (a.k.a. L1 loss) while "squared_hinge" is the square of + * the hinge loss (a.k.a. L2 loss). + * + * @see <a href="https://en.wikipedia.org/wiki/Hinge_loss">Hinge loss (Wikipedia)</a> + * + * @group param + */ + @Since("2.3.0") + final val loss: Param[String] = new Param(this, "loss", "Specifies the loss " + + "function. hinge is the standard SVM loss while squared_hinge is the square of the hinge loss.", + (s: String) => LinearSVC.supportedLoss.contains(s.toLowerCase(Locale.ROOT))) --- End diff -- I tend to support case-insensitive params in `LinearRegression`, or change the default behavior of ParamValidators.inArray. And we should improve the consistency in supporting case-insensitive String params anyway.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org