Exemplo n.º 1
0
    # ### Figure 1: Continuous vs Batch LSTM
    # fig = plt.figure()
    # # NRMSE_StaticLSTM = plotLSTMresult('results/nyc_taxi_experiment_one_shot/',
    # #                                   window, xaxis=xaxis_datetime, label='static lstm')
    # (nrmseLSTM6000, expResultLSTM6000) = \
    #   plotLSTMresult('results/nyc_taxi_experiment_continuous/learning_window6001.0/',
    #                  window, xaxis=xaxisDate, label='continuous LSTM-6000')
    # plt.legend()
    # plt.savefig(figPath + 'continuousVsbatch.pdf')
    #

    ### Figure 2: Continuous LSTM with different window size

    fig = plt.figure()
    (nrmseLSTM1000, expResultLSTM1000) = \
      plotLSTMresult('results/nyc_taxi_experiment_continuous/learning_window1001.0/',
                     window, xaxis=xaxisDate, label='continuous LSTM-1000')

    (nrmseLSTM3000, expResultLSTM3000) = \
      plotLSTMresult('results/nyc_taxi_experiment_continuous/learning_window3001.0/',
                     window, xaxis=xaxisDate, label='continuous LSTM-3000')

    (nrmseLSTM6000, expResultLSTM6000) = \
      plotLSTMresult('results/nyc_taxi_experiment_continuous/learning_window6001.0/',
                     window, xaxis=xaxisDate, label='continuous LSTM-6000')

    dataSet = 'nyc_taxi'
    filePath = './prediction/' + dataSet + '_TM_pred.csv'

    (tmTruth, tmPrediction) = loadExperimentResult('./prediction/' + dataSet +
                                                   '_TM_pred.csv')
Exemplo n.º 2
0
  # ### Figure 1: Continuous vs Batch LSTM
  # fig = plt.figure()
  # # NRMSE_StaticLSTM = plotLSTMresult('results/nyc_taxi_experiment_one_shot/',
  # #                                   window, xaxis=xaxis_datetime, label='static lstm')
  # (nrmseLSTM6000, expResultLSTM6000) = \
  #   plotLSTMresult('results/nyc_taxi_experiment_continuous/learning_window6001.0/',
  #                  window, xaxis=xaxisDate, label='continuous LSTM-6000')
  # plt.legend()
  # plt.savefig(figPath + 'continuousVsbatch.pdf')
  #

  ### Figure 2: Continuous LSTM with different window size

  fig = plt.figure()
  (nrmseLSTM1000, expResultLSTM1000) = plotLSTMresult(
    'results/nyc_taxi_experiment_continuous/learning_window1001.0/',
    window, xaxis=xaxisDate, label='continuous LSTM-1000')

  (nrmseLSTM3000, expResultLSTM3000) = plotLSTMresult(
    'results/nyc_taxi_experiment_continuous/learning_window3001.0/',
    window, xaxis=xaxisDate, label='continuous LSTM-3000')

  (nrmseLSTM6000, expResultLSTM6000) = plotLSTMresult(
    'results/nyc_taxi_experiment_continuous/learning_window6001.0/',
    window, xaxis=xaxisDate, label='continuous LSTM-6000')

  (nrmseLSTMonline, expResultLSTMonline) = plotLSTMresult(
    'results/nyc_taxi_experiment_continuous_online/learning_window100.0/',
    window, xaxis=xaxisDate, label='continuous LSTM-online')

  dataSet = 'nyc_taxi'
Exemplo n.º 3
0
    # # ### Figure 1: Continuous vs Batch LSTM
    # fig = plt.figure()
    # # NRMSE_StaticLSTM = plotLSTMresult('results/nyc_taxi_experiment_one_shot/',
    # #                                   window, xaxis=xaxis_datetime, label='static lstm')
    # (nrmseLSTM6000, expResultLSTM6000) = \
    #   plotLSTMresult('results/nyc_taxi_experiment_continuous/learning_window6001.0/',
    #                  window, xaxis=xaxisDate, label='continuous LSTM-6000')
    # plt.legend()
    # plt.savefig(figPath + 'continuousVsbatch.pdf')

    ### Figure 2: Continuous LSTM with different window size

    fig = plt.figure()
    (nrmseLSTM1000, expResultLSTM1000) = plotLSTMresult(
        'results/nyc_taxi_experiment_continuous/learning_window1001.0/',
        window,
        xaxis=xaxisDate,
        label='continuous LSTM-1000')

    # (nrmseLSTM3000, expResultLSTM3000) = plotLSTMresult(
    #   'results/nyc_taxi_experiment_continuous/learning_window3001.0/',
    #   window, xaxis=xaxisDate, label='continuous LSTM-3000')
    #
    # (nrmseLSTM6000, expResultLSTM6000) = plotLSTMresult(
    #   'results/nyc_taxi_experiment_continuous/learning_window6001.0/',
    #   window, xaxis=xaxisDate, label='continuous LSTM-6000')
    #
    # (nrmseLSTMonline, expResultLSTMonline) = plotLSTMresult(
    #   'results/nyc_taxi_experiment_continuous_online/learning_window100.0/',
    #   window, xaxis=xaxisDate, label='continuous LSTM-online')
Exemplo n.º 4
0
data = pd.read_csv(filePath, header=0, skiprows=[1, 2], names=['datetime', 'value', 'timeofday', 'dayofweek'])

xaxis_datetime = pd.to_datetime(data['datetime'])


def computeAltMAPE(truth, prediction, startFrom=0):
  return np.nanmean(np.abs(truth[startFrom:] - prediction[startFrom:]))/np.nanmean(np.abs(truth[startFrom:]))

expResult = ExperimentResult('results/nyc_taxi_experiment_continuous/learning_window6001.0/')

### Figure 1: Continuous vs Batch LSTM
fig = plt.figure()
# NRMSE_StaticLSTM = plotLSTMresult('results/nyc_taxi_experiment_one_shot/',
#                                   window, xaxis=xaxis_datetime, label='static lstm')
(NRMSE_LSTM6000, expResult_LSTM6000) = \
  plotLSTMresult('results/nyc_taxi_experiment_continuous/learning_window6001.0/',
               window, xaxis=xaxis_datetime, label='continuous LSTM-6000')
plt.legend()
plt.savefig(figPath + 'continuousVsbatch.pdf')


### Figure 2: Continuous LSTM with different window size

fig = plt.figure()
(NRMSE_LSTM1000, expResult_LSTM1000) = \
  plotLSTMresult('results/nyc_taxi_experiment_continuous/learning_window1001.0/',
               window, xaxis=xaxis_datetime, label='continuous LSTM-1000')

(NRMSE_LSTM3000, expResult_LSTM3000) = \
  plotLSTMresult('results/nyc_taxi_experiment_continuous/learning_window3001.0/',
               window, xaxis=xaxis_datetime, label='continuous LSTM-3000')
Exemplo n.º 5
0
  # ### Figure 1: Continuous vs Batch LSTM
  # fig = plt.figure()
  # # NRMSE_StaticLSTM = plotLSTMresult('results/nyc_taxi_experiment_one_shot/',
  # #                                   window, xaxis=xaxis_datetime, label='static lstm')
  # (nrmseLSTM6000, expResultLSTM6000) = \
  #   plotLSTMresult('results/nyc_taxi_experiment_continuous/learning_window6001.0/',
  #                  window, xaxis=xaxisDate, label='continuous LSTM-6000')
  # plt.legend()
  # plt.savefig(figPath + 'continuousVsbatch.pdf')
  #

  ### Figure 2: Continuous LSTM with different window size

  fig = plt.figure()
  (nrmseLSTM1000, expResultLSTM1000) = plotLSTMresult(
    'results/nyc_taxi_experiment_continuous/learning_window1001.0/',
    window, xaxis=xaxisDate, label='continuous LSTM-1000')

  (nrmseLSTM3000, expResultLSTM3000) = plotLSTMresult(
    'results/nyc_taxi_experiment_continuous/learning_window3001.0/',
    window, xaxis=xaxisDate, label='continuous LSTM-3000')

  (nrmseLSTM6000, expResultLSTM6000) = plotLSTMresult(
    'results/nyc_taxi_experiment_continuous/learning_window6001.0/',
    window, xaxis=xaxisDate, label='continuous LSTM-6000')

  (nrmseLSTMonline, expResultLSTMonline) = plotLSTMresult(
    'results/nyc_taxi_experiment_continuous_online/learning_window100.0/',
    window, xaxis=xaxisDate, label='continuous LSTM-online')

  dataSet = 'nyc_taxi'