Determining the mean absolute error and mean square error of the predicted vs. actual values from OLS regression analysis

Viewed 14

I was able to generate results from the OLS regression analysis I prefrormed however I am not sure how to get the absolute error and mean square error from the OLS regression summary; is it possible to get those values from OLS regression?

# importing train_test_split from sklearn
from sklearn.model_selection import train_test_split
# splitting the data
train_X, valid_X, train_y, valid_y = train_test_split(X, y, test_size = 0.3, random_state=42)
#creating the model
import statsmodels.api as sm
model = sm.OLS(y, X, missing='drop')
model_result = model.fit()
model_result.summary()
0 Answers
Related