Linear Regression
Linear Regression
Linear Regression
- Rahul Kendre
○
● Global minima: It is a point that obtains the absolute lowest value of our function
● Learning Rate: It determines the size of the steps that are taken by the gradient
descent algorithm
● If α (Learning Rate) is very small, it would take a long time to converge and
become computationally expensive.
● If α is large, it may fail to converge and overshoot the minimum.
● The most commonly used rates are : 0.001, 0.003, 0.01, 0.03, 0.1, 0.3.
1. Linearity:
Relationship between the independent and dependent variables to be linear
1.1 How to check Linearity:
1. Coefficient of correlation
2. Scatter Plot
3. Correlation matrix
1.2 How to Handle Linearity if get violated:
Apply a nonlinear transformation to the independent and/or dependent
variable
1. Log transformation
2. Square root transformation
3. Reciprocal transformation
● Y = M1X1 + M2X2 + C
2. Kolmogorov-Smirnov test
3. D'Agostino's K-squared test
❖ Disadvantages:
1. If the independent features are correlated it may affect performance.
2. it is only efficient for linear data(High Corr between x and Y)
3. Sometimes a lot of feature engineering is required.
4. Scaling is Required: predictors have a mean of 0.
5. It is often quite prone to noise and overfitting.
6. It is sensitive to missing values.
7. It is sensitive to Outliers
❖ Applications:
1. Forecasting the data
2. Analyzing the time series
3. Price Prediction
4. Salary Prediction
❖ Evaluation Metrics for Linear Regression:
1. Mean Absolute Error(MAE): It is most Robust to outliers.
2. Mean Squared Error(MSE)
3. Root Mean Squared Error(RMSE)
4. R-squared or Coefficient of Determination:
a. SSE(Sum of Squared Error
b. SSR(Sum of Squares due to Regression)
c. SST(Sum of Squares Total or Total Error)
5. Adjusted R Squared