forestci
Confidence intervals for scikit-learn forest algorithms
What it is and what it does
forestci extends scikit-learn's random forest objects by adding uncertainty quantification—computing in-bag error estimates and confidence intervals around predictions. It wraps fitted forest models and calculates how much prediction variability stems from the training set composition, helping you understand how reliable individual predictions are.
The package is built on algorithms from Stefan Wager's R implementation and works with scikit-learn 1.0 through 1.9. It requires a large number of trees for reliable intervals; an optional calibration routine attempts to extrapolate results for infinite trees but can be unstable, so the description recommends disabling it with calibrate=False and increasing tree count if numerical errors occur.
Use it for:
- Quantify prediction uncertainty in random forest regression to report confidence bands alongside point estimates.
- Assess classification model confidence by computing error bars for predicted probabilities.
- Diagnose training set sensitivity by examining how much predictions vary with different subsamples.
- Validate model stability before deployment by checking whether confidence intervals narrow as tree count increases.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Computes confidence intervals and variance estimates for scikit-learn random forest regression and classification models, quantifying prediction uncertainty.
Yes. Active maintenance, permissive MIT license, low install friction, no known vulnerabilities, and a focused role in an underserved niche (uncertainty quantification for scikit-learn forests). Install if you need confidence intervals on random forest predictions; skip if you use other ensemble libraries or don't require uncertainty estimates.
Install
forestci on PyPI
pip
pip install forestciuv
uv add forestcipoetry
poetry add forestciInstalling forestci
Before you install
Low friction: pure Python wheel with three standard scientific dependencies (numpy, scikit-learn, scipy). Actively maintained with last commit 2026-07-29.
License in practice
MIT license permits unrestricted use, modification, and distribution in commercial and private projects with minimal obligations.
Quickstart
pip install forestci
import forestci as fci
ci = fci.random_forest_error(
forest=model,
X_train_shape=X_train.shape,
X_test=X,
calibrate=True
)
Requires scikit-learn 1.0 through 1.9 and Python 3.10 or later; best results with a large number of trees in the forest model.
Verify before relying
- Whether calibration routine convergence issues occur frequently in practice or only under specific model configurations.
- Performance characteristics when applied to very large forests or high-dimensional datasets.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — numpy, scikit-learn, scipy |
| Maintenance | actively maintained — 20 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 128,512/month — #11,704 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: forestci-0.8-py3-none-any.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
MAPIEMAPIE computes prediction intervals and…
permissive · top 15,000 on PyPI
quantile-forestQuantile regression forests for estimating…
permissive · top 15,000 on PyPI
treeinterpreterDecomposes scikit-learn decision tree and…
permissive · top 15,000 on PyPI
bootstrappedBuilds confidence intervals from data samples…
unclear · top 15,000 on PyPI
betacalFits beta calibration models to classifier…
permissive · top 15,000 on PyPI
BorutaBoruta performs all-relevant feature selection…
permissive · top 15,000 on PyPI
ngboostNGBoost implements Natural Gradient Boosting…
permissive · top 15,000 on PyPI
tensorflow-decision-forestsTrains and deploys decision forest models…
permissive · top 15,000 on PyPI
missingpyFills missing values in data arrays using…
copyleft · top 15,000 on PyPI
scikit-learn-extraExtends scikit-learn with additional machine…
permissive · top 15,000 on PyPI