Supervised Learning
In supervised learning, we are given a data set and already know what our correct output should look like, having the idea that there is a relationship between the input and the output
Supervised learning problems are categorized into “regression” and “classification” problems.
In a regression problem, we are trying to predict results within a continuous output, meaning that we are trying to map input variables to some continuous function. The task of the Regression algorithm is to find the mapping function to map the input variable(x) to the continuous output variable(y).
Example -In weather prediction, the model is trained on the past data, and once the training is completed, it can easily predict the weather for future days.
In a classification problem, we are instead trying to predict results in a discrete output. In other words, we are trying to map input variables into discrete categories. The task of the classification algorithm is to find the mapping function to map the input(x) to the discrete output(y).
The best example to understand the Classification problem is Email Spam Detection. The model is trained on the basis of millions of emails on different parameters, and whenever it receives a new email, it identifies whether the email is spam or not. If the email is spam, then it is moved to the Spam folder.
Let's understand the difference through another example-
(a) Regression — Given a picture of a person, we have to predict their age on the basis of the given picture
(b) Classification — Given a patient with a tumor, we have to predict whether the tumor is malignant or benign.
Test question-
Given two statements, categorize each of them into regression problem or classification problem
Statement 1: You have a large inventory of identical items. You want to predict how many of these items will sell over the next 3 months.
Statement 2: You’d like the software to examine individual customer accounts, and for each account decide if it has been hacked/compromised.
Read Next -Unsupervised Learning