You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by me...@apache.org on 2015/01/30 19:08:11 UTC
spark git commit: [SPARK-5496][MLLIB] Allow both classification and
Classification in Algo for trees.
Repository: spark
Updated Branches:
refs/heads/master 54d95758f -> 0a95085f0
[SPARK-5496][MLLIB] Allow both classification and Classification in Algo for trees.
to be backward compatible.
Author: Xiangrui Meng <me...@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.
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/0a95085f
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/0a95085f
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/0a95085f
Branch: refs/heads/master
Commit: 0a95085f09754c7b883f29a2babb17209c6541bd
Parents: 54d9575
Author: Xiangrui Meng <me...@databricks.com>
Authored: Fri Jan 30 10:08:07 2015 -0800
Committer: Xiangrui Meng <me...@databricks.com>
Committed: Fri Jan 30 10:08:07 2015 -0800
----------------------------------------------------------------------
.../scala/org/apache/spark/mllib/tree/configuration/Algo.scala | 4 ++--
.../org/apache/spark/mllib/tree/GradientBoostedTreesSuite.scala | 5 +++++
2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/0a95085f/mllib/src/main/scala/org/apache/spark/mllib/tree/configuration/Algo.scala
----------------------------------------------------------------------
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/tree/configuration/Algo.scala b/mllib/src/main/scala/org/apache/spark/mllib/tree/configuration/Algo.scala
index 0ef9c61..b609925 100644
--- a/mllib/src/main/scala/org/apache/spark/mllib/tree/configuration/Algo.scala
+++ b/mllib/src/main/scala/org/apache/spark/mllib/tree/configuration/Algo.scala
@@ -29,8 +29,8 @@ object Algo extends Enumeration {
val Classification, Regression = Value
private[mllib] def fromString(name: String): Algo = name match {
- case "classification" => Classification
- case "regression" => Regression
+ case "classification" | "Classification" => Classification
+ case "regression" | "Regression" => Regression
case _ => throw new IllegalArgumentException(s"Did not recognize Algo name: $name")
}
}
http://git-wip-us.apache.org/repos/asf/spark/blob/0a95085f/mllib/src/test/scala/org/apache/spark/mllib/tree/GradientBoostedTreesSuite.scala
----------------------------------------------------------------------
diff --git a/mllib/src/test/scala/org/apache/spark/mllib/tree/GradientBoostedTreesSuite.scala b/mllib/src/test/scala/org/apache/spark/mllib/tree/GradientBoostedTreesSuite.scala
index 3aa97e5..e8341a5 100644
--- a/mllib/src/test/scala/org/apache/spark/mllib/tree/GradientBoostedTreesSuite.scala
+++ b/mllib/src/test/scala/org/apache/spark/mllib/tree/GradientBoostedTreesSuite.scala
@@ -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 {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org