Chapter 10. Evaluating Classifiers, Regressors, and Clusters

In this chapter, we will cover the following recipes:

  • Getting classification straight with the confusion matrix
  • Computing precision, recall, and F1-score
  • Examining a receiver operating characteristic and the area under a curve
  • Visualizing the goodness of fit
  • Computing MSE and median absolute error
  • Evaluating clusters with the mean silhouette coefficient
  • Comparing results with a dummy classifier
  • Determining MAPE and MPE
  • Comparing with a dummy regressor
  • Calculating the mean absolute error and the residual sum of squares
  • Examining the kappa of classification
  • Taking a look at the Matthews correlation coefficient

Introduction

Evaluating classifiers, regressors, and clusters is a critical multidimensional problem involving many aspects. Purely from an engineering perspective, we worry about speed, memory, and correctness. Under some circumstances, speed is everything. If memory is scarce, of course, we have to make that our priority. The world is a giant labyrinth full of choices, and you are sometimes forced to choose one model over others instead of using multiple models in an ensemble. We should, of course, inform our rational decision with appropriate evaluation metrics.

There are so many evaluation metrics out there that you would need multiple books to describe them all. Obviously, many of the metrics are very similar. Some of them are accepted and popular, and of those metrics, some are implemented in scikit-learn.

We will evaluate the classifiers and regressors from Chapter 9, Ensemble Learning and Dimensionality Reduction. We applied those estimators to the sample problem of weather forecasting. This is not necessarily a problem at which humans are good. Achieving human performance is the goal for some problems, such as face recognition, character recognition, spam classification, and sentiment analysis. As a baseline to beat, we often choose some form of random guessing.

..................Content has been hidden....................

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