-
Notifications
You must be signed in to change notification settings - Fork 768
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
Decision Tree Improvements #1542
Conversation
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.
LGTM but see my question. email me when I should look again
gtsam/discrete/DecisionTree-inl.h
Outdated
@@ -549,15 +544,15 @@ namespace gtsam { | |||
template<typename L, typename Y> | |||
template<typename Iterator> DecisionTree<L, Y>::DecisionTree( | |||
Iterator begin, Iterator end, const L& label) { | |||
root_ = compose(begin, end, label); | |||
root_ = Choice::Unique(compose(begin, end, label)); |
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.
Why do all these have a Unique now? That was not detailed in the PR comment
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.
Okay I undid that. Looks like it was a remnant of debugging.
gtsam/discrete/DecisionTree-inl.h
Outdated
@@ -199,47 +200,41 @@ namespace gtsam { | |||
} | |||
|
|||
/// If all branches of a choice node f are the same, just return a branch. |
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(Varun): Elaborate more on how this works.
@dellaert so I am really struggling with implementing this function correctly in the decision tree // Applying binary operator to two leaves results in a leaf
NodePtr apply_g_op_fL(const Leaf& fL, const Binary& op) const override {
// fL op gL
// TODO(Varun) Is the nrAssignments setting correct?
NodePtr h(new Leaf(op(fL.constant_, constant_), fL.nrAssignments()));
return h;
} I only need
It seems that there is no time improvement, since the test case is now taking 131.93 seconds compared to 117 seconds with the cartesian product taking up 12.8236 seconds (which accounts for the time difference). My conclusion is that perhaps the |
I am contemplating removing the |
Unique
is now bottom-up, since I found another test case where it was incorrect and this fixes it.DecisionTree
.GTSAM_DT_NO_PRUNING
toGTSAM_DT_MERGING
so it disambiguates from Hybrid pruning.GTSAM_DT_MERGING
via CMake.