DOCUMENTATION ON LINEAR REGRESSION
Linear Regression |
Linear Regression is the simplest algorithm . Linear Regression is basically modelled using a straight line . It is used with continous variable to predict values . It is illustrated by the equation : y= a0+a1x+ ε
This equation tells us the relationship b/w the two variables i.e x and y. y depends on the value of x .
and where,a0 is the intercept ,a1 is Linear regression coefficient and ε = random error.
Types
Positive and Negative Linear Relationship:
In Positive linear relationship, if y increases then x increases.
In Negative linear relationship, if y decreases then x decreases.
Our main aim in this regression is to find the best fitted line . So, basically there are three common evolution metrics to find that :
- Mean Absolute Error
- Mean Squared Error
- Root Mean Squared Error
Linear regression is furture categorized into two types of the algorithm:
Simple Linear Regression:
If only one variable(i.e independent variable is x) is used to conclude the value from a dependent variable.
Multiple Linear regression:
If more than one variable(eg : x ,z ) is used to conclude the answer of a dependent variable, then it is called Multiple Linear Regression.
- import necessary library.
- Data Pre-processing(using the functions such as df.head,df,info and making histograms and plots).
- Fitting the Simple Linear Regression to the Training and Testing Set by dividing it.
- Prediction of test result(output).
- visualizing the Training set results.
Comments
Post a Comment