## boosting.BoosterFit


A fitted [Booster](boosting.Booster.md#prospicio.boosting.Booster): means and joint predictive draws.


Usage

``` python
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()](#predict) | Fitted means for the rows of [design](models.Coding.md#prospicio.models.Coding.design) (the [alpha](models.ElasticNet.md#prospicio.models.ElasticNet.alpha) quantiles |
| [predict_dispersion()](#predict_dispersion) | Each row's dispersion from the dispersion model, or the constant |
| [predict_distribution()](#predict_distribution) | Joint draws across the rows, keyed `row = 0, 1, ...`: each row's |

------------------------------------------------------------------------


#### predict()


Fitted means for the rows of [design](models.Coding.md#prospicio.models.Coding.design) (the [alpha](models.ElasticNet.md#prospicio.models.ElasticNet.alpha) quantiles


Usage

``` python
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

``` python
predict_dispersion(design)
```


[dispersion](models.GlmFit.md#prospicio.models.GlmFit.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

``` python
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`
