- CountResults.get_prediction(exog=None, transform=True, which='mean', linear=None, row_labels=None, average=False, agg_weights=None, y_values=None, **kwargs)¶
Compute prediction results when endpoint transformation is valid.
The values for which you want to predict.
If the model was fit via a formula, do you want to pass exog through the formula. Default is True. E.g., if you fit a model y ~ log(x1) + log(x2), and transform is True, then you can pass a data structure that contains x1 and x2 in their original form. Otherwise, you’d need to log the data first.
Which statistic is to be predicted. Default is “mean”. The available statistics and options depend on the model. see the model.predict docstring
Linear has been replaced by the which keyword and will be deprecated. If linear is True, then which is ignored and the linear prediction is returned.
If row_lables are provided, then they will replace the generated labels.
If average is True, then the mean prediction is computed, that is, predictions are computed for individual exog and then the average over observation is used. If average is False, then the results are the predictions for all observations, i.e. same length as
Aggregation weights, only used if average is True. The weights are not normalized.
Some predictive statistics like which=”prob” are computed at values of the response variable. If y_values is not None, then it will be used instead of the default set of y_values.
which="prob"for count models currently computes the pmf for all y=k up to max(endog). This can be a large array if the observed endog values are large. This will likely change so that the set of y_values will be chosen to limit the array size.
Some models can take additional keyword arguments, such as offset, exposure or additional exog in multi-part models like zero inflated models. See the predict method of the model for the details.
The prediction results instance contains prediction and prediction variance and can on demand calculate confidence intervals and summary dataframe for the prediction.
Status: new in 0.14, experimental