Skip to main content

It is just a workaround to fix the current ngboost package issue. See: https://github.com/stanfordmlgroup/ngboost/issues/283

Project description

NGBoost: Natural Gradient Boosting for Probabilistic Prediction

Python package Github License Code style: black

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 learner. A didactic introduction to the methodology underlying NGBoost is available in this slide deck.

Installation

via pip

pip install --upgrade ngboost

via conda-forge

conda install -c conda-forge ngboost

Usage

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).mean()
print('Test NLL', test_NLL)

Details on available distributions, scoring rules, learners, tuning, and model interpretation are available in our user guide, which also includes numerous usage examples and information on how to add new distributions or scores to NGBoost.

License

Apache License 2.0.

Reference

Tony Duan, Anand Avati, Daisy Yi Ding, Khanh K. Thai, Sanjay Basu, Andrew Y. Ng, Alejandro Schuler. 2019. NGBoost: Natural Gradient Boosting for Probabilistic Prediction. arXiv

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ngboost-release-0.3.12.post2.tar.gz (25.7 kB view details)

Uploaded Source

Built Distribution

ngboost_release-0.3.12.post2-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

Details for the file ngboost-release-0.3.12.post2.tar.gz.

File metadata

  • Download URL: ngboost-release-0.3.12.post2.tar.gz
  • Upload date:
  • Size: 25.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.15 CPython/3.10.6 Linux/5.15.0-47-generic

File hashes

Hashes for ngboost-release-0.3.12.post2.tar.gz
Algorithm Hash digest
SHA256 8b50c3c1fe4598cd909667be9960970092f3448545151a33c671fa00b1fe76a0
MD5 4963160a390ce192e9cad7d82be38964
BLAKE2b-256 fb5c81649866e0ed780965dd8e21e4de5dbcccc077606b52138b149d2411156b

See more details on using hashes here.

File details

Details for the file ngboost_release-0.3.12.post2-py3-none-any.whl.

File metadata

File hashes

Hashes for ngboost_release-0.3.12.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 e05723e315f36eff6d68b2f3a574e8e7d66207958a6e6b669da6d76984b26404
MD5 774803a27668e1303ae34f9556c98944
BLAKE2b-256 08e36de0f102e0003c184d26d44cce20c4d41b7288010b6961b539ea1eddacd0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page