Github user sethah commented on a diff in the pull request:
https://github.com/apache/spark/pull/20632#discussion_r170738068
--- Diff: mllib/src/main/scala/org/apache/spark/ml/tree/Node.scala ---
@@ -269,12 +268,19 @@ private[tree] class LearningNode(
/**
* Convert this [[LearningNode]] to a regular [[Node]], and recurse on
any children.
*/
- def toNode: Node = {
- if (leftChild.nonEmpty) {
- assert(rightChild.nonEmpty && split.nonEmpty && stats != null,
+ def toNode(prune: Boolean = true): Node = {
--- End diff --
If you just overload the method then you don't need to change the existing
function calls.
```scala
def toNode: Node = toNode(prune = true)
```
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]