Skip to content

Commit 105f8ab

Browse files
committed
Removed commented-out getEmptyBinAggregates from DecisionTree
1 parent 062c31d commit 105f8ab

File tree

1 file changed

+0
-39
lines changed

1 file changed

+0
-39
lines changed

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

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -891,45 +891,6 @@ object DecisionTree extends Serializable with Logging {
891891
}
892892
}
893893

894-
/**
895-
* Get an empty instance of bin aggregates.
896-
* For ordered features, aggregate is indexed by: (nodeIndex)(featureIndex)(binIndex).
897-
* For unordered features, aggregate is indexed by: (nodeIndex)(featureIndex)(2 * binIndex),
898-
* where the bins are ordered as (numBins left bins, numBins right bins).
899-
*/
900-
/*
901-
private def getEmptyBinAggregates(
902-
metadata: DecisionTreeMetadata,
903-
numNodes: Int): Array[Array[Array[ImpurityAggregator]]] = {
904-
val impurityAggregator: ImpurityAggregator = metadata.impurity match {
905-
case Gini => new GiniAggregator(metadata.numClasses)
906-
case Entropy => new EntropyAggregator(metadata.numClasses)
907-
case Variance => new VarianceAggregator()
908-
case _ => throw new IllegalArgumentException(s"Bad impurity parameter: ${metadata.impurity}")
909-
}
910-
911-
val agg = Array.fill[Array[ImpurityAggregator]](numNodes, metadata.numFeatures)(
912-
new Array[ImpurityAggregator](0))
913-
var nodeIndex = 0
914-
while (nodeIndex < numNodes) {
915-
var featureIndex = 0
916-
while (featureIndex < metadata.numFeatures) {
917-
val binMultiplier = if (metadata.isUnordered(featureIndex)) 2 else 1
918-
val effNumBins = metadata.numBins(featureIndex) * binMultiplier
919-
agg(nodeIndex)(featureIndex) = new Array[ImpurityAggregator](effNumBins)
920-
var binIndex = 0
921-
while (binIndex < effNumBins) {
922-
agg(nodeIndex)(featureIndex)(binIndex) = impurityAggregator.newAggregator
923-
binIndex += 1
924-
}
925-
featureIndex += 1
926-
}
927-
nodeIndex += 1
928-
}
929-
agg
930-
}
931-
*/
932-
933894
/**
934895
* Returns splits and bins for decision tree calculation.
935896
* Continuous and categorical features are handled differently.

0 commit comments

Comments
 (0)