Skip to content

Commit

Permalink
fixed while loop
Browse files Browse the repository at this point in the history
  • Loading branch information
manishamde committed May 12, 2014
1 parent 18d2835 commit d012be7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ object DecisionTree extends Serializable with Logging {
var classIndex = 0
while (classIndex < numClasses) {
rootNodeCounts(classIndex) = leftCounts(classIndex) + rightCounts(classIndex)
classIndex += 1
}
strategy.impurity.calculate(rootNodeCounts, leftTotalCount + rightTotalCount)
}
Expand Down Expand Up @@ -1054,7 +1055,7 @@ object DecisionTree extends Serializable with Logging {
val binsForNode: Array[Double] = getBinDataForNode(node)
logDebug("nodeImpurityIndex = " + nodeImpurityIndex)
val parentNodeImpurity = parentImpurities(nodeImpurityIndex)
logDebug("node impurity = " + parentNodeImpurity)
logDebug("parent node impurity = " + parentNodeImpurity)
bestSplits(node) = binsToBestSplit(binsForNode, parentNodeImpurity)
node += 1
}
Expand Down

0 comments on commit d012be7

Please sign in to comment.