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

Getting the intermediate decisions on Colab #2

Closed
WesDeng opened this issue May 7, 2020 · 1 comment
Closed

Getting the intermediate decisions on Colab #2

WesDeng opened this issue May 7, 2020 · 1 comment

Comments

@WesDeng
Copy link

WesDeng commented May 7, 2020

When I call model.forward_with_decisions to get the intermediate decisions on Colab, we get a list of 'node': <nbdt.data.custom.Node object at 0x7f2318a35a90> objects. How could I get access to the information within the node? And how could I generate a visualization of a decision tree based on this result?

@alvinwan
Copy link
Owner

alvinwan commented May 7, 2020

Great questions. Thanks for using the repo!

1. How to get information in node?

I realized the Colab notebook by default uses the SoftNBDT. I suggest changing that to a HardNBDT instead, as forward_with_decisions for HardNBDT comes with more human-readable labels right off the bat.

You can also do this for SoftNBDT: Each node has an attached synset .synset, and you can get the node name from the synset synset_to_name.

2. How to generate visualization?

There are a number of example visualizations in the README, in 1. Hierarchies (including how to reproduce the figures in the paper).

Let me know if you have any further questions.

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

No branches or pull requests

2 participants