-
Notifications
You must be signed in to change notification settings - Fork 766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GTSAM_DT_MERGING Flag #1501
GTSAM_DT_MERGING Flag #1501
Conversation
gtsam/discrete/DecisionTree.h
Outdated
@@ -299,6 +299,15 @@ namespace gtsam { | |||
/// Return the number of leaves in the tree. | |||
size_t nrLeaves() const; | |||
|
|||
/** | |||
* @brief Return the number of total leaf assignments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please give examples as to what this is, I think "number of assignments" needs to be explained.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO(Frank): Add comments to mention that this is a convenience function and not used for any major operation.
@varunagrawal I think we discussed this and is no more relevant? If so, please close issue and PR. If not, let's chat again as I lost context. |
This is still a bug, one that I introduced accidentally. |
So I managed to figure this out after a lot of debugging. The big issue was that when building the tree, we call To address this, I made |
#1555 details some of the pending issues I have with |
Please comment on what the status is of this PR after you merged all other 3 we discussed. Also, might want to merge in develop after that to make this PR much smaller? |
Merged in develop. The |
Still confused about status of this PR. Changes in 15 files, many tests now DISABLED. |
This PR is still a WIP. I'll update it as I go along. |
I removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I like the simplification.
This PR is a discussion venue for issue #1496.I have added a unit test which demonstrates an issue with the number of assignments being set for the decision tree.This seems to be because the decision tree rearranges the keys to be highest to lowest but doesn't account for the implicit pruning performed. If I disable the implicit pruning in the decision tree, this issue doesn't appear.
This PR adds a new CMake flag
GTSAM_DT_MERGING
which enables/disablesDecisionTree
merging of branches when the leaves have the same value. This flag is generally useful for debugging and maybe useful for other things.Accordingly I have updated the tests and the config files.
I have also removed the
nrAssignments_
variable inDecisionTree
due to it needing significant refactor and the issue it was originally intended for (hybrid pruning) being resolved via alternative means.