Skip to content
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

DecisionTree Refactor #1155

Merged
merged 5 commits into from
Apr 14, 2022
Merged

DecisionTree Refactor #1155

merged 5 commits into from
Apr 14, 2022

Conversation

varunagrawal
Copy link
Collaborator

Refactored DecisionTree to:

  1. Make a distinction between leaves and assignments. A tree always has a full number of assignments (which each gives us a value) but can have a smaller number of leaves (the data structure) due to pruning.
  2. Updated the documentation accordingly.
  3. Renamed DT_NO_PRUNING to GTSAM_DT_NO_PRUNING in the event we decide to expose it via CMake.

@varunagrawal varunagrawal self-assigned this Mar 31, 2022
@varunagrawal varunagrawal deleted the branch develop April 2, 2022 14:01
@varunagrawal varunagrawal reopened this Apr 2, 2022
@varunagrawal varunagrawal changed the base branch from decisiontree/nrAssignments to develop April 2, 2022 14:22
@varunagrawal
Copy link
Collaborator Author

@dellaert hope this PR is up to your expectations.

@varunagrawal
Copy link
Collaborator Author

@dellaert gentle reminder to take a look at this when you can :)

/**
* Functor performing depth-first visit without Assignment<L> argument.
*
* NOTE: We differentiate between leaves and assignments. Concretely, a 3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, what does this Functor do? Leaves, right? And should it not now pass the number of assignments captured by the leaf?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The VisitLeaf functor passes the Leaf object which has the number of assignments recorded in it.

@@ -678,7 +680,14 @@ namespace gtsam {
}

/****************************************************************************/
// Functor performing depth-first visit without Assignment<L> argument.
/**
* Functor performing depth-first visit without Assignment<L> argument.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the argument then?

@@ -763,12 +775,14 @@ namespace gtsam {
}

/****************************************************************************/
// labels is just done with a visit
// Get (partial) labels by performing a visit.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain more. Maybe with example.

*
* @note Due to pruning, leaves might not exhaust choices.
*
*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these functions passed in should now also take an argument for the number of assignments captured in a particular leaf.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added visitLeaf as an alternative to that. Should I remove that and update the rest to do this (will be API breaking)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shoot, I merged too soon! I just noticed this new visitLeaf, which in this PR seems identical??

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the examples are wrong I think... We can talk about it in our meeting.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay! Though I don't want to spend more than 5 minutes on this since it is secondary to the workshop paper.

Copy link
Member

@dellaert dellaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, and I will merge...

@dellaert dellaert merged commit 78d7e90 into develop Apr 14, 2022
@dellaert dellaert deleted the decisiontree-refactor branch April 14, 2022 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants