A question about get_tree_data() in utils.py
chenfork opened this issue · 2 comments
chenfork commented
Hi , I have a small question about a line of code in get_tree_data():
iterative-Random-Forest/irf/utils.py
Line 192 in 286d65b
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 commented
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 commented
Thanks for quick reply! Good work!