Train, Predict, and Evaluate a Linear Regression Model
This sequence first trains a linear regression model using the provided data, then applies the model to make predictions on that same data. The results are visualized in a scatter plot to compare actual versus predicted values. Next, the model's performance is evaluated using common error metrics, and the prediction errors for each data point are calculated and visualized, helping you understand how well the model fits the data and where it may be making mistakes.