Last active
April 1, 2021 23:18
-
-
Save bkaankuguoglu/88df421aa5b2f0d0e196f8b42866e058 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score | |
def calculate_metrics(df): | |
return {'mae' : mean_absolute_error(df.value, df.prediction), | |
'rmse' : mean_squared_error(df.value, df.prediction) ** 0.5, | |
'r2' : r2_score(df.value, df.prediction)} | |
result_metrics = calculate_metrics(df_result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment