Supervised learning is a machine learning technique that involves training on labeled datasets. In this context, the target variable (also known as the label or response variable) is the variable the model aims to predict during training. Each training sample consists of a set of features and a corresponding label, and the model's task is to learn the relationship between features and labels to make accurate predictions on new, unlabeled data in the future.
For example, if we are building a spam email detection system, our dataset may include many email texts (features) and an indicator of whether each email is spam (the target variable). In this case, the target variable is a binary variable, typically represented by 0 and 1, where 1 may represent 'spam' and 0 represents 'not spam'. The training objective of the model is to accurately learn which feature combinations indicate that an email is spam.
By using this supervised learning approach, we can build a model that, upon receiving new emails, can predict whether an email is spam based on the learned relationship between features and labels.