MMM.predict#

MMM.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_pred (array-like if sklearn is available, otherwise array, shape (n_pred, n_features)) – The input data used for prediction.

  • extend_idata (Boolean 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_pred – Predicted output corresponding to input X_pred.

Return type:

ndarray, shape (n_pred,)

Examples

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