21 lines
626 B
Python
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)))
|