{"id":23761,"library":"forestci","title":"forestci: confidence intervals for scikit-learn forest algorithms","description":"forestci provides confidence intervals for random forest predictions using the infinitesimal jackknife method. It supports scikit-learn's RandomForestClassifier, RandomForestRegressor, ExtraTreesClassifier, and ExtraTreesRegressor. Version 0.7 includes bug fixes and improved documentation, with no breaking changes from 0.6. The library is stable but released infrequently.","status":"active","version":"0.7","language":"python","source_language":"en","source_url":"http://github.com/scikit-learn-contrib/forest-confidence-interval","tags":["confidence intervals","random forest","scikit-learn","infinitesimal jackknife","machine learning"],"install":[{"cmd":"pip install forestci","lang":"bash","label":"pip install forestci"}],"dependencies":[{"reason":"forestci works with scikit-learn's forest estimators; requires sklearn >= 0.21","package":"scikit-learn","optional":false},{"reason":"used for array operations","package":"numpy","optional":false},{"reason":"used for statistical functions","package":"scipy","optional":false}],"imports":[{"note":"main function for computing confidence intervals","symbol":"calc_inference","correct":"from forestci import calc_inference"},{"note":"computes bias-corrected error variance","symbol":"random_forest_error","correct":"from forestci import random_forest_error"},{"note":"forestci is a module, not a function; do not import as a submodule","wrong":"from forestci import forestci","symbol":"forestci","correct":"import forestci"}],"quickstart":{"code":"from sklearn.ensemble import RandomForestRegressor\nfrom sklearn.datasets import make_regression\nfrom forestci import random_forest_error\nimport numpy as np\n\nX, y = make_regression(n_samples=100, n_features=4, noise=0.1, random_state=42)\nrf = RandomForestRegressor(n_estimators=100, random_state=42)\nrf.fit(X, y)\npred = rf.predict(X)\nerror_var = random_forest_error(rf, X, X)\n# 95% confidence interval\nci = 1.96 * np.sqrt(error_var)\nprint(ci[:5])","lang":"python","description":"Compute confidence intervals for RandomForestRegressor predictions using the infinitesimal jackknife."},"warnings":[{"fix":"Use X_train as the 'inbag' argument or pass the training data explicitly.","message":"random_forest_error requires the training data (X_train) to compute the inbag matrix. If you pass the same data for prediction, ensure it is the training set.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace calc_inference with random_forest_error(\n    rf, X_test, X_train\n) + manual CI computation.","message":"calc_inference (formerly calc_corr) has been deprecated. Use random_forest_error for variance estimation and then compute confidence intervals manually.","severity":"gotcha","affected_versions":">=0.6"},{"fix":"Upgrade scikit-learn to 0.24+ or use the forestci compatible version. Check estimator type.","message":"In version 0.7, the random_forest_error function may raise AttributeError if the forest estimator doesn't have estimators_samples_ attribute (e.g., older sklearn versions).","severity":"gotcha","affected_versions":"0.7"}],"env_vars":null,"search_vec":"'0.6':47 '0.7':35 'algorithm':9 'break':44 'bug':37 'chang':45 'confid':2,12,55 'document':41 'extratreesclassifi':31 'extratreesregressor':33 'fix':38 'forest':8,16,58 'forestci':1,10 'improv':40 'includ':36 'infinitesim':20,62 'infrequ':54 'interv':3,13,56 'jackknif':21,63 'learn':7,27,61,65 'librari':49 'machin':64 'method':22 'predict':17 'provid':11 'random':15,57 'randomforestclassifi':29 'randomforestregressor':30 'releas':53 'scikit':6,26,60 'scikit-learn':5,25,59 'stabl':51 'support':24 'use':18 'version':34","created_at":"2026-05-01T08:09:29.262486+00:00","updated_at":"2026-05-01T08:09:29.262486+00:00","problems":{"verify_error":"Failed to import duecredit due to No module named 'duecredit'\nTraceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: cannot import name 'calc_inference' from 'forestci' (/tmp/tmpg_k5ab05/venv/lib/python3.12/site-packages/forestci/__init__.py)"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.7","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"http://github.com/scikit-learn-contrib/forest-confidence-interval","docs":null,"changelog":null,"pypi":"https://pypi.org/project/forestci/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"install_fail","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-09","install_tag":null}}