You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by yanboliang <gi...@git.apache.org> on 2017/05/08 15:42:53 UTC

[GitHub] spark pull request #17645: [SPARK-20348] [ML] Support squared hinge loss (L2...

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

    https://github.com/apache/spark/pull/17645#discussion_r115280207
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/classification/LinearSVC.scala ---
    @@ -42,15 +44,35 @@ 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 HasThreshold with HasAggregationDepth
    +  with HasThreshold with HasAggregationDepth {
    +
    +  /**
    +   * 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 lossFunction: Param[String] = new Param(this, "lossFunction", "Specifies the loss " +
    --- End diff --
    
    OK, let leave as is and refactor in the future. One minor issue: What about renaming it to ```loss```? I found the name of corresponding params in ```sklearn.svm.linearSVC``` is ```loss```. Thanks.


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

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