Machine learning metrics

Choosing the wrong metric will make it very difficult to evaluate performance and, as a result, improve our model. Therefore, it is very important to choose the right metric. Let's take a look at the following machine learning metrics:

  • Accuracy: The simplest evaluation metric is accuracy. Accuracy measures the difference between the predicted value and the actual value. This metric is easy to interpret and communicate; however, as we mentioned earlier, it doesn't measure performance well when used to evaluate a highly unbalanced target variable, for example.
  • Confusion Matrix: The confusion matrix provides a convenient way to display classification accuracy along with Type I and Type II errors. The combined view of these four related metrics can be especially informative in deciding where to focus our efforts during the tuning process. It can also help mark cases where other metrics may be more helpful. When there are too many values in the majority class, then a metric that is designed for use with class imbalances, such as log-loss, should be employed.
  • Mean Absolute Error (MAE): This metric takes the difference between the predicted value and the actual value and calculates the mean value of these errors. This metric is simple to interpret and is useful when there is no need to apply an additional penalty to large errors. If an error that is three times larger than another error is three times as bad, then this is a good metric to use. However, there are many cases where an error that is three times larger than another error is much more than three times as bad, and this results in adding an additional penalty, which can be accomplished with the next metric.
  • RMSE: This metric takes the square of the error for every prediction, the difference between the predicted value and the actual value, sums these squared errors, and then takes the square root of the sums. In this case, if the squaring has even a few highly inaccurate predictions, it will result in a sizable penalty and a higher value on this error metric. We can see how this would help in our preceding example and why we have chosen to use RMSE. This metric is used for regression.
  • Area Under the Curve (AUC): The AUC refers to the Area under the Receiver-Operator Curve. In this model, your target variable needs to be a value expressing the confidence or probability that a row belongs to the positive or negative target condition. To make this more concrete, AUC can be used when your task is to predict how likely someone is to make a given purchase. Clearly, from this explanation, we can see that AUC is a metric for classification.
  • Logarithmic Loss (Log-Loss): The log-loss evaluation metric rewards confident predictions more than AUC and penalizes neutral predictions. This is important when we have an imbalanced target dataset and finding the minority class is critical. Having an extra penalty on incorrect guesses helps us get to the model that better predicts these minority class members correctly. Log-loss is also better for multiclass models where the target variable is not binary.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset