Skip to content

Instantly share code, notes, and snippets.

@NazarS-MC
Created March 24, 2021 16:20
Time Series Analysis and Sales Forecasting for Automotive
def mean_percentage_error(y_true, y_pred):
return 100*np.mean((y_true - y_pred) / y_true)
print('MAE: \t{0:.1f}'.format(mean_absolute_error(test, forecasts)))
print('MSE: \t{0:.1f}'.format(mean_squared_error(test, forecasts)))
print('RMSE: \t{0:.1f}'.format(np.sqrt(mean_squared_error(test, forecasts))))
print('MAPE: \t{0:3.4f} %'.format(mean_percentage_error(test, forecasts)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment