The evaluation of a model is one of the most important steps in the Machine Learning process, since it will let us know how good our model is, how much it has learned from the training sample (train
) and how it will perform for never-before-seen or new data (test
and/or validation
).
To evaluate a model, there are certain sets of metrics that are distinguished according to whether a model allows classification or regression.
A classification model is used to predict a category or the class of an observation. For example, we might have a model that predicts whether an email is spam (1) or not spam (0), or whether an image contains a dog, a cat, or a bird. Classification models are useful when the output variable is categorical.
Metrics that can be applied to these types of models are as follows:
A regression model is used to predict a continuous value. For example, we might have a regression model that predicts the price of a house based on characteristics such as its size, number of bedrooms, and location. Regression models are useful when the output variable is continuous and numeric.
Metrics that can be applied to this type of model are as follows:
The scikit-learn
package makes it easy to apply these functions to models. The documentation is available here.