Skip to main content

Simple Linear Regression

Simple Linear Regression:


Linear Regression: The relationship between variables such that it forms a straight line.
The Relation that defines linearity in the data is called Co-relation.

Co-Relation:
The correlation in three forms i.e
a)Positive correlation
b)Negative correlation
c)No correlation

What is Linear Regression:
It is all about getting the best fit line that supports linearity in the data is called Linear Regression.
                                            "WHAT IS BEST FIT LINE"?
                                           "HOW TO IDENTIFY BEST FIT LINE"?
  • By using the Pearson correlation coefficient -Allows us to create a basic ideal line
  • Using the error function & Gradient Descent to get a line that has the least error possible.
Now the question is how we identify the line is best-fit?
By using an error function("The Function that holds the difference between actual and predicted value").
  • Mean Squared  Error(MSE)
  • Mean Absolute Error(MAE)
  • Root Mean Squared Error(RMSE)
  • R2_score
                               "Which Error function we have to use"
The main intuition of an error function is to calculate the Low error.
Here we are seeing different  error functions which one we have used
  • we can use any error function it's our wish.
  • In terms of computation time use MAE(mean absolute error) because it takes less time.
for example, if we compared MSE with RMSE, Root Mean Squared Error it takes more time because it is squaring the MSE value so it takes more time while compilation.

FORMULAE FOR LINEAR REGRESSION IS 
                                                            "Y=MX+C"
For code, part visit my GitHubclick here








Comments

Popular posts from this blog

Loss Functions | MSE | MAE | RMSE

            Performance Metrics The various metrics used to evaluate the results of the prediction are : Mean Squared Error(MSE) Mean Absolute error(MAE) Root-Mean-Squared-Error(RMSE) Adjusted R² Mean Squared Error: Mean Squared error is one of the most used metrics for regression tasks. MSE is simply the average of the squared difference between the target value and value predicted by the regression model.  As it squares the differences and  penalizes (punish)even a small error which leads to over-estimation of how bad the model is. It is preferred more than other metrics because it is differentiable and hence can be optimized better. in the above formulae, y=actual value and ( yhat) means predicted value by the model. RMSE(Root Mean Squared Error: This is the same as MSE (Mean Squared Error) but the root of the value is considered while determining the accuracy of the model. It is preferred more in some cases because the errors are first...

SUPPORT VECTOR MACHINE

                 SUPPORT VECTOR MACHINE:- Support vector machine:-it is a type of supervised learning algorithm it is used to solve both classification and regression problem. Note :- It is mostly used for classification problems. what we are going to learn in SVM: a) Support vectors b) Hyperplane c) Marginal Distance d) Linear Separable e) Non-linear separable f) support kernels NOw we will discuss everything in detail. Hyper plane:- in the above diagram, we have drawn three lines(A, B, C) separating two data points (stars and reds) The lines (A, B, C) are called Hyperplanes. Note:- “Select the hyper-plane which segregates the two classes better” i.e  above there are three hyperplanes how to select the best hyperplane? b)Marginal Distance:- When we draw a hyperplane the plane creates two new(------) dotted lines one line above the hyperplane and one line below the hyperplane line. see the below image you will get an ...

Multi Linear Regression

                                 MULTI LINEAR REGRESSION Before going into MULTI LINEAR REGRESSION first look into Linear Regression. LINEAR REGRESSION:-It is all about getting the best line for the given data that supports linearity. for Linear regression please check my previous post. In Linear regression, we have only one independent variable and one dependent variable. In Multilinear Regression, we have more than one independent variable and one dependent variable. This is the main difference between Multilinear regression and Linear regression. Formulae for Linear regression and Multilinear Regression is listed below: Evaluation metrics for Multi-linear Regression problems are: a)Mean Absolute error b)Mean Squared error c)Root Mean Squared Error d)..... For Evaluation metrics I had posted another post please check it. For the code part please check my Github In ...