Skip to content

GT0096/Linear-Regression

Repository files navigation

Linear-Regression

Content:

A) Project B) About Linear Regression. C) Steps Applied in linear regression modeling D) Metrics used for Evaluating model. E) Library Used.

A) Project:

In this Project I have used linear regression to predict the percentage of a student based on the no. of study hours.

B) About Linear Regression.

In linear regression we are provided with dependent (Y) and independent (X) variables, we have to find the function which describes relationship between dependent and independent variables. Linear relationship can be described with following equation

π‘Œ=π‘šπ‘‹+𝑐

Here, Y is the dependent variable we are trying to predict.

X is the independent variable we are using to make predictions.

m is the slop of the regression line which represents the effect X has on Y

c is a constant, known as the Y-intercept. If X = 0,Y would be equal to c.

Furthermore, the linear relationship can be positive or negative in natuer.

C) Steps Applied in linear regression modeling:

The following steps are applied in linear regression modeling in industry:

  1. Missing value and outlier treatment

  2. Correlation check of independent variables

  3. Train and test random classification

  4. Fit the model on train data

  5. Evaluate model on test data

D) Metrics Used for Evaluating Model:

various Metrics can be used for Evaluating models. I used metrics given below.

  1. Mean Squared Error. ( for this model MSE= 22.96) (https://towardsdatascience.com/understanding-the-3-most-common-loss-functions-for-machine-learning-regression-23e0ef3e14d3)
  2. R Squared. (for this model r2_score=0.956) (https://www.geeksforgeeks.org/python-coefficient-of-determination-r2-score/)

E) Library Used:

  1. Pandas
  2. Numpy
  3. Sci-Kit Learn.
  4. matplotlib.

About

Linear Regression model

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published