From 00ffbcc14cf162591705f0920f4d26fdb741d0da Mon Sep 17 00:00:00 2001 From: Xiangrui Meng Date: Tue, 8 Apr 2014 00:46:07 -0700 Subject: [PATCH] update tree API annotation --- .../main/scala/org/apache/spark/mllib/tree/DecisionTree.scala | 4 ++-- .../org/apache/spark/mllib/tree/configuration/Algo.scala | 2 ++ .../apache/spark/mllib/tree/configuration/FeatureType.scala | 2 ++ .../spark/mllib/tree/configuration/QuantileStrategy.scala | 2 ++ .../org/apache/spark/mllib/tree/configuration/Strategy.scala | 2 ++ .../main/scala/org/apache/spark/mllib/tree/model/Node.scala | 2 +- .../main/scala/org/apache/spark/mllib/tree/model/Split.scala | 2 ++ 7 files changed, 13 insertions(+), 3 deletions(-) diff --git a/mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala b/mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala index 04e7e4241910e..4fc50dfa2fd69 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala @@ -1026,7 +1026,7 @@ object DecisionTree extends Serializable with Logging { } } - val usage = """ + private val usage = """ Usage: DecisionTreeRunner [slices] --algo --trainDataDir path --testDataDir path --maxDepth num [--impurity ] [--maxBins num] @@ -1115,7 +1115,7 @@ object DecisionTree extends Serializable with Logging { * @return An RDD of LabeledPoint. Each labeled point has two elements: the first element is * the label, and the second element represents the feature values (an array of Double). */ - def loadLabeledData(sc: SparkContext, dir: String): RDD[LabeledPoint] = { + private def loadLabeledData(sc: SparkContext, dir: String): RDD[LabeledPoint] = { sc.textFile(dir).map { line => val parts = line.trim().split(",") val label = parts(0).toDouble 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 2dd1f0f27b8f5..332062de7463d 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 @@ -18,6 +18,8 @@ package org.apache.spark.mllib.tree.configuration /** + * EXPERIMENTAL + * * Enum to select the algorithm for the decision tree */ object Algo extends Enumeration { diff --git a/mllib/src/main/scala/org/apache/spark/mllib/tree/configuration/FeatureType.scala b/mllib/src/main/scala/org/apache/spark/mllib/tree/configuration/FeatureType.scala index 09ee0586c58fa..e2a57837d5cef 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/tree/configuration/FeatureType.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/tree/configuration/FeatureType.scala @@ -18,6 +18,8 @@ package org.apache.spark.mllib.tree.configuration /** + * EXPERIMENTAL + * * Enum to describe whether a feature is "continuous" or "categorical" */ object FeatureType extends Enumeration { diff --git a/mllib/src/main/scala/org/apache/spark/mllib/tree/configuration/QuantileStrategy.scala b/mllib/src/main/scala/org/apache/spark/mllib/tree/configuration/QuantileStrategy.scala index 2457a480c2a14..95319b739ab32 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/tree/configuration/QuantileStrategy.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/tree/configuration/QuantileStrategy.scala @@ -18,6 +18,8 @@ package org.apache.spark.mllib.tree.configuration /** + * EXPERIMENTAL + * * Enum for selecting the quantile calculation strategy */ object QuantileStrategy extends Enumeration { diff --git a/mllib/src/main/scala/org/apache/spark/mllib/tree/configuration/Strategy.scala b/mllib/src/main/scala/org/apache/spark/mllib/tree/configuration/Strategy.scala index 0cbe7d73cddad..13cd656128768 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/tree/configuration/Strategy.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/tree/configuration/Strategy.scala @@ -22,6 +22,8 @@ import org.apache.spark.mllib.tree.configuration.Algo._ import org.apache.spark.mllib.tree.configuration.QuantileStrategy._ /** + * EXPERIMENTAL + * * Stores all the configuration options for tree construction * @param algo classification or regression * @param impurity criterion used for information gain calculation diff --git a/mllib/src/main/scala/org/apache/spark/mllib/tree/model/Node.scala b/mllib/src/main/scala/org/apache/spark/mllib/tree/model/Node.scala index 361361f937c76..6b644e7657f40 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/tree/model/Node.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/tree/model/Node.scala @@ -22,7 +22,7 @@ import org.apache.spark.mllib.tree.configuration.FeatureType._ import org.apache.spark.mllib.linalg.Vector /** - * DEVELOPER API + * DEVELOPER API * * Node in a decision tree * @param id integer node id diff --git a/mllib/src/main/scala/org/apache/spark/mllib/tree/model/Split.scala b/mllib/src/main/scala/org/apache/spark/mllib/tree/model/Split.scala index 1ceb64ca44290..f8f4e5abfa6a1 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/tree/model/Split.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/tree/model/Split.scala @@ -20,6 +20,8 @@ package org.apache.spark.mllib.tree.model import org.apache.spark.mllib.tree.configuration.FeatureType.FeatureType /** + * DEVELOPER API + * * Split applied to a feature * @param feature feature index * @param threshold threshold for continuous feature