ium_444354/evaluation.py
Adrian Charkiewicz fe3110aaed added evaluation
2022-05-03 22:47:51 +02:00

21 lines
626 B
Python

import pandas as pd
import re
from sklearn import metrics
import numpy as np
f = open("result.txt", "r")
list_result, list_predicted=[],[]
for x in f:
data = x.split(' ')
result = re.findall(r'\d+', data[1])
predicted = re.findall(r'\d+', data[5])
result=int(result[0])
predicted=float('.'.join(predicted))
list_result.append(result)
list_predicted.append(predicted)
print("MAE: ", metrics.mean_absolute_error(list_result, list_predicted))
print("MSE: ",metrics.mean_squared_error(list_result, list_predicted))
print("RMSE: ",np.sqrt(metrics.mean_absolute_error(list_result, list_predicted)))