grf-labs/policytree

Add `repopulate_leaves` functionality

Opened this issue · 0 comments

All the theory references for policytree are for adaptive trees, but some users may want to construct "honest" trees by fitting in one sample, then repopulating with the argmax in a new sample, like tree.new <- repopulate_leaves(tree.old. X, Y). This is fairly straight forward to implement in R (predict region with type="node.id", select argmax, then replace action ids in the internal tree data structure stored in the R object. We would not take pruning into account here though).

Leaving as an issue for now, awaiting feedback on potential interest, as @halflearned already has a separate Python solution working for his use case.