Classification
Classification is one of the core concepts of data science and attempts to classify data into different classes or groups. A simple example of classification can be trying to classify a particular population of people as male and female, depending on the data provided. In this recipe, we will learn to perform score-based classification, where each class is assigned a score, and the class with the lowest or the highest score is selected depending on the problem and the analyst's choice.
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:
using MLBase
How to do it...
We will explore score-based classification algorithms and techniques by creating simple arrays and matrices that can fulfill our purpose. The first and the most important function is theÂ
classify()
function, which takes in the...