Performance evaluation and model selection
Analysis of performance is very important for any analytics and machine learning processes. It also helps in model selection. There are several evaluation metrics that can be leveraged on ML models. The technique depends on the type of data problem being handled, the algorithms used in the process, and also the way the analyst wants to gauge the success of the predictions or the results of the analytics process.
Getting ready
To get ready, the MLBase
library has to be installed and imported. So, as we already installed it for theĀ Preprocessing recipe, we don't need to install it again. Instead, we can directly import it using theĀ using MLBase
command.
How to do it...
Firstly, the predictions and the ground truths need to be defined in order to evaluate the accuracy and performance of a machine learning model or an algorithm. They can take a simple form of a Julia array. This is how they can be defined:
truths = [1, 2, 2, 4, 4, 3, 3, 3, 1] pred = ...