Introduction to Linear Modeling in Python
Jason Vestuto
Data Scientist
Building Models:
Evaluating Models:
residuals = y_model - y_data
RSS = np.sum( np.square(residuals) )
mean_squared_residuals = np.sum( np.square(residuals) ) / len(residuals)
MSE = np.mean( np.square(residuals) )
RMSE = np.sqrt(np.mean( np.square(residuals)))
RMSE = np.std(residuals)
Deviations:
deviations = np.mean(y_data) - y_data
VAR = np.sum(np.square(deviations))
Residuals:
residuals = y_model - y_data
RSS = np.sum(np.square(residuals))
R-squared:
r_squared = 1 - (RSS / VAR)
r = correlation(y_data, y_model)
Introduction to Linear Modeling in Python