LR-LogReg
LR-LogReg
Techniques
Presented by
Dr. J.V. Bibal Benifa
Assistant Professor (Sl. Gr),
Data Science Research Group
Indian Institute of Information Technology, Kottayam
(A National Institute of Importance, Under MoE, Govt. of India)
Presented by
Dr. J.V. Bibal Benifa
Assistant Professor (Sl. Gr),
Data Science Research Group
Indian Institute of Information Technology, Kottayam
(A National Institute of Importance, Under MoE, Govt. of India)
• Regression analysis is a
predictive modelling technique
which investigates the
relationship between
dependent (target) and indepe
ndent variable (predictor). • Significant relationships between
• Regression analysis is an dependent variable and
independent variable.
important tool for modelling
and analyzing data. • Strength of impact of
multiple independent variables on
a dependent variable.
y= a0+a1x+ ε
➢Simple & Multiple Linear Regression
The values for x and y variables are training datasets for Linear Regression model
representation.
Where,
a0 = y − a1 x N=Total number of observation
Yi = Actual value
(a1xi+a0)= Predicted value.
R = (1 N ) ( xi − x )( yi − y ) ( x y )
2
2
a1 = 0.644
x = ( i ) N
2
x − x
a0 = y − a1 x
x = 12.083
a0 = 77 − (0.644 78)
y = 11.225
a0 = 26.768
R = (1 5 ) 470 (12.083 11.225 )
2 2
^
y = 26.768 + 0.644 x R 2 = 0.48
Data Science Research Group, IIIT Kottayam
Predict the speed of a 10 years old car:
from scipy imprt stats
x = [5,7,8,7,2,17,2,9,4,11,12,9,6]
y
= [99,86,87,88,111,86,103,87,94,78,77,85,86]
slope, intercept, r, p, std_err =
stats.linregress(x, y)
def myfunc(x):
return slope * x + intercept
speed = myfunc(10)
print(speed)
R2-0.75