BaseValidateMMM.predict#
- BaseValidateMMM.predict(X=None, extend_idata=True, **kwargs)#
Use a 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:
- Xarray_like |
array
,shape
(n_pred
,n_features
) The input data used for prediction. If scikit-learn is available, array-like, otherwise array.
- extend_idata
Boolean
Determine whether the predictions should be added to inference data object. Defaults to True.
- **kwargs: Additional arguments to pass to sample_posterior_predictive method
- Xarray_like |
- Returns:
ndarray
,shape
(n_pred,)Predicted output corresponding to input X.
Examples
>>> model = MyModel() >>> idata = model.fit(X,y) >>> x_pred = [] >>> prediction_data = pd.DataFrame({'input':x_pred}) >>> pred_mean = model.predict(prediction_data)