flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tillrohrmann <...@git.apache.org>
Subject [GitHub] flink pull request: [FLINK-2297] [ml] Add threshold setting for SV...
Date Wed, 01 Jul 2015 08:44:10 GMT
Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/874#discussion_r33658953
  
    --- Diff: flink-staging/flink-ml/src/main/scala/org/apache/flink/ml/classification/SVM.scala
---
    @@ -187,6 +196,26 @@ class SVM extends Predictor[SVM] {
         parameters.add(Seed, seed)
         this
       }
    +
    +  /** Sets the threshold above which elements are classified as positive
    +    *
    +    * @param threshold
    +    * @return
    +    */
    +  def setThreshold(threshold: Double): SVM = {
    +    parameters.add(Threshold, threshold)
    +    this
    +  }
    +
    +  /** Clears the classification threshold, predictions made after calling this function
will have
    +    * the raw decision function value.
    +    *
    +    * @return
    +    */
    +  def clearThreshold(): SVM = {
    +    parameters.add(Threshold, Option.empty[Double])
    --- End diff --
    
    It would be better if we have a `parameters.clear(Threshold)` method here.


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

Mime
View raw message