Skip to content

Natural Gradient Boosting for Probabilistic Prediction

License

Notifications You must be signed in to change notification settings

matsuken92/ngboost

This branch is 471 commits behind stanfordmlgroup/ngboost:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

04f93a8 · Nov 28, 2019
Sep 5, 2019
Nov 28, 2019
Nov 19, 2019
Nov 27, 2019
Sep 4, 2019
Nov 27, 2019
Oct 16, 2019
Oct 9, 2019
Nov 15, 2019
Nov 15, 2019
Oct 16, 2019
Nov 19, 2019

Repository files navigation

NGBoost: Natural Gradient Boosting for Probabilistic Prediction

ngboost is a Python library that implements Natural Gradient Boosting, as described in "NGBoost: Natural Gradient Boosting for Probabilistic Prediction". It is built on top of Scikit-Learn, and is designed to be scalable and modular with respect to choice of proper scoring rule, distribution, and base learners.

Installation:

pip install --upgrade git+https://github.com/stanfordmlgroup/ngboost.git

Probabilistic regression example on the Boston housing dataset:

from ngboost import NGBRegressor

from sklearn.datasets import load_boston
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error


X, Y = load_boston(True)
X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.2)

ngb = NGBRegressor().fit(X_train, Y_train)
Y_preds = ngb.predict(X_test)
Y_dists = ngb.pred_dist(X_test)

# test Mean Squared Error
test_MSE = mean_squared_error(Y_preds, Y_test)
print('Test MSE', test_MSE)

# test Negative Log Likelihood
test_NLL = -Y_dists.logpdf(Y_test.flatten()).mean()
print('Test NLL', test_NLL)

About

Natural Gradient Boosting for Probabilistic Prediction

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 84.7%
  • Shell 15.0%
  • Makefile 0.3%