Skip to content

Commit 4731cda

Browse files
committed
formatting
1 parent 5e82202 commit 4731cda

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ object DecisionTree extends Serializable with Logging {
275275
private val InvalidBinIndex = -1
276276

277277
/**
278-
* Returns an array of optimal splits for all nodes at a given level
278+
* Returns an array of optimal splits for all nodes at a given level. Splits the tasks into
279+
* multiple groups if the level-wise training tasks could lead to memory overflow.
279280
*
280281
* @param input RDD of [[org.apache.spark.mllib.regression.LabeledPoint]] used as training data
281282
* for DecisionTree

mllib/src/test/scala/org/apache/spark/mllib/tree/DecisionTreeSuite.scala

+6-6
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,8 @@ class DecisionTreeSuite extends FunSuite with BeforeAndAfterAll {
405405
assert(splits(0).length === 99)
406406
assert(bins(0).length === 100)
407407

408-
val leftFilter = Filter(new Split(0,400,FeatureType.Continuous,List()),-1)
409-
val rightFilter = Filter(new Split(0,400,FeatureType.Continuous,List()),1)
408+
val leftFilter = Filter(new Split(0, 400, FeatureType.Continuous,List()), -1)
409+
val rightFilter = Filter(new Split(0, 400, FeatureType.Continuous,List()) ,1)
410410
val filters = Array[List[Filter]](List(),List(leftFilter),List(rightFilter))
411411
val parentImpurities = Array(0.5, 0.5, 0.5)
412412

@@ -444,7 +444,7 @@ object DecisionTreeSuite {
444444

445445
def generateOrderedLabeledPointsWithLabel0(): Array[LabeledPoint] = {
446446
val arr = new Array[LabeledPoint](1000)
447-
for (i <- 0 until 1000){
447+
for (i <- 0 until 1000) {
448448
val lp = new LabeledPoint(0.0, Vectors.dense(i.toDouble, 1000.0 - i))
449449
arr(i) = lp
450450
}
@@ -453,7 +453,7 @@ object DecisionTreeSuite {
453453

454454
def generateOrderedLabeledPointsWithLabel1(): Array[LabeledPoint] = {
455455
val arr = new Array[LabeledPoint](1000)
456-
for (i <- 0 until 1000){
456+
for (i <- 0 until 1000) {
457457
val lp = new LabeledPoint(1.0, Vectors.dense(i.toDouble, 999.0 - i))
458458
arr(i) = lp
459459
}
@@ -462,7 +462,7 @@ object DecisionTreeSuite {
462462

463463
def generateOrderedLabeledPoints(): Array[LabeledPoint] = {
464464
val arr = new Array[LabeledPoint](1000)
465-
for (i <- 0 until 1000){
465+
for (i <- 0 until 1000) {
466466
if (i < 600){
467467
val lp = new LabeledPoint(0.0, Vectors.dense(i.toDouble, 1000.0 - i))
468468
arr(i) = lp
@@ -476,7 +476,7 @@ object DecisionTreeSuite {
476476

477477
def generateCategoricalDataPoints(): Array[LabeledPoint] = {
478478
val arr = new Array[LabeledPoint](1000)
479-
for (i <- 0 until 1000){
479+
for (i <- 0 until 1000) {
480480
if (i < 600){
481481
arr(i) = new LabeledPoint(1.0, Vectors.dense(0.0, 1.0))
482482
} else {

0 commit comments

Comments
 (0)