Regression Algorithms-1 Notes – Class 12 Data Science (844)
In this Regression Algorithms-1 Notes, You learn Linear Regression, Mean Absolute Error(MAE), and Root Mean Square Deviation (RMSD). This is designed for Class 12 DS students and based on latest CBSE curriculum.
Introduction to Linear Regression
- Linear Regression is a method used to explain the relationship between a dependent variable (Y) and an independent variable (X).
- The dependent variable (Y) is the target variable whose value is predicted, while the independent variable (X) is the variable whose value is used to make the prediction.
- Regression is the process of predicting the value of the dependent variable.
- Linear Regression is called “linear” because the relationship between the dependent and independent variables is represented by a linear function. Regression methods that do not use a linear function are called non-linear regression models.
- The value of the independent variable can be chosen freely, and the dependent variable changes according to it. Linear Regression helps predict how much this change (adjustment) will be.
- The relationship between the dependent and independent variables can be positive, negative, or zero, depending on how the variables are related.
- Linear Regression is mainly used for two purposes:
- To determine the nature and strength of the relationship between two variables.
- To predict the value of the dependent variable for a given value of the independent variable.
- Linear Regression finds the “line of best fit” that best represents the relationship between the data points in a scatter plot.
- Once the line of best fit is obtained, it helps identify the relationship between the variables and predict the value of the dependent variable for any given value of the independent variable.
- The equation of Simple Linear Regression is:
Y = mX + b
where:- Y = Dependent Variable
- X = Independent Variable
- m = Slope
- b = Intercept
Mean Absolute Error (MAE)
- The main objective of Linear Regression is to minimize the vertical distance between the line of best fit and the actual data points. This process is called fitting the line to the data.
- Mean Absolute Error (MAE) is used to find the line of best fit by measuring the deviation of the predicted values from the actual data points and minimizing it.
- In a Linear Regression graph, the red dots represent the observed values, the blue line represents the line of best fit, and the green lines represent the errors (or residuals).
- Mean Absolute Error (MAE) measures the average magnitude of the errors in a set of predictions without considering their direction.
Root Mean Square Deviation (RMSD)
- Root Mean Square Deviation (RMSD) is used to determine how close the observed data points are to the values predicted by the model.
- Mathematically, RMSD is the square root of the variance of the residuals.
- A small RMSD value indicates that the model is a better fit to the data and produces more accurate predictions.
- A large RMSD value indicates that the model is not a good fit to the data and may need to be retrained.
- The acceptable value of RMSD depends on the dataset and the level of accuracy required. For example, an RMSD of 1 cm may not be important in building construction but can be very significant when designing a precision tool.