Closed jarkki closed 1 year ago
Thanks for reporting this @jarkki. Ideally there's a representation indexing bug somewhere which should only affect leaf id, point predictions should be correct per this test, I won't have time to look closer until a bit later. Thanks again.
So yes this was only hybrid policytree using different terminal node labels than what was printed. If you only care about subgroups, preds <- predict(tree, X, type = "node.id")
will work correctly.
The printed label / predicted label mismatch is fixed in #153.
Thank you so much for fixing this! My use case was to represent the tree in a table format like
leaf.id | rules | CATE | N obs |
---|---|---|---|
Steps to build the table were
The leaf indices now match and this works as expected.
The library is really amazing, thanks for developing it!
Just a heads up @jarkki, I changed the fix to this in #156 by instead just renaming the hybrid tree's leaf id's s.t. they are level-first, which is the same as rest of policytree. Now policy_tree
and hybrid_policy_tree
will give you the same node "labels".
Description of the bug Hybrid policy tree grows redundant leaf-nodes where no training data falls into. Also, node prediction returns non-leaf nodes.
Steps to reproduce
When predicting,
policytree version