DOCUMENTATION ON LINEAR REGRESSION

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.


Steps to train a model on linear regression  using python:

  1. import necessary library.
  2. Data Pre-processing(using the functions such as df.head,df,info and making histograms and plots).
  3. Fitting the Simple Linear Regression to the Training  and Testing Set by dividing it.
  4. Prediction of test result(output).
  5. visualizing the Training set results.


Rupal Garg (2019-2023)

Computer Science Department
KIET Group of Institutions

Comments

Popular posts from this blog

QUANTUM STORAGE & MEMORY

Biofuel generation with the help of Bioinformatics

PHISHING ATTACKS IN INDIA