@@ -448,7 +448,8 @@ object DecisionTree extends Serializable with Logging {
448
448
logDebug(" isMulticlassClassification = " + isMulticlassClassification)
449
449
val isMulticlassClassificationWithCategoricalFeatures
450
450
= strategy.isMulticlassWithCategoricalFeatures
451
- logDebug(" isMultiClassWithCategoricalFeatures = " + isMulticlassClassificationWithCategoricalFeatures)
451
+ logDebug(" isMultiClassWithCategoricalFeatures = " +
452
+ isMulticlassClassificationWithCategoricalFeatures)
452
453
453
454
// shift when more than one group is used at deep tree level
454
455
val groupShift = numNodes * groupIndex
@@ -643,7 +644,8 @@ object DecisionTree extends Serializable with Logging {
643
644
val arrIndex = arrShift + featureIndex
644
645
// Update the left or right count for one bin.
645
646
val aggShift = numClasses * numBins * numFeatures * nodeIndex
646
- val aggIndex = aggShift + numClasses * featureIndex * numBins + arr(arrIndex).toInt * numClasses
647
+ val aggIndex = aggShift + numClasses * featureIndex * numBins
648
+ + arr(arrIndex).toInt * numClasses
647
649
val labelInt = label.toInt
648
650
agg(aggIndex + labelInt) = agg(aggIndex + labelInt) + labelWeights.getOrElse(labelInt, 1 )
649
651
}
@@ -739,7 +741,8 @@ object DecisionTree extends Serializable with Logging {
739
741
val isSpaceSufficientForAllCategoricalSplits
740
742
= numBins > math.pow(2 , featureCategories.toInt - 1 ) - 1
741
743
if (isSpaceSufficientForAllCategoricalSplits) {
742
- updateBinForUnorderedFeature(nodeIndex, featureIndex, arr, label, agg, rightChildShift)
744
+ updateBinForUnorderedFeature(nodeIndex, featureIndex, arr, label, agg,
745
+ rightChildShift)
743
746
} else {
744
747
updateBinForOrderedFeature(arr, agg, nodeIndex, label, featureIndex)
745
748
}
@@ -909,10 +912,10 @@ object DecisionTree extends Serializable with Logging {
909
912
.map{case (leftCount, rightCount) => leftCount + rightCount}
910
913
911
914
def indexOfLargestArrayElement (array : Array [Double ]): Int = {
912
- val result = array.foldLeft(- 1 ,Double .MinValue ,0 ) {
915
+ val result = array.foldLeft(- 1 , Double .MinValue , 0 ) {
913
916
case ((maxIndex, maxValue, currentIndex), currentValue) =>
914
- if (currentValue > maxValue) (currentIndex,currentValue,currentIndex+ 1 )
915
- else (maxIndex,maxValue,currentIndex+ 1 )
917
+ if (currentValue > maxValue) (currentIndex, currentValue, currentIndex + 1 )
918
+ else (maxIndex, maxValue, currentIndex+ 1 )
916
919
}
917
920
if (result._1 < 0 ) 0 else result._1
918
921
}
@@ -1408,8 +1411,8 @@ object DecisionTree extends Serializable with Logging {
1408
1411
categoriesSortedByCentroid.iterator.zipWithIndex.foreach {
1409
1412
case ((key, value), index) =>
1410
1413
categoriesForSplit = key :: categoriesForSplit
1411
- splits(featureIndex)(index) = new Split (featureIndex, Double .MinValue , Categorical ,
1412
- categoriesForSplit)
1414
+ splits(featureIndex)(index) = new Split (featureIndex, Double .MinValue ,
1415
+ Categorical , categoriesForSplit)
1413
1416
bins(featureIndex)(index) = {
1414
1417
if (index == 0 ) {
1415
1418
new Bin (new DummyCategoricalSplit (featureIndex, Categorical ),
0 commit comments