(traffic_reading_df)
| 87 | |
| 88 | |
| 89 | def eval_static(traffic_reading_df): |
| 90 | logger.info('Static') |
| 91 | horizons = [1, 3, 6, 12] |
| 92 | logger.info('\t'.join(['Model', 'Horizon', 'RMSE', 'MAPE', 'MAE'])) |
| 93 | for horizon in horizons: |
| 94 | y_predict, y_test = static_predict(traffic_reading_df, n_forward=horizon, test_ratio=0.2) |
| 95 | rmse = masked_rmse_np(preds=y_predict.as_matrix(), labels=y_test.as_matrix(), null_val=0) |
| 96 | mape = masked_mape_np(preds=y_predict.as_matrix(), labels=y_test.as_matrix(), null_val=0) |
| 97 | mae = masked_mae_np(preds=y_predict.as_matrix(), labels=y_test.as_matrix(), null_val=0) |
| 98 | line = 'Static\t%d\t%.2f\t%.2f\t%.2f' % (horizon, rmse, mape * 100, mae) |
| 99 | logger.info(line) |
| 100 | |
| 101 | |
| 102 | def eval_historical_average(traffic_reading_df, period): |
no test coverage detected