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.
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
muslpy 3.10–3.95 runs
build_error
glibcpy 3.10–3.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
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.