File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
mllib/src/main/scala/org/apache/spark/mllib/tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -144,8 +144,8 @@ class DecisionTree (private val strategy: Strategy) extends Serializable with Lo
144
144
parentImpurities : Array [Double ],
145
145
filters : Array [List [Filter ]]): Unit = {
146
146
// 0 corresponds to the left child node and 1 corresponds to the right child node.
147
- // TODO: Convert to while loop
148
- for (i <- 0 to 1 ) {
147
+ var i = 0
148
+ while (i <= 1 ) {
149
149
// Calculate the index of the node from the node level and the index at the current level.
150
150
val nodeIndex = scala.math.pow(2 , level + 1 ).toInt - 1 + 2 * index + i
151
151
if (level < maxDepth - 1 ) {
@@ -164,6 +164,7 @@ class DecisionTree (private val strategy: Strategy) extends Serializable with Lo
164
164
logDebug(" Filter = " + filter)
165
165
}
166
166
}
167
+ i += 1
167
168
}
168
169
}
169
170
}
You can’t perform that action at this time.
0 commit comments