Metrics

In this lesson, learn about some of the most commonly used metrics in the Machine Learning task.

What are metric?

Metrics are crucial for Machine Learning tasks. When you define a Machine Learning task, you should define what kind of metrics you would look at. Evaluating the performance of your Machine Learning model is quite important. Without metrics, you don’t know how good or how bad your model is performing. To make matters worse, choosing the wrong metrics can lead you in the wrong direction.

Therefore, it is very important to define a good evaluation index for a Machine Learning task.

For supervised learning, we usually have some recognized metrics. For classification and regression problems, the metrics are different. Even for the same type of tasks, such as classification tasks, there are many metrics to choose from, such as F1-score, AUC, accuracy, and so on. Some metrics are generic, and some can only be used in certain scenarios.

For unsupervised learning, the situation is a little more complicated, and for different tasks, the metrics vary greatly. For example, there are many metrics for clustering, but they are not as universal as those in supervised learning.

sklearn provides a lot of functions that cover many kinds of tasks and scenarios.

Notice: In the following examples, we use logistic regression and linear regression models to demonstrate our models. You can ignore how these models are trained, at the moment. This is explained in the upcoming chapters.

Get hands-on with 1400+ tech skills courses.