boosting.BoosterFit

A fitted Booster: means and joint predictive draws.

Usage

Source

boosting.BoosterFit(
    spec,
    names,
    model,
    boots,
    dispersion,
    base,
)

Attributes

model

The engine’s booster (lightgbm.Booster or xgboost.Booster).

base: float

The constant added to the offset so the trees start from the mean.

dispersion: float

1 for the Poisson; otherwise Pearson’s estimate on the training rows, sum w (y - mu)^2 / V(mu) / n (no degrees-of-freedom correction: trees have no fixed parameter count).

dispersion_fit
With dispersion_model=True, the dispersion booster and its starting log level; otherwise None.

Methods

Name Description
predict() Fitted means for the rows of design (the alpha quantiles
predict_dispersion() Each row’s dispersion from the dispersion model, or the constant
predict_distribution() Joint draws across the rows, keyed row = 0, 1, ...: each row’s

predict()

Fitted means for the rows of design (the alpha quantiles

Usage

Source

predict(design)

for family="quantile").

Parameters
design: Design
Same columns as the training design; its offset applies.
Returns
list of float

predict_dispersion()

Each row’s dispersion from the dispersion model, or the constant

Usage

Source

predict_dispersion(design)

dispersion when the booster was fitted without one.

Parameters
design: Design
Returns
list of float

predict_distribution()

Joint draws across the rows, keyed row = 0, 1, ...: each row’s

Usage

Source

predict_distribution(design, n_sims, seed)

response from the family around its mean (process noise), with the means of one bootstrap refit per simulation when n_boot > 0 (parameter uncertainty).

Parameters
design: Design
n_sims: int
seed: int
Returns
PredictiveDistribution