rieszreg holds the shared abstractions; pick at least one implementation package for an actual learner.
Python
The five packages live in sibling GitHub repos: rieszreg (meta-package + this user guide), rieszboost, krrr, forestriesz, riesznet. Clone them into a parent directory:
rieszboost’s XGBoostBackend requires OpenMP. On macOS:
brew install libomp
Linux distributions (and GitHub Actions ubuntu-latest) ship libgomp1; no extra step is needed. krrr has no system prerequisites; an optional GPU backend uses falkon (pip install -e 'krrr/python[falkon]'). forestriesz depends on econml, which ships prebuilt wheels for macOS arm64+x86_64 and ubuntu — no compiler required. riesznet depends on torch>=2.0; CPU wheels are fetched automatically, GPU wheels need a --index-url per the PyTorch install matrix.
Combining rieszboost and riesznet in one process
The macOS pip wheels for xgboost and torch each bundle their own libomp.dylib. When both are loaded into one Python process, the two OpenMP runtimes can deadlock during a fit (troubleshooting). Two install paths avoid this:
conda-forge — installs xgboost and pytorch against a single shared llvm-openmp, so the conflict cannot occur:
pip + thread-limit env vars — keep the pip install above and set OMP_NUM_THREADS=1 (and MKL_NUM_THREADS=1) in the shell or at the top of every script that uses both backends. See the troubleshooting page for the full discussion and options including threadpoolctl.threadpool_limits for finer-grained control.
Verify
The chunks below import each package and exercise its public entry point. Failure to import or instantiate raises immediately.
import importlib.metadata as _mdimport rieszreg, rieszboost, krrr, forestriesz, riesznetfrom rieszreg import ATE, BoundedSquaredLoss, SquaredLossfrom rieszboost import RieszBoosterfrom krrr import KernelRieszRegressorfrom forestriesz import ForestRieszRegressorfrom riesznet import RieszNet# Construct one estimator from each backend to confirm wiring.estimand = ATE()RieszBooster(estimand=estimand, n_estimators=5)
RieszBooster(estimand=<rieszreg.estimands.base.ATE object at 0x7f4c879984d0>,
n_estimators=5)
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
RieszBooster(estimand=<rieszreg.estimands.base.ATE object at 0x7f4c879984d0>,
n_estimators=5)
KernelRieszRegressor(estimand=<rieszreg.estimands.base.ATE object at 0x7f4c879984d0>,
lambda_grid=(0.01,))
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
KernelRieszRegressor(estimand=<rieszreg.estimands.base.ATE object at 0x7f4c879984d0>,
lambda_grid=(0.01,))
ForestRieszRegressor(estimand=<rieszreg.estimands.base.ATE object at 0x7f4c879984d0>,
n_estimators=10)
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
ForestRieszRegressor(estimand=<rieszreg.estimands.base.ATE object at 0x7f4c879984d0>,
n_estimators=10)
RieszNet(epochs=1,
estimand=<rieszreg.estimands.base.ATE object at 0x7f4c879984d0>,
hidden_sizes=(8,))
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
RieszNet(epochs=1,
estimand=<rieszreg.estimands.base.ATE object at 0x7f4c879984d0>,
hidden_sizes=(8,))
for pkg in ("rieszreg", "rieszboost", "krrr", "forestriesz", "riesznet"):print(f"{pkg:<12}{_md.version(pkg)}")
# `_setup.qmd` already dev-loaded rieszreg + rieszboost. Reference the# exported symbols and instantiate one R6 wrapper to confirm reticulate# is wired through to the Python venv.stopifnot(is.function(ATE), R6::is.R6Class(RieszBooster))booster <- RieszBooster$new(estimand =ATE(), n_estimators =5L)cat("rieszreg + rieszboost R wrappers OK (",class(booster)[1], ")\n", sep ="")
rieszreg + rieszboost R wrappers OK (RieszBooster)
R wrappers (optional)
The R packages are R6 wrappers that call the Python implementations through reticulate. They do not require any separate algorithmic dependency.
First-time setup:
Install the R package dependencies:
install.packages(c("reticulate", "R6", # required: Python bridge + R6 classes"pkgload", # required for `pkgload::load_all` below"rsample", "xgboost"# optional: used in the landing-page R quickstart# and the estimation/custom-code page))
Load the R wrappers. For this guide we dev-load them from the source tree:
The R API exposes every built-in estimand, every loss, and the full estimator interface for each backend. The symbolic tracer for custom m() is Python-only; see r-interface for how to call it from R.