Skip to content
Snippets Groups Projects
Commit 0a95085f authored by Xiangrui Meng's avatar Xiangrui Meng
Browse files

[SPARK-5496][MLLIB] Allow both classification and Classification in Algo for trees.

to be backward compatible.

Author: Xiangrui Meng <meng@databricks.com>

Closes #4287 from mengxr/SPARK-5496 and squashes the following commits:

a025c53 [Xiangrui Meng] Allow both classification and Classification in Algo for trees.
parent 54d95758
No related branches found
No related tags found
No related merge requests found
...@@ -29,8 +29,8 @@ object Algo extends Enumeration { ...@@ -29,8 +29,8 @@ object Algo extends Enumeration {
val Classification, Regression = Value val Classification, Regression = Value
private[mllib] def fromString(name: String): Algo = name match { private[mllib] def fromString(name: String): Algo = name match {
case "classification" => Classification case "classification" | "Classification" => Classification
case "regression" => Regression case "regression" | "Regression" => Regression
case _ => throw new IllegalArgumentException(s"Did not recognize Algo name: $name") case _ => throw new IllegalArgumentException(s"Did not recognize Algo name: $name")
} }
} }
...@@ -128,6 +128,11 @@ class GradientBoostedTreesSuite extends FunSuite with MLlibTestSparkContext { ...@@ -128,6 +128,11 @@ class GradientBoostedTreesSuite extends FunSuite with MLlibTestSparkContext {
} }
} }
test("SPARK-5496: BoostingStrategy.defaultParams should recognize Classification") {
for (algo <- Seq("classification", "Classification", "regression", "Regression")) {
BoostingStrategy.defaultParams(algo)
}
}
} }
object GradientBoostedTreesSuite { object GradientBoostedTreesSuite {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment