Depending on the nature of the variable we are trying to predict – that is, the target variable – we may be facing a regression or a classification problem. If the target is categorical, meaning it can only take a small number of values, then we have a classification problem. Examples of classification problems include the following:
- Cancer detection: A practitioner looking at medical imagery and deciding whether a tumor is cancerous or benign is actually performing classification with two classes (cancer or not cancer).
- Spam detection: This is another example of a two-class classification problem (an email is either spam or it is not).
- Sentiment analysis: When trying to determine whether a comment was positive, negative, or neutral, we are performing classification into three classes.
- Hand-written digit classification: Here, the target value is between 0 and 9, and we have 10 possible classes.
A regression problem is different by...