Linear Regression

In supervised machine learning, there are generally solve two types of problems which is regression and classification. Regression is used to predict the numeric value from historical data.

In regression technique, our aim is to find the best fit line for a given data set.
Regression is two type linear regressions and multiple linear regression. In regression, we find out the linear relationship between the input variable and the target variable.





Linear Regression: Linear Regression means predicting scores of one variable from the scores of the second variable. The variable we are predicting is called the dependent variable and is referred to as Y. The variable we are basing our predictions is known as the un depended (predictor) variable and is referred to as X

In general, we find a relationship between target variable and independent variable by best fit line.
The equation of a line is as:
Y= mx + c
Here
           Y= depended variable (target variable)
          m = slope of a line (coefficient)
           x = independent variable
           c = constant

Multiple linear regressions
The above equation can be used when we have one input variable. However, in general, we usually deal with datasets which have multiple input variables. The case when we have more than one feature is known as multiple linear regressions, or simply, linear regression. We can generalize our previous equation for simple linear regression to multiple linear regressions:

Y(x) =  w0 +  w1x  + w2x  +………+Wnx

In the case of multiple linear regression, instead of our prediction is a line in 2-dimensional space, it is a hyperplane in n-dimensional space. For example, in 3D, our plot would look as follows






 The goal of the Hypothesis is to choose B0 and B1 so that Yi is close to Y for our training data while choosing B0 and B1 we have to consider the cost function( J(θ) ) where we are getting low value for cost function( J(θ) ).
The below function is called a cost function, the cost function ( J(θ) ) is nothing but just a Squared error function.


In this post its the basic introduction about the linear regression if you are interested about the detail introduction please comment us.

 Tag :
machine learning
machine learning algorithm
ml algorithm
linear regression
regression in data science
ml