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

A question about get_tree_data() in utils.py #10

Open
chenfork opened this issue Oct 12, 2020 · 2 comments
Open

A question about get_tree_data() in utils.py #10

chenfork opened this issue Oct 12, 2020 · 2 comments

Comments

@chenfork
Copy link

Hi , I have a small question about a line of code in get_tree_data():

all_leaf_node_classes = [all_features_idx[np.argmax(

This line , why do you have all_features_idx to retrive the node class information?

I think class have nothing to do with feature values. Plus, what if your class number is bigger than feature number? Won't that be a IndexError?
Thanks!

@shifwang
Copy link
Collaborator

shifwang commented Oct 13, 2020

That's indeed an issue. We should use sth like classes_idx other than all_features_idx here. Thanks for pointing this out! For binary classifications, this should be fine unless there is only one feature. But in general this could cause problems.

@chenfork
Copy link
Author

Thanks for quick reply! Good work!

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