Skip to content

Commit 2b20c61

Browse files
committed
Small doc and style updates
1 parent dab0b67 commit 2b20c61

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

examples/src/main/scala/org/apache/spark/examples/mllib/DecisionTreeRunner.scala

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,18 +144,16 @@ object DecisionTreeRunner {
144144
println(s"numClasses = $numClasses.")
145145
println(s"Per-class example fractions, counts:")
146146
println(s"Class\tFrac\tCount")
147-
sortedClasses.foreach { c => {
147+
sortedClasses.foreach { c =>
148148
val frac = classCounts(c) / numExamples.toDouble
149149
println(s"$c\t$frac\t${classCounts(c)}")
150-
}}
150+
}
151151
(examples, numClasses)
152152
}
153-
case Regression => {
153+
case Regression =>
154154
(origExamples, 0)
155-
}
156-
case _ => {
155+
case _ =>
157156
throw new IllegalArgumentException("Algo ${params.algo} not supported.")
158-
}
159157
}
160158

161159
// Split into training, test.

mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class DecisionTree (private val strategy: Strategy) extends Serializable with Lo
4343
/**
4444
* Method to train a decision tree model over an RDD
4545
* @param input Training data: RDD of [[org.apache.spark.mllib.regression.LabeledPoint]]
46-
* @return DecisionTreeModel which can be used for prediction
46+
* @return DecisionTreeModel that can be used for prediction
4747
*/
4848
def train(input: RDD[LabeledPoint]): DecisionTreeModel = {
4949

@@ -206,7 +206,7 @@ object DecisionTree extends Serializable with Logging {
206206
* @param strategy The configuration parameters for the tree algorithm which specify the type
207207
* of algorithm (classification, regression, etc.), feature type (continuous,
208208
* categorical), depth of the tree, quantile calculation strategy, etc.
209-
* @return DecisionTreeModel which can be used for prediction
209+
* @return DecisionTreeModel that can be used for prediction
210210
*/
211211
def train(input: RDD[LabeledPoint], strategy: Strategy): DecisionTreeModel = {
212212
new DecisionTree(strategy).train(input)
@@ -225,7 +225,7 @@ object DecisionTree extends Serializable with Logging {
225225
* @param impurity impurity criterion used for information gain calculation
226226
* @param maxDepth Maximum depth of the tree.
227227
* E.g., depth 0 means 1 leaf node; depth 1 means 1 internal node + 2 leaf nodes.
228-
* @return DecisionTreeModel which can be used for prediction
228+
* @return DecisionTreeModel that can be used for prediction
229229
*/
230230
def train(
231231
input: RDD[LabeledPoint],
@@ -250,7 +250,7 @@ object DecisionTree extends Serializable with Logging {
250250
* @param maxDepth Maximum depth of the tree.
251251
* E.g., depth 0 means 1 leaf node; depth 1 means 1 internal node + 2 leaf nodes.
252252
* @param numClassesForClassification number of classes for classification. Default value of 2.
253-
* @return DecisionTreeModel which can be used for prediction
253+
* @return DecisionTreeModel that can be used for prediction
254254
*/
255255
def train(
256256
input: RDD[LabeledPoint],
@@ -284,7 +284,7 @@ object DecisionTree extends Serializable with Logging {
284284
* an entry (n -> k) implies the feature n is categorical with k
285285
* categories 0, 1, 2, ... , k-1. It's important to note that
286286
* features are zero-indexed.
287-
* @return DecisionTreeModel which can be used for prediction
287+
* @return DecisionTreeModel that can be used for prediction
288288
*/
289289
def train(
290290
input: RDD[LabeledPoint],

0 commit comments

Comments
 (0)