CPP / utils.py
AudreyMireille's picture
Upload 5 files
b6b63d1 verified
raw
history blame contribute delete
410 Bytes
import time
import numpy as np
from sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score
# fonction d'affichage des performances
def performances(y_pred,y_true):
r2 = round(r2_score(y_pred,y_true)*100,2)
rmse=round(np.sqrt(np.mean(np.power((np.array(y_pred)-y_true),2))),2)
return r2, rmse
def taken_time(start_time, end_time):
return(f"{round((end_time-start_time)/60,2)} min.")