pyxpcm.pcm.predict_proba¶
-
pcm.predict_proba(self, ds, features=None, dim=None, inplace=False, name='PCM_POST', classdimname='pcm_class')[source]¶ Predict posterior probability of each components given the data
This method adds these properties to the PCM instance:
llh: The log likelihood of the model with regard to new data
Parameters: - ds: :class:`xarray.Dataset`
The dataset to work with
- features: dict()
Definitions of PCM features in the input
xarray.Dataset. If not specified or set to None, features are identified usingxarray.DataArrayattributes ‘feature_name’.- dim: str
Name of the vertical dimension in the input
xarray.Dataset- inplace: boolean, False by default
If False, return a
xarray.DataArraywith predicted probabilities If True, return the inputxarray.Datasetwith probabilities added as a newxarray.DataArray- name: str, default is ‘PCM_POST’
Name of the DataArray with prediction probability (posteriors)
- classdimname: str, default is ‘pcm_class’
Name of the dimension holding classes
Returns: xarray.DataArrayProbability of each Gaussian (state) in the model given each sample (if option ‘inplace’ = False)
- or
xarray.DatasetInput dataset with Component Probability as a ‘PCM_POST’ new
xarray.DataArray(if option ‘inplace’ = True)