https://github.com/zillow/quantile-forest
Quantile Regression Forests compatible with scikit-learn.
https://github.com/zillow/quantile-forest
machine-learning prediction-intervals python quantile-regression quantile-regression-forests random-forest scikit-learn-api uncertainty-estimation
Last synced: about 1 year ago
JSON representation
Quantile Regression Forests compatible with scikit-learn.
- Host: GitHub
- URL: https://github.com/zillow/quantile-forest
- Owner: zillow
- License: apache-2.0
- Created: 2022-03-23T01:33:57.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-11T08:22:30.000Z (about 2 years ago)
- Last Synced: 2024-04-13T23:07:24.442Z (about 2 years ago)
- Topics: machine-learning, prediction-intervals, python, quantile-regression, quantile-regression-forests, random-forest, scikit-learn-api, uncertainty-estimation
- Language: Python
- Homepage: https://zillow.github.io/quantile-forest/
- Size: 17.3 MB
- Stars: 151
- Watchers: 11
- Forks: 19
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
README
[](https://pypi.org/project/quantile-forest)
[](https://github.com/zillow/quantile-forest/blob/main/LICENSE)
[](https://github.com/zillow/quantile-forest/actions/workflows/build.yml)
[](https://codecov.io/gh/zillow/quantile-forest)
[](https://github.com/psf/black)
[](https://doi.org/10.21105/joss.05976)
**quantile-forest** offers a Python implementation of quantile regression forests compatible with scikit-learn.
Quantile regression forests (QRF) are a non-parametric, tree-based ensemble method for estimating conditional quantiles, with application to high-dimensional data and uncertainty estimation [[1]](#1). The estimators in this package are performant, Cython-optimized QRF implementations that extend the forest estimators available in scikit-learn to estimate conditional quantiles. The estimators can estimate arbitrary quantiles at prediction time without retraining and provide methods for out-of-bag estimation, calculating quantile ranks, and computing proximity counts. They are compatible with and can serve as drop-in replacements for the scikit-learn forest regressors.
#### Example of fitted model predictions and prediction intervals on California housing data ([code](https://zillow.github.io/quantile-forest/gallery/plot_qrf_prediction_intervals.html))

Quick Start
-----------
To install quantile-forest from [PyPI](https://pypi.org/project/quantile-forest) using `pip`:
```bash
pip install quantile-forest
```
To install quantile-forest from [conda-forge](https://anaconda.org/conda-forge/quantile-forest) using `conda`:
```bash
conda install quantile-forest -c conda-forge
```
Usage
-----
```python
from quantile_forest import RandomForestQuantileRegressor
from sklearn import datasets
X, y = datasets.fetch_california_housing(return_X_y=True)
qrf = RandomForestQuantileRegressor()
qrf.fit(X, y)
y_pred = qrf.predict(X, quantiles=[0.025, 0.5, 0.975])
```
Documentation
-------------
An installation guide, API documentation, and examples can be found in the [documentation](https://zillow.github.io/quantile-forest).
References
----------
[1] N. Meinshausen, "Quantile Regression Forests", Journal of Machine Learning Research, 7(Jun), 983-999, 2006. http://www.jmlr.org/papers/volume7/meinshausen06a/meinshausen06a.pdf
Citation
--------
If you use this package in academic work, please consider citing https://joss.theoj.org/papers/10.21105/joss.05976:
```bib
@article{Johnson2024,
doi = {10.21105/joss.05976},
url = {https://doi.org/10.21105/joss.05976},
year = {2024},
publisher = {The Open Journal},
volume = {9},
number = {93},
pages = {5976},
author = {Reid A. Johnson},
title = {quantile-forest: A Python Package for Quantile Regression Forests},
journal = {Journal of Open Source Software}
}
```
