A) Project B) About Linear Regression. C) Steps Applied in linear regression modeling D) Metrics used for Evaluating model. E) Library Used.
In this Project I have used linear regression to predict the percentage of a student based on the no. of study hours.
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.
The following steps are applied in linear regression modeling in industry:
-
Missing value and outlier treatment
-
Correlation check of independent variables
-
Train and test random classification
-
Fit the model on train data
-
Evaluate model on test data
various Metrics can be used for Evaluating models. I used metrics given below.
- Mean Squared Error. ( for this model MSE= 22.96) (https://towardsdatascience.com/understanding-the-3-most-common-loss-functions-for-machine-learning-regression-23e0ef3e14d3)
- R Squared. (for this model r2_score=0.956) (https://www.geeksforgeeks.org/python-coefficient-of-determination-r2-score/)
- Pandas
- Numpy
- Sci-Kit Learn.
- matplotlib.