Linear regression for machine learning
Linear regression for machine learning
Here :
• Y = dependent or target variable
• X = independent variable or predictor of Y
( A linear function is simplest type of function )
Here X may be a Single feature or multiple feature representing
the problem .
( Linear regression performs the task to predict on a dependent
variable(Y) based on the given independent variable(X) )
In the figure above X is a input of a work experience and Y is an
output of salary
This regression line is best fit line for the model .
We have :
X = ( Experience ) independent variable .
Y = ( Salary ) dependent variable .
Lets assume :
There is a linear relationship between X & Y Then salary
can be predicted using
Y = ϴ1 + ϴ2X
Or
Yi = ϴ1 + ϴ2Xi
(i = 1,2,3,…..,n)
Y = labelled data
X = input training data
The model get best regression fit line by finding the best ϴ1 and
ϴ2 value
ϴ1 = intercept
ϴ2 = coefficient of X
Once we are find best ϴ1 and ϴ2 values we get the best fit line
3. Homoscedasticity:
• Across all levels of independent variable the
varience error are constant
• This indicates that the ammout of independent
variable has no impact on variece of error
• If the varience if the reciduals is not constant then
linear regrassion will not be an accurate model
There are 2 type of scedacity
4. Normality :
• The recedual should be noramlly distributes
• If residuals are not noramally distributed then linear
reggression is not a accurate model
Such that:
Y = β0 + β1 X1 + β2 X2 + ……… + βn Xn
Where :
Y = dependent variable
X1, X2, ……. ,Xn = independent variable
β0 = intercept
β1, β2,……. , βn = slopes
• the goal of this algorithm is to find the best line can
predict the values based on the independent varible
• In this regression set of records are present with X and
Y values and those values are used to learn a function
• If we want to predict value of Y from unknown X this
function cant be used
• In multiple regression we have to find value of Y so a
function is requiredhat predict continues Y in the case
of the regression given x as a independent feature