Professional Documents
Culture Documents
RV College of Engineering: Supervised Learning-Regression
RV College of Engineering: Supervised Learning-Regression
RV College of world
Engineering
Improvi
Chapter 8
Supervised Learning- Regression
7/11/2022 1
Go, change the
RV College of
Engineering Introduction world
7/11/2022 2
Go, change the
RV College of
Engineering Introduction world
7/11/2022 3
Go, change the
RV College of
Engineering Introduction world
Slope = ??
7/11/2022 4
Go, change the
RV College of
Engineering Introduction world
types of slopes
Lin ea r positiv e slope
Cu r v e lin ea r positiv e slope
Lin ea r n eg a tiv e slope
Cu r v e lin ea r n eg a tiv e slope
7/11/2022 5
Go, change the
RV College of
Engineering Introduction world
7/11/2022 6
Go, change the
RV College of
Engineering Introduction world
7/11/2022 7
Go, change the
Multiple Linear Regression
RV College of
Engineering
world
In a multiple regression model, two or more independent variables, i.e. predictors are involved in
the model
The simple linear regression model and the multiple regression model assume that the dependent variable
is continuous.
The following expression describes the equation involving the relationship with two predictor variables,
namely X and X .
The model describes a plane in the three-dimensional space of Ŷ, X , and X . Parameter ‘a’ is the
intercept of this plane. Parameters ‘b ’ and ‘b ’ are referred to as partial regression coefficients.
Parameter b represents the change in the mean response corresponding to a unit change in X1 when
X2 is held constant. Parameter b represents the change in the mean response corresponding to a unit
change in X2 when X1 is held constant.
7/11/2022 8
Go, change the
Multiple Linear Regression
RV College of
Engineering
world
7/11/2022 9
Go, change the
Multiple Linear Regression
RV College of
Engineering
world
Main Problems in Regression Analysis In multiple regressions, there are two primary problems:
multicollinearity and heteroscedasticity
Multicollinearity
Two variables are perfectly collinear if there is an exact linear relationship between them. Multicollinearity is the
situation in which the degree of correlation is not only between the dependent variable and the independent
variable, but there is also a strong correlation within (among) the independent variables themselves.
but it is difficult for us to determine how the dependent variable will change if each independent variable is changed
one at a time. When multicollinearity is present, it increases the standard errors of the coefficients. By overinflating the
standard errors, multicollinearity tries to make some variables statistically insignificant when they actually should be
significant (with lower standard errors). One way to gauge multicollinearity is to calculate the Variance Inflation Factor
(VIF), which assesses how much the variance of an estimated regression coefficient increases if the predictors are
correlated. If no factors are correlated, the VIFs will be equal to 1.
7/11/2022 10
Go, change the
Multiple Linear Regression
RV College of
Engineering
world
Heteroskedasticity
Heteroskedasticity refers to the changing variance of the error term.
If the variance of the error term is not constant across data sets, there will be erroneous predictions.
In general, for a regression equation to make accurate predictions, the error term should be independent,
identically (normally) distributed (iid).
7/11/2022 11
Go, change the
Multiple Linear Regression
RV College of
Engineering
world
Regularization is a technique to penalize the high-value regression coefficient. In other words, we can say
that it reduces the values of the coefficient thereby simplifying the model.
in regularization, we keep the same number of features but reduces the magnitude of the coefficient (W0,
W1,.……, Wm).
The ridge regression by default adds the L2 regularization penalty i.e. it adds the square of the magnitude
of the coefficient to the loss function. So the loss function changes to the following equation.
Minimization objective of ridge = LS Obj + α × (sum of square of coefficients)
The lasso regression by default adds the L1 regularization penalty i.e. it adds the absolute value of the
magnitude of the coefficient to the loss function. So the loss function changes to the following equation.
Minimization objective of lasso = LS Obj + α × (absolute value of the magnitude of coefficients)
7/11/2022 12
Go, change the
Multiple Linear Regression
RV College of
Engineering
world
The lasso overcomes this disadvantage by forcing some of the coefficients to zero value. We can
say that the lasso yields sparse models (involving only subset) that are simpler as well as more
interpretable. The lasso can be expected to perform better in a setting where a relatively small
number of predictors have substantial coefficients, and the remaining predictors have
coefficients that are very small or equal to zero.
7/11/2022 13
Go, change the
RV College of
Engineering
Polynomial Regression Model world
7/11/2022 14
RV College of Go, change the
Engineering
Logistic Regression world
Logistic regression (logit regression) is a type of regression analysis used for predicting the outcome of a categorical
dependent variable similar to OLS regression. In logistic regression, dependent variable (Y) is binary (0,1) and
independent variables (X) are continuous in nature.
The goal of logistic regression is to predict the likelihood that Y is equal to 1 (probability that Y = 1 rather than 0)
given certain values of X. So, we are predicting probabilities rather than the scores of the dependent
variable.
logit function is the natural log of the odds that Y equals one of the categories.
7/11/2022 15
RV College of Go, change the
Engineering
Logistic Regression world
Let us say we have a model that can predict whether a person is male or female on the basis of
their height. Given a height of 150 cm, we need to predict whether the person is male or female.
We know that the coefficients of a = −100 and b = 0.6. Using the above equation, we can calculate the
probability of male given a height of 150 cm or more formally P(male|height = 150).
7/11/2022 16
RV College of Go, change the
Engineering
Logistic Regression world
7/11/2022 17
Go, change the
RV College of
Engineering Maximum Likelihood Estimation world
The coefficients in a logistic regression are estimated using a process called Maximum
Likelihood Estimation (MLE).
what is likelihood function
he likelihood function measures the goodness of fit of a statistical model to a sample of data for
given values of the unknown parameters.
MLE is about predicting the value for the parameters that maximizes the likelihood function.
7/11/2022 18