Github user chouqin commented on the pull request:
https://github.com/apache/spark/pull/2341#issuecomment-55216875
@jkbradley Thanks for your nice work, I have read your code and just have
one question:
Can we allocate a root node before the loop in `train()`, and allocate left
and child node for the next level after choosing split, then
`DecisionTree.findBestSplits` can just return `doneTraining`. During the choose
splits step which iterate all the nodes, it just set fields of current node,
and don't allocate a new node. This seems to be more easier to understand for
me, because it handle all levels in a same way.
What's more, I think after choosing a best split and allocate left and
right child nodes, we can set impurity of left and right child, which can avoid
recomputation of impurity in `calculateGainForSplit`, this saving may be
useless when (number of splits * number of features * number of classes) is
small though.
This is just a suggestion, ignore this if you don't think it helps :).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]