jncraton / quantile-forest

Quantile Regression Forests compatible with scikit-learn.

Home Page:https://zillow.github.io/quantile-forest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

quantile-forest

PyPI - Version License GitHub Actions Codecov Code Style black PyPI - Downloads

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]. 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 variants.

Example of fitted model predictions and prediction intervals on California housing data (code)

Quick Start

Install quantile-forest from PyPI using pip:

pip install quantile-forest

Usage

  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.

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

About

Quantile Regression Forests compatible with scikit-learn.

https://zillow.github.io/quantile-forest/

License:Apache License 2.0


Languages

Language:Python 70.3%Language:Cython 25.4%Language:TeX 4.4%