File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
mllib/src/main/scala/org/apache/spark/mllib/tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments