Skip to content

Commit 5db9171

Browse files
committed
fixed bug
1 parent 05712d8 commit 5db9171

File tree

1 file changed

+4
-1
lines changed
  • mllib/src/main/scala/org/apache/spark/ml/tree/impl

1 file changed

+4
-1
lines changed

mllib/src/main/scala/org/apache/spark/ml/tree/impl/AltDT.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,11 @@ private[ml] object AltDT extends Logging {
9999
strategy: Strategy,
100100
parentUID: Option[String] = None): DecisionTreeModel = {
101101
// TODO: Check validity of params
102+
// TODO: Check for empty dataset
103+
val numFeatures = input.first().features.size
102104
val rootNode = trainImpl(input, strategy)
103-
impl.RandomForest.finalizeTree(rootNode, strategy.algo, strategy.numClasses, parentUID)
105+
impl.RandomForest.finalizeTree(rootNode, strategy.algo, strategy.numClasses, numFeatures,
106+
parentUID)
104107
}
105108

106109
private[impl] def trainImpl(input: RDD[LabeledPoint], strategy: Strategy): Node = {

0 commit comments

Comments
 (0)