Linear Regression
Linear Regression
Introduction
Why should we learn Linear Regression
&
How are companies using it??
Why to Learn this Model?
• Provides foundation to predictive modelling.
• How to fit a model on the data?
• How predictive modelling works?
• Helps in creating a foundation for advanced concepts of Deep Learning or
Neural Network
• Easy to understand and interpret
• Served as a benchmark and its performance can be compared againt
advanced algorithms.
• Creates a basic foundation for Loss function, regularization and Gradient
Descent.
Basics of Linear Regression
• Models relationship between dependent variable Y, and one or more
independent X variables.
Equation for that would be
Y=β0+β1X+ϵ. (Simple Linear Regression)
Y=β0+β1X1+β2X2+...+βnXn+ϵ.(Multiple Linear Regression)
• What are these β0 and β1?
β this is the coefficient
• Intercept (0β0): The expected mean value of Y when all X are 0.
• Example: In a simple linear regression model like Y=β0+β1X, if β0is 5,
it means when X is 0, the expected value of Y is 5.
• Slope Coefficients (β1,β2,...,βn):Slope coefficients represent the
expected change in the dependent variable (Y) for a one-unit change in
an independent variable, assuming all other variables remain constant.
• Multiple Variables: In multiple linear regression, each independent
variable Xihas its own slope coefficient βi. This coefficient tells you
how much Y changes for a unit change in Xi, holding other variables
constant
• Positive and Negative Slopes:
• A positive slope (βi>0) indicates that as Xiincreases, Y also increases.
• A negative slope (βi<0) indicates that as Xiincreases, Y decreases.
• Example: In a model like β0+β1X1+β2X2, if β1is 3, it suggests that for
each one-unit increase in X1, Y increases by 3 units, assuming X2
remains constant.
• It's crucial to interpret these coefficients in the context of the data. For
example, in a regression model predicting house prices (Y), the slope
coefficient for the size of the house (X1) might tell you how much the
price is expected to increase for each additional square foot.
• Error Term (ϵ):Represents the difference between the observed
values and the predicted values. It accounts for the variability in Y that
cannot be explained by X.
Assumptions of Linear Regression