def compute_stats_on_pred_errors(results, iteration_to_show):
    y_train = results['iterations_results'][iteration_to_show]['train_labels']
    y_test = results['iterations_results'][iteration_to_show]['test_labels']
    y_pred = results['iterations_results'][iteration_to_show]['pred_labels']
    y_pred_lower = results['iterations_results'][iteration_to_show]['uncertainty_low']
    y_pred_upper = results['iterations_results'][iteration_to_show]['uncertainty_high']
    y_train = np.exp(y_train)
    y_test = np.exp(y_test)
    y_pred = np.exp(y_pred)
    y_pred_lower = np.exp(y_pred_lower)
    y_pred_upper = np.exp(y_pred_upper)
    print('Real values')
    print(pd.Series((np.hstack((y_train, y_test)) / 1000)).describe())
    print('highest 5:', (np.sort(np.hstack((y_train, y_test)))[(- 5):] / 1000))
    print()
    print('\nAverage Prediction Error')
    print(pd.Series((np.abs((y_test - y_pred)) / 1000)).describe())
def compute_stats_on_pred_errors(results, iteration_to_show):
    y_train = results['iterations_results'][iteration_to_show]['train_labels']
    y_test = results['iterations_results'][iteration_to_show]['test_labels']
    y_pred = results['iterations_results'][iteration_to_show]['pred_labels']
    y_pred_lower = results['iterations_results'][iteration_to_show]['uncertainty_low']
    y_pred_upper = results['iterations_results'][iteration_to_show]['uncertainty_high']
    y_train = np.exp(y_train)
    y_test = np.exp(y_test)
    y_pred = np.exp(y_pred)
    y_pred_lower = np.exp(y_pred_lower)
    y_pred_upper = np.exp(y_pred_upper)
    print('Real values')
    print(pd.Series((np.hstack((y_train, y_test)) / 1000)).describe())
    print('highest 5:', (np.sort(np.hstack((y_train, y_test)))[(- 5):] / 1000))
    print()
    print('\nAverage Prediction Error')
    print(pd.Series((np.abs((y_test - y_pred)) / 1000)).describe())