Skip to content

Commit 4e85f2c

Browse files
committed
minor: fixed scalastyle issues
1 parent b2ae41f commit 4e85f2c

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,8 @@ object DecisionTree extends Serializable with Logging {
448448
logDebug("isMulticlassClassification = " + isMulticlassClassification)
449449
val isMulticlassClassificationWithCategoricalFeatures
450450
= strategy.isMulticlassWithCategoricalFeatures
451-
logDebug("isMultiClassWithCategoricalFeatures = " + isMulticlassClassificationWithCategoricalFeatures)
451+
logDebug("isMultiClassWithCategoricalFeatures = " +
452+
isMulticlassClassificationWithCategoricalFeatures)
452453

453454
// shift when more than one group is used at deep tree level
454455
val groupShift = numNodes * groupIndex
@@ -643,7 +644,8 @@ object DecisionTree extends Serializable with Logging {
643644
val arrIndex = arrShift + featureIndex
644645
// Update the left or right count for one bin.
645646
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
647649
val labelInt = label.toInt
648650
agg(aggIndex + labelInt) = agg(aggIndex + labelInt) + labelWeights.getOrElse(labelInt, 1)
649651
}
@@ -739,7 +741,8 @@ object DecisionTree extends Serializable with Logging {
739741
val isSpaceSufficientForAllCategoricalSplits
740742
= numBins > math.pow(2, featureCategories.toInt - 1) - 1
741743
if (isSpaceSufficientForAllCategoricalSplits) {
742-
updateBinForUnorderedFeature(nodeIndex, featureIndex, arr, label, agg, rightChildShift)
744+
updateBinForUnorderedFeature(nodeIndex, featureIndex, arr, label, agg,
745+
rightChildShift)
743746
} else {
744747
updateBinForOrderedFeature(arr, agg, nodeIndex, label, featureIndex)
745748
}
@@ -909,10 +912,10 @@ object DecisionTree extends Serializable with Logging {
909912
.map{case (leftCount, rightCount) => leftCount + rightCount}
910913

911914
def indexOfLargestArrayElement(array: Array[Double]): Int = {
912-
val result = array.foldLeft(-1,Double.MinValue,0) {
915+
val result = array.foldLeft(-1, Double.MinValue, 0) {
913916
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)
916919
}
917920
if (result._1 < 0) 0 else result._1
918921
}
@@ -1408,8 +1411,8 @@ object DecisionTree extends Serializable with Logging {
14081411
categoriesSortedByCentroid.iterator.zipWithIndex.foreach {
14091412
case ((key, value), index) =>
14101413
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)
14131416
bins(featureIndex)(index) = {
14141417
if (index == 0) {
14151418
new Bin(new DummyCategoricalSplit(featureIndex, Categorical),

0 commit comments

Comments
 (0)