From 68abc1b4e9afbb6c2a87689221a46b835dded102 Mon Sep 17 00:00:00 2001 From: Yuhao Yang Date: Mon, 9 May 2016 09:08:54 +0100 Subject: [SPARK-14814][MLLIB] API: Java compatibility, docs ## What changes were proposed in this pull request? jira: https://issues.apache.org/jira/browse/SPARK-14814 fix a java compatibility function in mllib DecisionTreeModel. As synced in jira, other compatibility issues don't need fixes. ## How was this patch tested? existing ut Author: Yuhao Yang Closes #12971 from hhbyyh/javacompatibility. --- .../scala/org/apache/spark/mllib/tree/model/DecisionTreeModel.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mllib/src/main/scala') diff --git a/mllib/src/main/scala/org/apache/spark/mllib/tree/model/DecisionTreeModel.scala b/mllib/src/main/scala/org/apache/spark/mllib/tree/model/DecisionTreeModel.scala index a87f8a6cde..c13b9a66c4 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/tree/model/DecisionTreeModel.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/tree/model/DecisionTreeModel.scala @@ -75,8 +75,8 @@ class DecisionTreeModel @Since("1.0.0") ( * @return JavaRDD of predictions for each of the given data points */ @Since("1.2.0") - def predict(features: JavaRDD[Vector]): JavaRDD[Double] = { - predict(features.rdd) + def predict(features: JavaRDD[Vector]): JavaRDD[java.lang.Double] = { + predict(features.rdd).toJavaRDD().asInstanceOf[JavaRDD[java.lang.Double]] } /** -- cgit v1.2.3