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

    https://github.com/apache/spark/pull/245#discussion_r11225495
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala ---
    @@ -41,6 +39,107 @@ object MLUtils {
       }
     
       /**
    +   * Multiclass label parser, which parses a string into double.
    +   */
    +  val multiclassLabelParser: String => Double = _.toDouble
    +
    +  /**
    +   * Binary label parser, which outputs 1.0 (positive) if the value is 
greater than 0.5,
    +   * or 0.0 (negative) otherwise.
    +   */
    +  val binaryLabelParser: String => Double = label => if (label.toDouble > 
0.5) 1.0 else 0.0
    --- End diff --
    
    Instead of using `String => Double` as the type of these, we should create 
a `trait LabelParser` and have some implementations of it so that it becomes 
friendly to call from Java.


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

Reply via email to