Fast Interpretable Greedy-Tree Sums for Tree Ensembles

Flexible, interpretable machine learning algorithm for additive tree sums (FIGS). Fits a sum of shallow classification and regression trees (CART) by greedily minimizing residual impurity, growing a new tree or deepening an existing one at each step, whichever reduces the residuals most. Supports regression and two-class classification, variable importance, bootstrap ensembling and seamless integration with 'parsnip' and 'tidymodels' workflows. The method is described in Tan et al. (2023) .


figsr: Fast Interpretable Greedy-Tree Sums for R

CRAN downloads R-CMD-check License: MIT

figsr is an R implementation of Fast Interpretable Greedy-Tree Sums ('FIGS'), developed by researchers at UC Berkeley and Stanford (Tan et al., PNAS 2023, https://doi.org/10.1073/pnas.2310151122).

Unlike standard single decision trees ('CART') which suffer from inductive bias against additive structures and repeat subtrees, figsr greedily grows a sum of shallow decision trees ( $\hat{f}(x) = \sum_k \hat{f}_k(x)$ ). It achieves prediction accuracy close to random forests or gradient boosting while remaining human-interpretable with concise decision rules.


Installation

Install the released version from CRAN:

install.packages("figsr")

Or the development version from GitHub:

# install.packages("remotes")
remotes::install_github("bonijoao/figsr")

Quick Example with tidymodels

figsr seamlessly integrates with parsnip and tidymodels using native pipe syntax (|> or %>%):

library(tidymodels)
library(figsr)

# 1. Simulate additive data
set.seed(42)
df <- tibble(
  x1 = rnorm(300),
  x2 = rnorm(300),
  x3 = rnorm(300),
  y  = 3 * (x1 > 0) + 2 * (x2 > 0.5) - 1.5 * (x3 < -0.2) + rnorm(300, sd = 0.3)
)

# 2. Specify FIGS model using parsnip
figs_spec <- figs_tree(max_splits = 6, min_n = 5) |>
  set_engine("figsr") |>
  set_mode("regression")

# 3. Fit workflow
figs_fit <- df |>
  recipe(y ~ x1 + x2 + x3) |>
  workflow(figs_spec) |>
  fit(data = df)

# 4. Predict tidy tibble
preds <- predict(figs_fit, new_data = df)
head(preds)

Features

  • Tidymodels & Parsnip Integration: figs_tree() model specification.
  • Hyperparameter Tuning: Tune max_splits and max_trees with tune_grid().
  • Interpretability & Visualization: summary(fit) prints logical IF-THEN rules; plot(fit) draws visual tree sums.
  • Variable Importance: figsr_importance(fit) ranks feature impurity reductions.
  • Bagging-FIGS: Bootstrap ensembling via bagging_figs().

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("figsr")

0.1.1 by João Paulo Assis Bonifácio, 2 months ago


https://github.com/bonijoao/figsr


Report a bug at https://github.com/bonijoao/figsr/issues


Browse source code at https://github.com/cran/figsr


Authors: João Paulo Assis Bonifácio [aut, cre, cph] (ORCID: , Geraldo Magela da Cruz Pereira [aut, cph] (ORCID: , Pedro Mambelli Fernandes [aut, cph] (ORCID: , João Vitor Andrade Alves de Souza [aut, cph] (ORCID:


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports dials, graphics, parsnip, rlang, stats, tibble

Suggests knitr, rmarkdown, testthat


See at CRAN