Registry / ai-ml / ngboost

ngboost

JSON →
library0.5.10pypypi✓ verified 35d ago

NGBoost is a library for probabilistic prediction via gradient boosting that estimates full probability distributions rather than point predictions. Current version is 0.5.10, supporting Python 3.9–3.14. It uses natural gradient boosting to learn parameters of a parametric distribution. Release cadence is periodic, with recent versions adding distribution support (Weibull, HalfNormal, Beta, etc.), numpy2 compatibility, and sklearn compatibility. Maintained by the Stanford ML Group.

ai-mldata
Install & Compatibility
Where this runs
tested against v0.5.10 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 23.8s · import 9.458s · 497MB
529MB installed
● package 529MB
Code
Verified usage

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

from ngboost import NGBRegressor

Common error: trying to import from submodule instead of top-level

from ngboost import NGBClassifier

Distributions are in ngboost.distns, not top-level.

from ngboost.distns import Normal

Scores are in ngboost.scores submodule.

from ngboost.scores import LogScore

Basic usage of NGBoost for regression with a Normal distribution and LogScore.

import numpy as np from ngboost import NGBRegressor from ngboost.distns import Normal from ngboost.scores import LogScore # Generate sample data np.random.seed(42) X = np.random.randn(100, 1) y = X[:, 0] + 0.1*np.random.randn(100) # Train probabilistic model ngb = NGBRegressor(Dist=Normal, Score=LogScore, n_estimators=100, learning_rate=0.01, verbose=False) ngb.fit(X, y) # Predict: mean and variance (or scale) of Normal distribution y_preds = ngb.predict(X) # Use ngb.pred_dist(X) to get distribution object
Debug
Known footguns
breakingVersion 0.5.5 upgraded sklearn dependency to >1.6. If using older sklearn, upgrade or pin ngboost<0.5.5.
breakingVersion 0.5.2 added support for Numpy 2.0. Code relying on numpy<2 behavior (e.g., object dtype in arrays) may break with ngboost>=0.5.2.
deprecatedThe 'natural_gradient' parameter in some internal methods was deprecated in v0.5.8 and may be removed in future.
gotchaDefault distribution is Normal with LogScore. If you use a different distribution, ensure the Score matches the distribution (e.g., LogScore for exponential family). Mismatch leads to silent poor performance.
gotchaModels saved with sklearn <1.3 may not load with sklearn >=1.3 due to pickle format. ngboost>=0.5.10 includes a compatibility loader `load_ngboost_model`.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
27 hits · last 30 days
bytedance
6
gptbot
4
amazonbot
4
ahrefsbot
3
claudebot
2
script
1
Resources