--- id: forestci version: "0.8" license: MIT license_treatment: permissive maintenance: active --- # forestci — Confidence intervals for scikit-learn forest algorithms License: permissive · Maintenance: active · Downloads: 128.5K/mo ## 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 above — 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 pip install forestci uv add forestci poetry add forestci ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 128.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags random forest confidence intervals, forest prediction uncertainty, scikit-learn variance estimation, ensemble model error bars, random forest prediction intervals, uncertainty-quantification, scikit-learn-extension [View on SkillFed](https://skillfed.io/packages/forestci) · [View on PyPI](https://pypi.org/project/forestci/)