Skip to content

Commit d012be7

Browse files
committed
fixed while loop
1 parent 18d2835 commit d012be7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,7 @@ object DecisionTree extends Serializable with Logging {
737737
var classIndex = 0
738738
while (classIndex < numClasses) {
739739
rootNodeCounts(classIndex) = leftCounts(classIndex) + rightCounts(classIndex)
740+
classIndex += 1
740741
}
741742
strategy.impurity.calculate(rootNodeCounts, leftTotalCount + rightTotalCount)
742743
}
@@ -1054,7 +1055,7 @@ object DecisionTree extends Serializable with Logging {
10541055
val binsForNode: Array[Double] = getBinDataForNode(node)
10551056
logDebug("nodeImpurityIndex = " + nodeImpurityIndex)
10561057
val parentNodeImpurity = parentImpurities(nodeImpurityIndex)
1057-
logDebug("node impurity = " + parentNodeImpurity)
1058+
logDebug("parent node impurity = " + parentNodeImpurity)
10581059
bestSplits(node) = binsToBestSplit(binsForNode, parentNodeImpurity)
10591060
node += 1
10601061
}

0 commit comments

Comments
 (0)