log_loss

pai4sk.sml_metrics.log_loss(data, proba)

Distributed logistic loss or cross-entropy loss metric. It supports both local and distributed(MPI) implementation.

This metric is a loss function often used in logistic regression. It is defined as the negative log-likelihood of the true labels given the probabilities predicted by a classifier. In the current version it is defined for two labels only. This metric is implemented in a distributed manner for MPI execution.

Parameters:
  • data (Supports the following input data-types :) –
    1. Dense matrix (ndarray) of correct labels.
    2. SnapML data partition. This includes the correct labels.
  • proba (Predicted probabilities of the two classes.) – array-like, shape = (n_samples, 2) for local implementation. array-like, shape = (n_samples,) for MPI implementation.
Returns:

loss_value – Returns the log loss of the predicted probabilities (proba) when compared with the true labels (data)

Return type:

float