Registry / ai-ml / quantile-forest

quantile-forest

JSON →
library1.4.1pypypi✓ verified 82d ago

Quantile regression forests for scikit-learn compatible probabilistic forecasting. Version 1.4.1, actively maintained. Provides quantile predictions from random forest models with scikit-learn API.

pip install quantile-forest
INSTALL
IMPORT
SIG · QUANTILE-FOREST
Q
quantile-forest
ai-mlpythonv1.4.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RandomForestQuantileRegressor
from quantile_forest import RandomForestQuantileRegressor
from quantile_forest import QuantileForestRegressor
ExtraTreesQuantileRegressor
from quantile_forest import ExtraTreesQuantileRegressor

Fit a quantile regression forest and predict 5th and 95th percentiles.

from quantile_forest import QuantileForestRegressor from sklearn.datasets import make_regression X, y = make_regression(n_samples=100, n_features=4, random_state=0) qfr = QuantileForestRegressor() qfr.fit(X, y) y_pred_lower = qfr.predict(X, quantiles=0.05) y_pred_upper = qfr.predict(X, quantiles=0.95) print(y_pred_lower[:5], y_pred_upper[:5])
Debug
Known issues
gotchapredict() returns numpy array with shape (n_samples, n_quantiles) when multiple quantiles are provided, but (n_samples,) for single quantile. Check shape assumptions.
fix
Always use quantiles as a list even for single value: quantiles=[0.5] to get consistent shape.
affects: all
gotchaThe fit() method requires y to be 1-dimensional. Passing a 2D array (e.g., shape (n,1)) may fail silently or raise error.
fix
Squeeze y: y = y.ravel() before fitting.
affects: all
deprecatedIn version 1.3.0, the parameter 'n_estimators' was renamed to 'n_estimators' (no change), but 'bootstrap' param default changed from False to True. Re-check your model config if upgrading.
fix
Explicitly set bootstrap=False if you relied on old default.
affects: >=1.3.0
gotchaWhen using predict() with return_y_std=True, the output is a tuple of (y_hat, y_std) but only for the mean prediction (quantiles=None). Do not combine with quantiles.
fix
Use quantiles=None to get mean and std; use quantiles=[0.5] to get median separately.
affects: all
Upgrade
Version history
1.4.1latest on PyPI · released Sep 10, 2025
Audit
Dependencies
scikit-learnrequiredCore dependency, provides base estimators.
numpyrequiredNumerical operations.
pandasoptionalOptional, for DataFrame inputs.
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
quantile-forest — pip install quantile-forest · libregistry