Skip to content

Commit 46e06ee

Browse files
committed
minor mods
1 parent 3f85a17 commit 46e06ee

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,17 +562,16 @@ object DecisionTree extends Serializable with Logging {
562562
val label = arr(0)
563563
// Iterate over all features.
564564
var featureIndex = 0
565+
// TODO: Multiclass modification here
565566
while (featureIndex < numFeatures) {
566567
// Find the bin index for this feature.
567568
val arrShift = 1 + numFeatures * nodeIndex
568569
val arrIndex = arrShift + featureIndex
569570
// Update the left or right count for one bin.
570571
val aggShift = 2 * numBins * numFeatures * nodeIndex
571572
val aggIndex = aggShift + 2 * featureIndex * numBins + arr(arrIndex).toInt * 2
572-
// TODO: Multiclass modification here
573573
label match {
574-
case 0.0 => agg(aggIndex) = agg(aggIndex) + 1
575-
case 1.0 => agg(aggIndex + 1) = agg(aggIndex + 1) + 1
574+
case n: Double => agg(aggIndex) = agg(aggIndex + n.toInt) + 1
576575
}
577576
featureIndex += 1
578577
}

0 commit comments

Comments
 (0)