-
- Downloads
[SPARK-1434] [MLLIB] change labelParser from anonymous function to trait
This is a patch to address @mateiz 's comment in https://github.com/apache/spark/pull/245 MLUtils#loadLibSVMData uses an anonymous function for the label parser. Java users won't like it. So I make a trait for LabelParser and provide two implementations: binary and multiclass. Author: Xiangrui Meng <meng@databricks.com> Closes #345 from mengxr/label-parser and squashes the following commits: ac44409 [Xiangrui Meng] use singleton objects for label parsers 3b1a7c6 [Xiangrui Meng] add tests for label parsers c2e571c [Xiangrui Meng] rename LabelParser.apply to LabelParser.parse use extends for singleton 11c94e0 [Xiangrui Meng] add return types 7f8eb36 [Xiangrui Meng] change labelParser from annoymous function to trait
Showing
- mllib/src/main/scala/org/apache/spark/mllib/util/LabelParsers.scala 49 additions, 0 deletions...main/scala/org/apache/spark/mllib/util/LabelParsers.scala
- mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala 5 additions, 23 deletions.../src/main/scala/org/apache/spark/mllib/util/MLUtils.scala
- mllib/src/test/scala/org/apache/spark/mllib/util/LabelParsersSuite.scala 41 additions, 0 deletions...scala/org/apache/spark/mllib/util/LabelParsersSuite.scala
- mllib/src/test/scala/org/apache/spark/mllib/util/MLUtilsSuite.scala 2 additions, 2 deletions...test/scala/org/apache/spark/mllib/util/MLUtilsSuite.scala
Please register or sign in to comment