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

render values in markdown #1001

Merged
merged 7 commits into from
Jan 4, 2022
Merged

render values in markdown #1001

merged 7 commits into from
Jan 4, 2022

Conversation

dellaert
Copy link
Member

@dellaert dellaert commented Jan 3, 2022

Added an optional argument "names" to discrete markdown renderers.

An example from testDiscreteConditional.cpp:

  DecisionTreeFactor::Names names{
      {0, {"Zero", "One", "Two"}}, {1, {"-", "+"}}, {2, {"T", "F"}}};
  cout << conditional.markdown(formatter, names);

P(A|B,C):

B C T F
- Zero 0 1
- One 0.25 0.75
- Two 0.5 0.5
+ Zero 0.75 0.25
+ One 0 1
+ Two 1 0

update: I snuck in a fix for sampling in discrete as well, hope that's ok.

@dellaert dellaert requested a review from gchenfc January 3, 2022 02:38
@dellaert dellaert changed the base branch from develop to feature/decison_tree January 3, 2022 02:39
@dellaert dellaert self-assigned this Jan 3, 2022
Copy link
Collaborator

@varunagrawal varunagrawal left a comment

Choose a reason for hiding this comment

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

Stray cout print in a test

Copy link
Collaborator

@varunagrawal varunagrawal left a comment

Choose a reason for hiding this comment

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

LGTM modulo 2 comments.

gtsam/discrete/DiscreteFactor.h Show resolved Hide resolved
Base automatically changed from feature/decison_tree to develop January 3, 2022 22:58
@dellaert dellaert merged commit 53b4053 into develop Jan 4, 2022
@dellaert dellaert deleted the feature/markdown_values branch January 4, 2022 00:11
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