aboutsummaryrefslogtreecommitdiff
path: root/mllib/src/test
diff options
context:
space:
mode:
authorJoseph K. Bradley <joseph@databricks.com>2016-04-04 20:12:09 -0700
committerJoseph K. Bradley <joseph@databricks.com>2016-04-04 20:12:09 -0700
commit8f50574ab4021b9984b0017cd47ba012a894c19a (patch)
treef049ce43aa3852637f782d610ebb7762df983d60 /mllib/src/test
parentba24d1ee9a1d97ca82282f3b811ec011c4285b99 (diff)
downloadspark-8f50574ab4021b9984b0017cd47ba012a894c19a.tar.gz
spark-8f50574ab4021b9984b0017cd47ba012a894c19a.tar.bz2
spark-8f50574ab4021b9984b0017cd47ba012a894c19a.zip
[SPARK-14386][ML] Changed spark.ml ensemble trees methods to return concrete types
## What changes were proposed in this pull request? In spark.ml, GBT and RandomForest expose the trait DecisionTreeModel in the trees method, but they should not since it is a private trait (and not ready to be made public). It will also be more useful to users if we return the concrete types. This PR: return concrete types The MIMA checks appear to be OK with this change. ## How was this patch tested? Existing unit tests Author: Joseph K. Bradley <joseph@databricks.com> Closes #12158 from jkbradley/hide-dtm.
Diffstat (limited to 'mllib/src/test')
-rw-r--r--mllib/src/test/scala/org/apache/spark/ml/tree/impl/TreeTests.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/mllib/src/test/scala/org/apache/spark/ml/tree/impl/TreeTests.scala b/mllib/src/test/scala/org/apache/spark/ml/tree/impl/TreeTests.scala
index bd5bd17147..b650a9f092 100644
--- a/mllib/src/test/scala/org/apache/spark/ml/tree/impl/TreeTests.scala
+++ b/mllib/src/test/scala/org/apache/spark/ml/tree/impl/TreeTests.scala
@@ -131,7 +131,7 @@ private[ml] object TreeTests extends SparkFunSuite {
* Check if the two models are exactly the same.
* If the models are not equal, this throws an exception.
*/
- def checkEqual(a: TreeEnsembleModel, b: TreeEnsembleModel): Unit = {
+ def checkEqual[M <: DecisionTreeModel](a: TreeEnsembleModel[M], b: TreeEnsembleModel[M]): Unit = {
try {
a.trees.zip(b.trees).foreach { case (treeA, treeB) =>
TreeTests.checkEqual(treeA, treeB)