pyxpcm.pcm.predict

pcm.predict(self, ds, features=None, dim=None, inplace=False, name='PCM_LABELS')[source]

Predict labels for profile samples

This method add these properties to the PCM object:

  • 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 using xarray.DataArray attributes ‘feature_name’.

dim: str

Name of the vertical dimension in the input xarray.Dataset

inplace: boolean, False by default

If False, return a xarray.DataArray with predicted labels If True, return the input xarray.Dataset with labels added as a new xarray.DataArray

name: str, default is ‘PCM_LABELS’

Name of the xarray.DataArray with labels

Returns:
xarray.DataArray

Component labels (if option ‘inplace’ = False)

or
xarray.Dataset

Input dataset with Component labels as a ‘PCM_LABELS’ new xarray.DataArray (if option ‘inplace’ = True)