Github user sethah commented on a diff in the pull request:
https://github.com/apache/spark/pull/20632#discussion_r170410775
--- Diff: mllib/src/main/scala/org/apache/spark/ml/tree/Node.scala ---
@@ -283,10 +292,12 @@ private[tree] class LearningNode(
// Here we want to keep same behavior with the old
mllib.DecisionTreeModel
new LeafNode(stats.impurityCalculator.predict, -1.0,
stats.impurityCalculator)
}
-
}
}
+ /** @return true iff a node is a leaf. */
+ private def isLeafNode(): Boolean = leftChild.isEmpty &&
rightChild.isEmpty
--- End diff --
I wouldn't mind just removing this change. What constitutes a leaf node is
now fuzzy, and if you just inline it the one place it's used there is no
confusion. At any rate, you don't need the parentheses after method name.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]