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
144144 parentImpurities : Array [Double ],
145145 filters : Array [List [Filter ]]): Unit = {
146146 // 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 ) {
149149 // Calculate the index of the node from the node level and the index at the current level.
150150 val nodeIndex = scala.math.pow(2 , level + 1 ).toInt - 1 + 2 * index + i
151151 if (level < maxDepth - 1 ) {
@@ -164,6 +164,7 @@ class DecisionTree (private val strategy: Strategy) extends Serializable with Lo
164164 logDebug(" Filter = " + filter)
165165 }
166166 }
167+ i += 1
167168 }
168169 }
169170}
You can’t perform that action at this time.
0 commit comments