Freedom251 › Statistical Analysis Software
policytree

What policytree is
PolicyTree is a free R package for learning simple, interpretable rule-based policies represented as shallow decision trees. It uses doubly robust reward estimates to choose actions and is intended for settings such as medical treatment prescription. The policy_tree() function searches exhaustively for a globally optimal tree at a chosen depth, maximizing total rewards. For deeper trees, hybrid_policy_tree() combines optimal and greedy approaches. double_robust_scores() computes reward estimates for a subset of grf forest types, using estimates from the grf R package. Documentation covers binary and multi-action treatments and instrumental-variable examples. A fitted tree can predict an action for new observations supplied as a numeric matrix or data frame; plotting requires the optional DiagrammeR package. PolicyTree supports Linux, macOS, and Windows. Releases are available through CRAN, with development installation from GitHub. Source installation needs a C++ compiler, Rcpp, and BH; Windows source builds also require Rtools. Exact search does not scale to arbitrary dataset sizes, and fastpolicytree and sparsepolicytree are suggested for larger data.
Who it suits
PolicyTree suits R users building interpretable treatment or decision policies, including applications needing readable predictions. It is also relevant to users working with binary, multi-action, or instrumental-variable examples.
What it does well
- Learns interpretable shallow decision trees
- Exhaustive search finds globally optimal specified-depth trees
- Supports deeper hybrid optimal-greedy trees
- Runs on Linux, macOS, and Windows
- Available through CRAN under the MIT license
What to know first
- Exact search does not scale to arbitrary dataset sizes
- Source installation requires a C++ compiler
- Windows source builds require Rtools
- Plotting needs optional DiagrammeR
Verdict
PolicyTree focuses on transparent policy rules and provides both exhaustive and hybrid search methods. Its exact-search scaling limits and source-build requirements should be considered for larger or customized installations.
Facts from policytree's own pages
- Build requirements
- Installing from source requires a C++ compiler and the R packages Rcpp and BH; Windows source builds require Rtools. · grf-labs.github.io, 12 Oct 2026
- Deeper trees
- hybrid_policy_tree() uses a hybrid optimal and greedy approach to fit deeper trees. · grf-labs.github.io, 12 Oct 2026
- Deployment
- desktop · grf-labs.github.io, 23 Sept 2026
- Free plan
- Yes · grf-labs.github.io, 23 Sept 2026
- Installation
- The latest release is available through CRAN, and the development version can be installed from GitHub. · grf-labs.github.io, 12 Oct 2026
- Integration
- PolicyTree uses reward estimates from the grf R package. · grf-labs.github.io, 12 Oct 2026
- Intended application
- The package is intended for settings requiring interpretable predictions, such as medical treatment prescription. · grf-labs.github.io, 12 Oct 2026
- Intended users
- The stated applications include settings that require interpretable predictions, such as medical treatment prescription. · grf-labs.github.io, 12 Oct 2026
- Larger datasets
- The project points to fastpolicytree and sparsepolicytree as modified solvers that may improve performance on larger datasets. · grf-labs.github.io, 12 Oct 2026
- Learning method
- It uses doubly robust reward estimates to find a shallow, globally optimal decision tree. · grf-labs.github.io, 12 Oct 2026
- License
- The package is distributed under the MIT license with an accompanying license file. · grf-labs.github.io, 12 Oct 2026
- Optimization
- policy_tree() uses exhaustive search to fit a globally optimal tree of a specified depth that maximizes the sum of rewards. · grf-labs.github.io, 12 Oct 2026
- Plotting
- Tree plotting requires the optional DiagrammeR package. · github.com, 12 Oct 2026
- Prediction
- A fitted tree can predict an action for new observations; predictions accept numeric matrices or data frames. · github.com, 12 Oct 2026
- Purpose
- PolicyTree learns simple rule based policies represented as shallow decision trees, including interpretable treatment prescriptions. · grf-labs.github.io, 12 Oct 2026
- Reward estimates
- The double_robust_scores function computes reward estimates for a subset of grf forest types. · grf-labs.github.io, 12 Oct 2026
- Scale considerations
- The project points to fastpolicytree and sparsepolicytree as modified solvers that may improve performance on larger datasets. · grf-labs.github.io, 12 Oct 2026
- Scale limits
- The documentation says exact tree search does not scale to arbitrary dataset sizes and gives runtime examples showing substantial growth with more observations. · grf-labs.github.io, 12 Oct 2026
- Scripting support
- Yes · grf-labs.github.io, 23 Sept 2026
- Support
- The project directs usage questions to its GitHub issues page and welcomes contributions. · grf-labs.github.io, 12 Oct 2026
- Treatment types
- The documentation demonstrates policy learning for binary and multi-action treatments, as well as instrumental-variable examples. · grf-labs.github.io, 12 Oct 2026
- Tree search
- The policy_tree function finds a depth k tree by exhaustive search; hybrid_policy_tree combines optimal and greedy approaches for deeper trees. · grf-labs.github.io, 12 Oct 2026
Where policytree stands on Freedom251
- Statistical Analysis Software#63 of 106