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.")