ML | Log loss and root mean square error

Log Loss

This is a scoring measure to test the effectiveness of the classification model. It measures the amount of discrepancy between the predicted probability and the actual label. The lower the loss value in the log, the higher the perfection of the model. For an ideal model, log log = 0. For example, since the precision is — this is the number of correct predictions, ie the prediction that corresponds to the actual label, the Log Loss value — it is a measure of the uncertainty of our projected labels based on how it differs from the actual label.

 where,  N:  no. of samples.  M:  no. of attributes.  y  ij :  indicates whether i  th  sample belongs to j  th  class or not.  p  ij :  indicates probability of i  th  sample belonging to j  th  class. 

LogLoss implementation using sklearn

Mean square error

This is simply the mean squared difference between the original and predicted values.

RMS error implementation using sklearn

from sklearn.metrics import log_loss:


LogLoss = log_loss (y_true, y_pred, eps = 1e - 15 ,

normalize = True , sample_weight < / code> = None , labels = None )

from sklearn.metrics import mean_squared_error


MSE = mean_squared_error (y_true, y_pred)

Get Solution for free from DataCamp guru