GConvGRU and GNAR_Simulation Tables_reshape

ITSTGCN
Author

SEOYEON CHOI

Published

May 17, 2023

Simulation Tables

import

import pandas as pd
data_fivenodes = pd.read_csv('./simulation_results/Real_simulation_reshape/fivedones_Simulation.csv')
data_chickenpox = pd.read_csv('./simulation_results/Real_simulation_reshape/chikenpox_Simulation.csv')
data_pedal = pd.read_csv('./simulation_results/Real_simulation_reshape/pedalme_Simulation.csv')
data_pedal2 = pd.read_csv('./simulation_results/Real_simulation_reshape/pedalme_Simulation_itstgcnsnd.csv')
data__wiki = pd.read_csv('./simulation_results/Real_simulation_reshape/wikimath.csv')
data_wiki_GSO = pd.read_csv('./simulation_results/Real_simulation_reshape/wikimath_GSO_st.csv')
data_windmillsmall = pd.read_csv('./simulation_results/Real_simulation_reshape/windmillsmall.csv')
data_monte = pd.read_csv('./simulation_results/Real_simulation_reshape/monte.csv')
data = pd.concat([data_fivenodes,data_chickenpox,data_pedal,data__wiki,data_windmillsmall,data_monte]);data
dataset method mrate mtype lags nof_filters inter_method epoch mse calculation_time
0 fivenodes STGCN 0.0 NaN 2 12 NaN 50 0.729374 80.985221
1 fivenodes STGCN 0.0 NaN 2 12 NaN 50 0.729082 80.891788
2 fivenodes STGCN 0.7 rand 2 12 linear 50 1.892262 81.976547
3 fivenodes STGCN 0.7 rand 2 12 nearest 50 2.211288 87.803869
4 fivenodes STGCN 0.8 rand 2 12 linear 50 2.072818 103.648742
... ... ... ... ... ... ... ... ... ... ...
565 monte IT-STGCN 0.7 rand 4 12 nearest 50 1.015357 607.449036
566 monte STGCN 0.7 rand 4 12 nearest 50 1.373984 345.047135
567 monte IT-STGCN 0.7 rand 4 12 nearest 50 1.035471 677.290204
568 monte STGCN 0.7 rand 4 12 nearest 50 1.409659 636.906142
569 monte IT-STGCN 0.7 rand 4 12 nearest 50 1.001905 654.312819

3186 rows × 10 columns

data.to_csv('./simulation_results/Real_simulation_reshape/Final_Simulation_GConvGRU.csv',index=False)
pedal_wiki_GSO = pd.concat([data_pedal2,data_wiki_GSO])
pedal_wiki_GSO.to_csv('./simulation_results/Real_simulation_reshape/Final_Simulation_GConvGRU_pedal_wiki_GSO.csv',index=False)

Fivenodes

Baseline

pd.merge(data.query("dataset=='fivenodes' and mtype!='rand' and mtype!='block'").groupby(['nof_filters','method','lags'])['mse'].mean().reset_index(),
         data.query("dataset=='fivenodes' and mtype!='rand' and mtype!='block'").groupby(['nof_filters','method','lags'])['mse'].std().reset_index(),
         on=['method','nof_filters','lags']).rename(columns={'mse_x':'mean','mse_y':'std'}).round(3)
nof_filters method lags mean std
0 12 IT-STGCN 2 0.732 0.005
1 12 STGCN 2 0.732 0.005

Random

pd.merge(data.query("dataset=='fivenodes' and mtype=='rand'").groupby(['mrate','nof_filters','method','lags'])['mse'].mean().reset_index(),
         data.query("dataset=='fivenodes' and mtype=='rand'").groupby(['mrate','nof_filters','method','lags'])['mse'].std().reset_index(),
         on=['method','nof_filters','mrate','lags']).rename(columns={'mse_x':'mean','mse_y':'std'}).round(3).query("nof_filters==12")
mrate nof_filters method lags mean std
0 0.3 12 IT-STGCN 2 1.186 0.051
1 0.3 12 STGCN 2 1.208 0.051
2 0.5 12 IT-STGCN 2 1.242 0.061
3 0.5 12 STGCN 2 1.330 0.073
4 0.6 12 IT-STGCN 2 1.251 0.055
5 0.6 12 STGCN 2 1.422 0.086
6 0.7 12 IT-STGCN 2 1.167 0.059
7 0.7 12 STGCN 2 2.077 0.252
8 0.8 12 IT-STGCN 2 1.371 0.097
9 0.8 12 STGCN 2 2.432 0.263

Block

pd.merge(data.query("dataset=='fivenodes' and mtype=='block'").groupby(['mrate','nof_filters','method'])['mse'].mean().reset_index(),
         data.query("dataset=='fivenodes' and mtype=='block'").groupby(['mrate','nof_filters','method'])['mse'].std().reset_index(),
         on=['method','nof_filters','mrate']).rename(columns={'mse_x':'mean','mse_y':'std'}).round(3)
mrate nof_filters method mean std
0 0.125 12 IT-STGCN 1.160 0.042
1 0.125 12 STGCN 1.215 0.036

ChickenpoxDatasetLoader(lags=4)

Baseline

pd.merge(data.query("dataset=='chickenpox' and mtype!='rand' and mtype!='block'").groupby(['nof_filters','method'])['mse'].mean().reset_index(),
         data.query("dataset=='chickenpox' and mtype!='rand' and mtype!='block'").groupby(['nof_filters','method'])['mse'].std().reset_index(),
         on=['method','nof_filters']).rename(columns={'mse_x':'mean','mse_y':'std'}).round(3).query("nof_filters==16")
nof_filters method mean std
0 16 IT-STGCN 0.752 0.013
1 16 STGCN 0.752 0.012

Random

pd.merge(data.query("dataset=='chickenpox' and mtype=='rand'").groupby(['mrate','inter_method','nof_filters','method'])['mse'].mean().reset_index(),
         data.query("dataset=='chickenpox' and mtype=='rand'").groupby(['mrate','inter_method','nof_filters','method'])['mse'].std().reset_index(),
         on=['method','inter_method','mrate','nof_filters']).rename(columns={'mse_x':'mean','mse_y':'std'}).round(3)
mrate inter_method nof_filters method mean std
0 0.3 linear 16 IT-STGCN 0.851 0.031
1 0.3 linear 16 STGCN 1.087 0.046
2 0.5 linear 16 IT-STGCN 0.958 0.072
3 0.5 linear 16 STGCN 1.530 0.106
4 0.6 linear 16 IT-STGCN 1.120 0.072
5 0.6 linear 16 STGCN 1.753 0.181
6 0.8 linear 16 IT-STGCN 1.586 0.199
7 0.8 linear 16 STGCN 2.529 0.292

Block

pd.merge(data.query("dataset=='chickenpox' and mtype=='block'").groupby(['inter_method','mrate','nof_filters','method'])['mse'].mean().reset_index(),
         data.query("dataset=='chickenpox' and mtype=='block'").groupby(['inter_method','mrate','nof_filters','method'])['mse'].std().reset_index(),
         on=['method','inter_method','mrate','nof_filters']).rename(columns={'mse_x':'mean','mse_y':'std'})
inter_method mrate nof_filters method mean std
0 linear 0.28777 16 IT-STGCN 0.807041 0.016362
1 linear 0.28777 16 STGCN 0.828224 0.021919
2 nearest 0.28777 16 IT-STGCN 0.823756 0.022918
3 nearest 0.28777 16 STGCN 0.828498 0.022007

PedalMeDatasetLoader (lags=4)

Baseline

pd.merge(data.query("dataset=='pedalme' and mtype!='rand' and mtype!='block'").groupby(['lags','nof_filters','method'])['mse'].mean().reset_index(),
         data.query("dataset=='pedalme' and mtype!='rand' and mtype!='block'").groupby(['lags','nof_filters','method'])['mse'].std().reset_index(),
         on=['method','lags','nof_filters']).rename(columns={'mse_x':'mean','mse_y':'std'}).round(3).query("lags==4")
lags nof_filters method mean std
0 4 12 IT-STGCN 1.233 0.115
1 4 12 STGCN 1.233 0.099

Random

pd.merge(data.query("dataset=='pedalme' and mtype=='rand'").groupby(['mrate','lags','inter_method','method'])['mse'].mean().reset_index(),
         data.query("dataset=='pedalme' and mtype=='rand'").groupby(['mrate','lags','inter_method','method'])['mse'].std().reset_index(),
         on=['method','mrate','lags','inter_method']).rename(columns={'mse_x':'mean','mse_y':'std'}).round(3)
mrate lags inter_method method mean std
0 0.3 4 linear IT-STGCN 1.354 0.134
1 0.3 4 linear STGCN 1.575 0.198
2 0.3 4 nearest IT-STGCN 1.385 0.173
3 0.3 4 nearest STGCN 1.527 0.342
4 0.5 4 linear IT-STGCN 1.528 0.190
5 0.5 4 linear STGCN 1.593 0.195
6 0.5 4 nearest IT-STGCN 1.507 0.235
7 0.5 4 nearest STGCN 1.673 0.223
8 0.6 4 linear IT-STGCN 1.516 0.211
9 0.6 4 linear STGCN 1.655 0.179
10 0.6 4 nearest IT-STGCN 1.625 0.324
11 0.6 4 nearest STGCN 1.851 0.254
12 0.8 4 linear IT-STGCN 1.753 0.306
13 0.8 4 linear STGCN 1.753 0.148
14 0.8 4 nearest IT-STGCN 1.608 0.243
15 0.8 4 nearest STGCN 1.871 0.214

Block

pd.merge(data.query("dataset=='pedalme' and mtype=='block'").groupby(['mrate','lags','inter_method','method'])['mse'].mean().reset_index(),
         data.query("dataset=='pedalme' and mtype=='block'").groupby(['mrate','lags','inter_method','method'])['mse'].std().reset_index(),
         on=['method','mrate','lags','inter_method']).rename(columns={'mse_x':'mean','mse_y':'std'}).round(3).query("lags==4")
mrate lags inter_method method mean std
0 0.286 4 linear IT-STGCN 1.329 0.131
1 0.286 4 linear STGCN 1.320 0.111
2 0.286 4 nearest IT-STGCN 1.289 0.115
3 0.286 4 nearest STGCN 1.270 0.114

W_st

pd.merge(data_pedal2.query("mtype=='rand'").groupby(['mrate','lags','inter_method','method'])['mse'].mean().reset_index(),
         data_pedal2.query("mtype=='rand'").groupby(['mrate','lags','inter_method','method'])['mse'].std().reset_index(),
         on=['method','mrate','lags','inter_method']).rename(columns={'mse_x':'mean','mse_y':'std'}).round(3).query("lags==4")
mrate lags inter_method method mean std
0 0.3 4 linear IT-STGCN 1.270 0.163
1 0.3 4 linear STGCN 1.556 0.264
2 0.3 4 nearest IT-STGCN 1.324 0.163
3 0.3 4 nearest STGCN 1.520 0.206
4 0.6 4 linear IT-STGCN 1.434 0.222
5 0.6 4 linear STGCN 1.678 0.211
6 0.6 4 nearest IT-STGCN 1.410 0.208
7 0.6 4 nearest STGCN 1.771 0.220
pd.merge(data_pedal2.query("mtype=='block'").groupby(['mrate','lags','inter_method','method'])['mse'].mean().reset_index(),
         data_pedal2.query("mtype=='block'").groupby(['mrate','lags','inter_method','method'])['mse'].std().reset_index(),
         on=['method','mrate','lags','inter_method']).rename(columns={'mse_x':'mean','mse_y':'std'}).round(3).query("lags==4")
mrate lags inter_method method mean std
0 0.286 4 linear IT-STGCN 1.391 0.151
1 0.286 4 linear STGCN 1.420 0.110
2 0.286 4 nearest IT-STGCN 1.361 0.114
3 0.286 4 nearest STGCN 1.430 0.145

WikiMathsDatasetLoader (lags=8)

Baseline

pd.merge(data.query("dataset=='wikimath' and mrate==0").groupby(['lags','nof_filters','method'])['mse'].mean().reset_index(),
         data.query("dataset=='wikimath' and mrate==0").groupby(['lags','nof_filters','method'])['mse'].std().reset_index(),
         on=['lags','nof_filters','method']).rename(columns={'mse_x':'mean','mse_y':'std'}).round(3)
lags nof_filters method mean std
0 8 12 IT-STGCN 0.529 0.003
1 8 12 STGCN 0.528 0.003

Random

pd.merge(data.query("dataset=='wikimath' and mtype=='rand'").groupby(['mrate','lags','method'])['mse'].mean().reset_index(),
         data.query("dataset=='wikimath' and mtype=='rand'").groupby(['mrate','lags','method'])['mse'].std().reset_index(),
         on=['method','mrate','lags']).rename(columns={'mse_x':'mean','mse_y':'std'}).round(3)
mrate lags method mean std
0 0.3 8 IT-STGCN 0.518 0.002
1 0.3 8 STGCN 0.570 0.006
2 0.5 8 IT-STGCN 0.524 0.003
3 0.5 8 STGCN 0.658 0.010
4 0.6 8 IT-STGCN 0.539 0.004
5 0.6 8 STGCN 0.731 0.015
6 0.8 8 IT-STGCN 0.687 0.021
7 0.8 8 STGCN 0.932 0.043

Block

pd.merge(data.query("dataset=='wikimath' and mtype=='block'").groupby(['mrate','lags','method'])['mse'].mean().reset_index(),
         data.query("dataset=='wikimath' and mtype=='block'").groupby(['mrate','lags','method'])['mse'].std().reset_index(),
         on=['method','mrate','lags']).rename(columns={'mse_x':'mean','mse_y':'std'})
mrate lags method mean std
0 0.003835 8 IT-STGCN 0.528737 0.002806
1 0.003835 8 STGCN 0.527871 0.002606
2 0.095870 8 IT-STGCN 0.529440 0.003820
3 0.095870 8 STGCN 0.544176 0.010772
4 0.119837 8 IT-STGCN 0.522825 0.002422
5 0.119837 8 STGCN 0.531188 0.002295

missing values on the same nodes

pd.merge(data_wiki_GSO.groupby(['mrate','lags','method'])['mse'].mean().reset_index(),
        data_wiki_GSO.groupby(['mrate','lags','method'])['mse'].std().reset_index(),
         on=['method','mrate','lags']).rename(columns={'mse_x':'mean','mse_y':'std'}).round(3)
mrate lags method mean std
0 0.512 8 IT-STGCN 0.533 0.003
1 0.512 8 STGCN 0.726 0.015

WindmillOutputSmallDatasetLoader (lags=8)

Baseline

pd.merge(data.query("dataset=='windmillsmall' and mrate==0").groupby(['lags','method'])['mse'].mean().reset_index(),
         data.query("dataset=='windmillsmall' and mrate==0").groupby(['lags','method'])['mse'].std().reset_index(),
         on=['method','lags']).rename(columns={'mse_x':'mean','mse_y':'std'}).round(3)
lags method mean std
0 8 IT-STGCN 1.004 0.004
1 8 STGCN 1.003 0.004

Random

pd.merge(data.query("dataset=='windmillsmall' and mtype=='rand'").groupby(['mrate','lags','method'])['mse'].mean().reset_index(),
         data.query("dataset=='windmillsmall' and mtype=='rand'").groupby(['mrate','lags','method'])['mse'].std().reset_index(),
         on=['method','mrate','lags']).rename(columns={'mse_x':'mean','mse_y':'std'}).round(3)
mrate lags method mean std
0 0.7 8 IT-STGCN 1.194 0.042
1 0.7 8 STGCN 1.662 0.073
data.query("dataset=='windmillsmall' and mtype=='rand' and mrate==0.7 and method == 'STGCN'").sort_values('mse')[:5]
dataset method mrate mtype lags nof_filters inter_method epoch mse calculation_time
20 windmillsmall STGCN 0.7 rand 8 12 linear 50 1.491985 4189.720611
24 windmillsmall STGCN 0.7 rand 8 12 linear 50 1.526696 4184.767751
96 windmillsmall STGCN 0.7 rand 8 12 linear 50 1.548946 4182.209651
82 windmillsmall STGCN 0.7 rand 8 12 linear 50 1.574623 3112.238717
108 windmillsmall STGCN 0.7 rand 8 12 linear 50 1.577491 4354.155174
data.query("dataset=='windmillsmall' and mtype=='rand' and mrate==0.7 and method != 'STGCN'").sort_values('mse')[:5]
dataset method mrate mtype lags nof_filters inter_method epoch mse calculation_time
35 windmillsmall IT-STGCN 0.7 rand 8 12 linear 50 1.118357 25106.537400
13 windmillsmall IT-STGCN 0.7 rand 8 12 linear 50 1.133768 33006.879024
109 windmillsmall IT-STGCN 0.7 rand 8 12 linear 50 1.134867 43213.207462
105 windmillsmall IT-STGCN 0.7 rand 8 12 linear 50 1.148162 39068.090318
91 windmillsmall IT-STGCN 0.7 rand 8 12 linear 50 1.155443 37083.352598

Block

pd.merge(data.query("dataset=='windmillsmall' and mtype=='block'").groupby(['mrate','lags','method'])['mse'].mean().reset_index(),
         data.query("dataset=='windmillsmall' and mtype=='block'").groupby(['mrate','lags','method'])['mse'].std().reset_index(),
         on=['method','mrate','lags']).rename(columns={'mse_x':'mean','mse_y':'std'}).round(3)
mrate lags method mean std
0 0.081 8 IT-STGCN 1.007 0.005
1 0.081 8 STGCN 1.008 0.006

Montevideobus (lags=4)

Baseline

pd.merge(data.query("dataset=='monte' and mrate==0").groupby(['lags','method'])['mse'].mean().reset_index(),
         data.query("dataset=='monte' and mrate==0").groupby(['lags','method'])['mse'].std().reset_index(),
         on=['method','lags']).rename(columns={'mse_x':'mean','mse_y':'std'}).round(3)
lags method mean std
0 4 IT-STGCN 0.931 0.001
1 4 STGCN 0.931 0.002

Random

pd.merge(data.query("dataset=='monte' and mtype=='rand'").groupby(['mrate','lags','inter_method','method'])['mse'].mean().reset_index(),
         data.query("dataset=='monte' and mtype=='rand'").groupby(['mrate','lags','inter_method','method'])['mse'].std().reset_index(),
         on=['mrate','inter_method','method','mrate','lags']).rename(columns={'mse_x':'mean','mse_y':'std'})
mrate lags inter_method method mean std
0 0.3 4 nearest IT-STGCN 0.936185 0.001825
1 0.3 4 nearest STGCN 0.991390 0.007285
2 0.5 4 nearest IT-STGCN 0.942045 0.002642
3 0.5 4 nearest STGCN 1.149221 0.017820
4 0.7 4 nearest IT-STGCN 1.015221 0.012403
5 0.7 4 nearest STGCN 1.393108 0.027555
6 0.8 4 nearest IT-STGCN 1.095560 0.018743
7 0.8 4 nearest STGCN 1.516000 0.039793

Block

pd.merge(data.query("dataset=='monte' and mtype=='block'").groupby(['mrate','lags','inter_method','method'])['mse'].mean().reset_index(),
         data.query("dataset=='monte' and mtype=='block'").groupby(['mrate','lags','inter_method','method'])['mse'].std().reset_index(),
         on=['method','mrate','inter_method','lags']).rename(columns={'mse_x':'mean','mse_y':'std'})
mrate lags inter_method method mean std
0 0.149142 4 cubic IT-STGCN 1.022866 0.021048
1 0.149142 4 cubic STGCN 1.028363 0.031275
2 0.149142 4 linear IT-STGCN 0.930156 0.001956
3 0.149142 4 linear STGCN 0.934719 0.004724
4 0.149142 4 nearest IT-STGCN 0.931785 0.002158
5 0.149142 4 nearest STGCN 0.934596 0.003562

GNAR

df1 = pd.read_csv('./simulation_results/2023-07-09_10-06-15.csv') # STGCN IT-STGCN 70%
df2 = pd.read_csv('./simulation_results/2023-07-09_10-06-19.csv') # STGCN IT-STGCN
df3 = pd.read_csv('./simulation_results/2023-07-09_10-06-20.csv') # STGCN IT-STGCN
df4 = pd.read_csv('./simulation_results/2023-07-09_11-24-16.csv') # STGCN IT-STGCN
df5 = pd.read_csv('./simulation_results/2023-07-09_11-26-12.csv') # STGCN IT-STGCN
df6 = pd.read_csv('./simulation_results/2023-07-09_11-26-13.csv') # GNAR 30%, 50%, 70% # 뭔가 일단 필요없어서 데이터셋에서 뺌
df7 = pd.read_csv('./simulation_results/2023-07-09_11-26-14.csv') # STGCN IT-STGCN
df8 = pd.read_csv('./simulation_results/2023-07-09_11-26-15.csv') # STGCN IT-STGCN
df9 = pd.read_csv('./simulation_results/2023-07-09_11-52-36.csv') # STGCN IT-STGCN
df10 = pd.read_csv('./simulation_results/2023-07-09_11-53-31.csv') # STGCN IT-STGCN
df11 = pd.read_csv('./simulation_results/2023-07-09_11-54-04.csv') # STGCN IT-STGCN
df12 = pd.read_csv('./simulation_results/2023-07-09_11-55-04.csv') # STGCN IT-STGCN
df13 = pd.read_csv('./simulation_results/2023-07-16_08-11-09.csv') # STGCN IT-STGCN
df14 = pd.read_csv('./simulation_results/2023-07-16_08-11-11.csv') # STGCN IT-STGCN
df15 = pd.read_csv('./simulation_results/2023-07-16_08-11-13.csv') # STGCN IT-STGCN
# df16 = pd.read_csv('./simulation_results/2023-07-09_11-53-31.csv') # STGCN IT-STGCN
# df17 = pd.read_csv('./simulation_results/2023-07-09_11-53-31.csv') # STGCN IT-STGCN
data = pd.concat([df1,df2,df3,df4,df5,df6,df7,df8,df9,df10,df11,df12,df13,df14,df15],axis=0)
data.to_csv('./simulation_results/Real_simulation_reshape/Final_Simulation_GNAR.csv',index=False)
data = pd.read_csv('./simulation_results/Real_simulation_reshape/Final_Simulation_GNAR.csv')
data
dataset method mrate mtype lags nof_filters inter_method epoch mse calculation_time
0 fivenodes GNAR 0.0 NaN 2 NaN NaN NaN 1.406830 0.021981
1 fivenodes GNAR 0.0 NaN 2 NaN NaN NaN 1.406830 0.017151
2 fivenodes GNAR 0.7 rand 2 NaN linear NaN 1.406830 0.084960
3 fivenodes GNAR 0.7 rand 2 NaN nearest NaN 1.406830 0.010853
4 fivenodes GNAR 0.8 rand 2 NaN linear NaN 1.406830 0.012061
... ... ... ... ... ... ... ... ... ... ...
286 pedalme GNAR 0.8 rand 4 NaN nearest NaN 1.302679 0.023105
287 pedalme GNAR 0.5 rand 4 NaN linear NaN 1.302679 0.022839
288 pedalme GNAR 0.5 rand 4 NaN nearest NaN 1.302679 0.023041
289 pedalme GNAR 0.8 rand 4 NaN linear NaN 1.302679 0.060872
290 pedalme GNAR 0.8 rand 4 NaN nearest NaN 1.302679 0.023526

291 rows × 10 columns

data = pd.read_csv('./simulation_results/2023-07-09_22-21-58.csv')
pedal_wiki_GSO = pd.concat([data])
pedal_wiki_GSO.to_csv('./simulation_results/Real_simulation_reshape/Final_Simulation_GNAR_wiki_GSO.csv',index=False)