GaussianMixture.score_samples

GaussianMixture.score_samples(data)[source]

Computes the negative log-likelihood (NLL) of each of the provided datapoints.

Parameters:

data (Union[ndarray[Any, dtype[float32]], Tensor]) -- The datapoints for which to compute the NLL.

Return type:

Tensor

Returns:

A tensor of shape [num_datapoints] with the NLL for each datapoint.

Attention

When calling this function in a multi-process environment, each process receives only a subset of the predictions. If you want to aggregate predictions, make sure to gather the values returned from this method.