Skip to content

Instantly share code, notes, and snippets.

@MariaLavrovskaya
Last active June 19, 2019 11:38
Show Gist options
  • Save MariaLavrovskaya/d714a90310674cac26ed9914d1fd62d8 to your computer and use it in GitHub Desktop.
Save MariaLavrovskaya/d714a90310674cac26ed9914d1fd62d8 to your computer and use it in GitHub Desktop.
#Slope for every predictor
df = pd.DataFrame({'Actual': Y_test.values.flatten(), 'Predicted': y_pred.flatten()})
df.head(25)
from sklearn.metrics import mean_squared_error, median_squared_error, r2_score
print("Mean squared error: %.2f"
% mean_squared_error(Y_test, y_pred))
print("Median squared error: %.2f"
% median_squared_error(Y_test, y_pred))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment