L4a - Supervised Learning
L4a - Supervised Learning
• In Regression, we plot a graph between the variables which best fits the given
datapoints, using this plot, the machine learning model can make predictions
about the data.
• In simple words, "Regression shows a line or curve that passes through all
the datapoints on target-predictor graph in such a way that the vertical
distance between the datapoints and the regression line is minimum."
• The distance between datapoints and line tells whether a model has captured
a strong relationship or not.
• Some examples of regression can be as:
– Prediction of rain using temperature and other factors
– Determining Market trends
– Prediction of road accidents due to rash driving.
Example 1: Regression
• Suppose there is a marketing company A, who does various advertisement
every year and get sales on that. The below list shows the advertisement
made by the company in the last 5 years and the corresponding sales:
• It uses the concept of threshold levels, values above the threshold level
are rounded up to 1, and values below the threshold level are rounded
up to 0.
Logistic Regression Equation:
• The Logistic regression equation can be obtained from the Linear
Regression equation.
• The mathematical steps to get Logistic Regression equations are given
below:
• We know the equation of the straight line can be written as:
y= b0+b1x1+ b2x2+ b3x3+...... Bnxn
• In Logistic Regression y can be between 0 and 1 only, so for this let's
divide the above equation by (1-y):