interpret.predictions

interpret.predictions(
    model,
    idata,
    conditional=None,
    average_by=None,
    target='mean',
    pps=False,
    use_hdi=True,
    prob=az.rcParams['stats.ci_prob'],
    transforms=None,
    sample_new_groups=False,
)

Compute conditional adjusted predictions.

Parameters

model : Model

The fitted Bambi model.

idata : InferenceData

InferenceData object containing the posterior samples.

conditional : ConditionalParam = None

Variables to condition on for predictions.

average_by : (str, list or None) = None

Variables to average predictions over.

target : str = 'mean'

The target parameter to predict. Default is “mean”.

pps : bool = False

Whether to use posterior predictive samples. Default is False.

use_hdi : bool = True

Whether to use highest density interval. Default is True.

prob : float or list[float] = az.rcParams['stats.ci_prob']

Probability or list of probabilities for credible intervals. Default is from arviz rcParams. When a list is provided, multiple nested intervals are computed.

transforms : dict or None = None

Dictionary of transformations to apply to predictions.

sample_new_groups : bool = False

Whether to sample new group levels. Default is False.

Returns

: DataFrame

A DataFrame containing the conditional adjusted predictions with summary statistics.

Raises

ValueError

If any prob value is not between 0 and 1.