MMMModelBuilder.predict#

MMMModelBuilder.predict(X_pred, extend_idata=True, **kwargs)#

Uses model to predict on unseen data and return point prediction of all the samples. The point prediction for each input row is the expected output value, computed as the mean of MCMC samples.

Parameters:
X_predarray_like if sklearn is available, otherwise array, shape (n_pred, n_features)

The input data used for prediction.

extend_idataBoolean determining whether the predictions should be added to inference data object.

Defaults to True.

**kwargs: Additional arguments to pass to sample_posterior_predictive method
Returns:
y_predndarray, shape (n_pred,)

Predicted output corresponding to input X_pred.

Examples

>>> model = MyModel()
>>> idata = model.fit(X,y)
>>> x_pred = []
>>> prediction_data = pd.DataFrame({'input':x_pred})
>>> pred_mean = model.predict(prediction_data)