Yu-Group/iterative-Random-Forest

A question about get_tree_data() in utils.py

chenfork opened this issue · 2 comments

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!

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.

Thanks for quick reply! Good work!