iterative-Random-Forest icon indicating copy to clipboard operation
iterative-Random-Forest copied to clipboard

A question about get_tree_data() in utils.py

Open chenfork opened this issue 4 years ago • 2 comments

Hi , I have a small question about a line of code in get_tree_data():
https://github.com/Yu-Group/iterative-Random-Forest/blob/286d65b833c9167233d3d3bab625f6fd54d8c8b4/irf/utils.py#L192

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!

chenfork avatar Oct 12 '20 07:10 chenfork

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.

shifwang avatar Oct 13 '20 03:10 shifwang

Thanks for quick reply! Good work!

chenfork avatar Oct 13 '20 11:10 chenfork