Classification and Regression
It's a summer break and your teacher has given you a project which is to be submitted as school reopens.And as usual you won't touch the project until your vacation is about to end.Don't worry I was the same kind of guy. You open your diary where the project details were written and was amazed to see that you have to do two sub tasks for your project . Your teacher has given you data of about 50 people with their heights (in meters) and weights (in kgs) and first task is to find Body Mass Index and second task is to divide those 50 people into groups of Underweight, Healthy weight, Overweight and Obesity.
You google, what is BMI and how to calculate it and you find :
Body Mass Index (BMI) is a screening tool for overweight and obesity.
BMI is a person’s weight in kilograms divided by the square of height in meters. A high BMI can indicate high body fatness. If your BMI :
- less than 18.5, it falls within the underweight range.
- lies in 18.5 to <25, it falls within the healthy weight range.
- lies in 25.0 to <30, it falls within the overweight range.
- is 30.0 or higher, it falls within the obesity range.
After knowing the relation to find the BMI, now you got somewhat comfortable that it is possible to do project and you start doing it.
Firstly you find the BMI of all 50 people provided to you simply by putting value in the formula of BMI
Now Second task is to classify them into four classes namely Underweight, Overweight, Healthy weight and Obesity. You classified them by using the threshold values you have. If BMI comes out to be less than 18.5 person is underweight , if BMI is between 18.5 and 25 then person healthy , BMI is above 25 and below 30 ,then person is overweight and person with BMI greater than 30 is known to be Obese.
Tadahhhhhh....!!!!! Project done.Sounds good
Hey wait you know what ,you unknowingly learnt and implemented a very simple version of Regression and Classification task of Machine Learning. Easy right??? Absolutely yes...!!!The first task of finding BMI is same as Regression and task of finding classes is same as Classification .
- Regression task is used to predict a continuous quantity.
- Classification task is used to predict classes/labels.
In our summer project we were knowing the relation and threshold of BMI and different classes so we easily found out the answers. But now let's say you have to make such a model which will tell you if a person is overweight or underweight or obese based on the data of height , weight which are features and corresponding class is given to you to train the model. If model is perfectly trained ,it will be able to find the pattern ,relation in the data on it's own and come up with the magic function "f" to which if we give some features of height and weight it will tell us the class to which person belongs. This is a Classification Model.
Similarly now if we train our model to predict the BMI index using the features height and weight ,it is called Regression Model
References:
Comments
Post a Comment