Figure for dashboard

Author

SEOYEON CHOI

Published

December 29, 2023

Import

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#---#
import plotly.express as px
import plotly.graph_objects as go
import plotly.io as pio

pd.options.plotting.backend = "plotly"
pio.templates.default = "plotly_white"
import pickle

Data


# GConvGRU
pedal_wiki_GSO_GConvGRU = pd.read_csv('../Data/Final_Simulation_GConvGRU_pedal_wiki_GSO.csv')
pedal_wiki_GSO_GConvGRU['model']='GConvGRU'

# GConvLSTM
pedal_wiki_GSO_GConvLSTM = pd.read_csv('../Data/Final_Simulation_GConvLSTM_pedal_wiki_GSO.csv')
pedal_wiki_GSO_GConvLSTM['model']='GConvLSTM'

# GCLSTM
pedal_wiki_GSO_GCLSTM = pd.read_csv('../Data/Final_Simulation_GCLSTM_pedal_wiki_GSO.csv')
pedal_wiki_GSO_GCLSTM['model']='GCLSTM'

# DCRNN
pedal_wiki_GSO_DCRNN = pd.read_csv('../Data/Final_Simulation_DCRNN_pedal_wiki_GSO.csv')
pedal_wiki_GSO_DCRNN['model']='DCRNN'

# LRGCN
pedal_wiki_GSO_LRGCN = pd.read_csv('../Data/Final_Simulation_LRGCN_pedal_wiki_GSO.csv')
pedal_wiki_GSO_LRGCN['model']='LRGCN'

# TGCN
pedal_wiki_GSO_TGCN = pd.read_csv('../Data/Final_Simulation_TGCN_pedal_wiki_GSO.csv')
pedal_wiki_GSO_TGCN['model']='TGCN'

# EvolveGCNO
pedal_wiki_GSO_EvolveGCNO = pd.read_csv('../Data/Final_Simulation_EvolveGCNO_pedal_wiki_GSO.csv')
pedal_wiki_GSO_EvolveGCNO['model']='EvolveGCNO'

# DYGRENCODER
pedal_wiki_GSO_DYGRENCODER = pd.read_csv('../Data/Final_Simulation_DYGRENCODER_pedal_wiki_GSO.csv')
pedal_wiki_GSO_DYGRENCODER['model']='DyGrEncoder'

# EvolveGCNH
pedal_wiki_GSO_EvolveGCNH = pd.read_csv('../Data/Final_Simulation_EvolveGCNH_pedal_wiki_GSO.csv')
pedal_wiki_GSO_EvolveGCNH['model']='EvolveGCNH'

# GNAR
wiki_GSO_GNAR = pd.read_csv('../Data/Final_Simulation_GNAR_wiki_GSO.csv')
wiki_GSO_GNAR['model']='GNAR'

df = pd.read_csv('../Data/df_fig.csv')

df2 = pd.concat([pedal_wiki_GSO_GConvGRU,pedal_wiki_GSO_GConvLSTM,pedal_wiki_GSO_GCLSTM,pedal_wiki_GSO_DCRNN,pedal_wiki_GSO_LRGCN,pedal_wiki_GSO_TGCN,pedal_wiki_GSO_EvolveGCNO,pedal_wiki_GSO_DYGRENCODER,pedal_wiki_GSO_EvolveGCNH,wiki_GSO_GNAR])
df
Unnamed: 0 dataset method mrate mtype lags nof_filters inter_method epoch mse calculation_time model
0 0 fivenodes STGCN 0.0 NaN 2 12.0 NaN 50.0 0.729374 80.985221 GConvGRU
1 1 fivenodes STGCN 0.0 NaN 2 12.0 NaN 50.0 0.729082 80.891788 GConvGRU
2 2 fivenodes STGCN 0.7 rand 2 12.0 linear 50.0 1.892262 81.976547 GConvGRU
3 3 fivenodes STGCN 0.7 rand 2 12.0 nearest 50.0 2.211288 87.803869 GConvGRU
4 4 fivenodes STGCN 0.8 rand 2 12.0 linear 50.0 2.072818 103.648742 GConvGRU
... ... ... ... ... ... ... ... ... ... ... ... ...
26786 26786 pedalme GNAR 0.8 rand 4 NaN nearest NaN 1.302679 0.023105 GNAR
26787 26787 pedalme GNAR 0.5 rand 4 NaN linear NaN 1.302679 0.022839 GNAR
26788 26788 pedalme GNAR 0.5 rand 4 NaN nearest NaN 1.302679 0.023041 GNAR
26789 26789 pedalme GNAR 0.8 rand 4 NaN linear NaN 1.302679 0.060872 GNAR
26790 26790 pedalme GNAR 0.8 rand 4 NaN nearest NaN 1.302679 0.023526 GNAR

26791 rows × 12 columns

df2
dataset method mrate mtype lags nof_filters inter_method epoch mse calculation_time model
0 pedalme STGCN 0.300000 rand 4 12.0 linear 50.0 1.557424 6.553443 GConvGRU
1 pedalme STGCN 0.300000 rand 4 12.0 nearest 50.0 1.591089 7.995071 GConvGRU
2 pedalme STGCN 0.600000 rand 4 12.0 linear 50.0 1.737521 7.022613 GConvGRU
3 pedalme STGCN 0.600000 rand 4 12.0 nearest 50.0 1.675156 6.745583 GConvGRU
4 pedalme IT-STGCN 0.300000 rand 4 12.0 linear 50.0 1.123114 12.278102 GConvGRU
... ... ... ... ... ... ... ... ... ... ... ...
418 wikimath STGCN 0.511945 block 8 12.0 linear 50.0 0.830234 255.170347 EvolveGCNH
419 wikimath IT-STGCN 0.511945 block 8 12.0 linear 50.0 0.746624 630.021935 EvolveGCNH
0 wikimath GNAR 0.511945 block 8 NaN nearest NaN 1.353637 143.252073 GNAR
1 wikimath GNAR 0.511945 block 8 NaN nearest NaN 1.353637 211.333467 GNAR
2 wikimath GNAR 0.511945 block 8 NaN nearest NaN 1.353637 218.516156 GNAR

3783 rows × 11 columns

px

FiveVTS

fivenodes = pd.concat([
    df[(df['dataset']=='fivenodes') & (df['mtype']=='rand') & (df['inter_method']=='linear') & (df['nof_filters']==12) & 
       (df['lags']==2) & (df['epoch']==50) & (df['model']=='GConvGRU') & (df['mrate'].isin([0.3, 0.5, 0.6, 0.7, 0.8]))],
    df[(df['dataset']=='fivenodes') & (df['mtype']=='rand') & (df['inter_method']=='linear') & (df['nof_filters']==12) & 
       (df['lags']==2) & (df['epoch']==50) & (df['model']=='GConvLSTM') & (df['mrate'].isin([0.3, 0.5, 0.6, 0.7, 0.8]))],
    df[(df['dataset']=='fivenodes') & (df['mtype']=='rand') & (df['inter_method']=='linear') & (df['nof_filters']==4) & 
       (df['lags']==2) & (df['epoch']==50) & (df['model']=='GCLSTM') & (df['mrate'].isin([0.3, 0.5, 0.6, 0.7, 0.8]))],
    df[(df['dataset']=='fivenodes') & (df['mtype']=='rand') & (df['inter_method']=='linear') & (df['nof_filters']==4) & 
       (df['lags']==2) & (df['epoch']==50) & (df['model']=='LRGCN') & (df['mrate'].isin([0.3, 0.5, 0.6, 0.7, 0.8]))],
    df[(df['dataset']=='fivenodes') & (df['mtype']=='rand') & (df['inter_method']=='linear') & (df['nof_filters']==12) & 
       (df['lags']==2) & (df['epoch']==50) & (df['model']=='DyGrEncoder') & (df['mrate'].isin([0.3, 0.5, 0.6, 0.7, 0.8]))],
    df[(df['dataset']=='fivenodes') & (df['mtype']=='rand') & (df['inter_method']=='linear') & (df['lags']==2) & 
       (df['epoch']==50) & (df['model']=='EvolveGCNH') & (df['mrate'].isin([0.3, 0.5, 0.6, 0.7, 0.8]))],
    df[(df['dataset']=='fivenodes') & (df['mtype']=='rand') & (df['inter_method']=='linear') & (df['lags']==2) & 
       (df['epoch']==50) & (df['model']=='EvolveGCNO') & (df['mrate'].isin([0.3, 0.5, 0.6, 0.7, 0.8]))],
    df[(df['dataset']=='fivenodes') & (df['mtype']=='rand') & (df['inter_method']=='linear') & (df['nof_filters']==12) & 
       (df['lags']==2) & (df['epoch']==50) & (df['model']=='TGCN') & (df['mrate'].isin([0.3, 0.5, 0.6, 0.7, 0.8]))],
    df[(df['dataset']=='fivenodes') & (df['mtype']=='rand') & (df['inter_method']=='linear') & (df['nof_filters']==2) & 
       (df['lags']==2) & (df['epoch']==50) & (df['model']=='DCRNN') & (df['mrate'].isin([0.3, 0.5, 0.6, 0.7, 0.8]))]
])

fivenodes['model'] = pd.Categorical(fivenodes['model'], categories=["GConvGRU", "GConvLSTM", "GCLSTM", "LRGCN", "DyGrEncoder", "EvolveGCNH", "EvolveGCNO", "TGCN", "DCRNN"])
fivenodes['method'] = pd.Categorical(fivenodes['method'], categories=['STGCN', 'IT-STGCN'])

fivenodes['mrate'] = fivenodes['mrate'].astype(str)
fivenodes = fivenodes.sort_values(by=['model','mrate'])

fig = px.box(fivenodes,x='mrate',y='mse',color='method',width=70, log_y=True,facet_col='model',facet_col_wrap=3)

fig.layout['xaxis']['title']['text']=''
fig.layout['xaxis2']['title']['text']=''
fig.layout['xaxis3']['title']['text']=''
fig.layout['yaxis']['title']['text']=''
fig.layout['yaxis4']['title']['text']='MSE(log scale)'
fig.layout['yaxis7']['title']['text']=''


fig.layout.xaxis4.showticklabels=True
fig.layout.xaxis5.showticklabels=True
fig.layout.xaxis6.showticklabels=True
fig.layout.xaxis7.showticklabels=True
fig.layout.xaxis8.showticklabels=True
fig.layout.xaxis9.showticklabels=True

fig.layout.yaxis2.showticklabels=True
fig.layout.yaxis3.showticklabels=True
fig.layout.yaxis5.showticklabels=True
fig.layout.yaxis6.showticklabels=True
fig.layout.yaxis8.showticklabels=True
fig.layout.yaxis9.showticklabels=True


fig.update_layout(template="seaborn")

for i in range(0, 9):
    fig.data[i]['marker']['color'] = 'blue'
    fig.data[i]['name'] = 'Classic'
for i in range(9, 17):    
    fig.data[i]['marker']['color'] = 'red'
    fig.data[i]['name'] = 'Proposed'

fig.update_layout(legend=dict(x=1, y=1, traceorder='normal', orientation='v'))
fig.update_layout(title_text="FiveVTS")

fig.update_layout(height=1200, width=2000)
fig.for_each_annotation(lambda a: a.update(text=a.text.split("=")[-1]))    
fig.update_layout(legend=dict(
    yanchor="top",
    y=0.99,
    xanchor="left",
    x=0.01
))

with open('fivenodes_fig.pkl', 'wb') as file:
    pickle.dump(fig, file)
with open('fivenodes_fig.pkl', 'rb') as file:
    fivenodes_fig = pickle.load(file)

fivenodes_fig

Chickenpox

chickenpox = pd.concat([
    df.query("dataset=='chickenpox' & mtype=='rand' & inter_method == 'linear' & nof_filters==16 & lags==4 & epoch==50 & model=='GConvGRU' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='chickenpox' & mtype=='rand' & inter_method == 'linear' & nof_filters==32 & lags==4 & epoch==50 & model=='GConvLSTM' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='chickenpox' & mtype=='rand' & inter_method == 'linear' & nof_filters==16 & lags==4 & epoch==50 & model=='GCLSTM' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='chickenpox' & mtype=='rand' & inter_method == 'linear' & nof_filters==8 & lags==4 & epoch==50 & model=='LRGCN' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='chickenpox' & mtype=='rand' & inter_method == 'linear' & nof_filters==12 & lags==4 & epoch==50 & model=='DyGrEncoder' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='chickenpox' & mtype=='rand' & inter_method == 'linear' & lags==4 & epoch==50 & model=='EvolveGCNH' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='chickenpox' & mtype=='rand' & inter_method == 'linear' & lags==4 & epoch==50 & model=='EvolveGCNO' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='chickenpox' & mtype=='rand' & inter_method == 'linear' & nof_filters==12 & lags==4 & epoch==50 & model=='TGCN' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='chickenpox' & mtype=='rand' & inter_method == 'linear' & nof_filters==16 & lags==4 & epoch==50 & model=='DCRNN' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)")
])

chickenpox['model'] = pd.Categorical(chickenpox['model'], categories=["GConvGRU","GConvLSTM","GCLSTM","LRGCN","DyGrEncoder","EvolveGCNH","EvolveGCNO","TGCN","DCRNN"])
chickenpox['method'] = pd.Categorical(chickenpox['method'], categories=['STGCN','IT-STGCN'])

chickenpox['mrate'] = chickenpox['mrate'].astype(str)
chickenpox = chickenpox.sort_values(by=['model','mrate'])

fig = px.box(chickenpox,x='mrate',y='mse',color='method',width=70, log_y=True,facet_col='model',facet_col_wrap=3)

fig.layout['xaxis']['title']['text']=''
fig.layout['xaxis2']['title']['text']=''
fig.layout['xaxis3']['title']['text']=''
fig.layout['yaxis']['title']['text']=''
fig.layout['yaxis4']['title']['text']='MSE(log scale)'
fig.layout['yaxis7']['title']['text']=''

fig.layout.xaxis4.showticklabels=True
fig.layout.xaxis5.showticklabels=True
fig.layout.xaxis6.showticklabels=True
fig.layout.xaxis7.showticklabels=True
fig.layout.xaxis8.showticklabels=True
fig.layout.xaxis9.showticklabels=True

fig.layout.yaxis2.showticklabels=True
fig.layout.yaxis3.showticklabels=True
fig.layout.yaxis5.showticklabels=True
fig.layout.yaxis6.showticklabels=True
fig.layout.yaxis8.showticklabels=True
fig.layout.yaxis9.showticklabels=True

for i in range(0, 9):
    fig.data[i]['marker']['color'] = 'blue'
    fig.data[i]['name'] = 'Classic'
for i in range(9, 17):    
    fig.data[i]['marker']['color'] = 'red'
    fig.data[i]['name'] = 'Proposed'

fig.update_layout(legend=dict(x=1, y=1, traceorder='normal', orientation='v'))
fig.update_layout(title_text="Chickenpox")
fig.update_layout(height=1200, width=2000)
fig.for_each_annotation(lambda a: a.update(text=a.text.split("=")[-1]))  
fig.update_layout(template="seaborn")  
fig.update_layout(legend=dict(
    yanchor="top",
    y=0.99,
    xanchor="left",
    x=0.01
))


with open('chickenpox_fig.pkl', 'wb') as file:
    pickle.dump(fig, file)
with open('chickenpox_fig.pkl', 'rb') as file:
    chickenpox_fig = pickle.load(file)

chickenpox_fig

PedalMeDatasetLoader

pedalme = pd.concat([
    df.query("dataset=='pedalme' & mtype=='rand' & inter_method == 'linear' & nof_filters==12 & lags==4 & epoch==50 & model=='GConvGRU' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='pedalme' & mtype=='rand' & inter_method == 'linear' & nof_filters==2 & lags==4 & epoch==50 & model=='GConvLSTM' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='pedalme' & mtype=='rand' & inter_method == 'linear' & nof_filters==4 & lags==4 & epoch==50 & model=='GCLSTM' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='pedalme' & mtype=='rand' & inter_method == 'linear' & nof_filters==8 & lags==4 & epoch==50 & model=='LRGCN' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='pedalme' & mtype=='rand' & inter_method == 'linear' & nof_filters==12 & lags==4 & epoch==50 & model=='DyGrEncoder' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='pedalme' & mtype=='rand' & inter_method == 'linear' & lags==4 & epoch==50 & model=='EvolveGCNH' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='pedalme' & mtype=='rand' & inter_method == 'linear' & lags==4 & epoch==50 & model=='EvolveGCNO' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='pedalme' & mtype=='rand' & inter_method == 'linear' & nof_filters==12 & lags==4 & epoch==50 & model=='TGCN' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='pedalme' & mtype=='rand' & inter_method == 'linear' & nof_filters==8 & lags==4 & epoch==50 & model=='DCRNN' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)")
], ignore_index=True)

pedalme['model'] = pd.Categorical(pedalme['model'], categories=["GConvGRU", "GConvLSTM", "GCLSTM", "LRGCN", "DyGrEncoder", "EvolveGCNH", "EvolveGCNO", "TGCN", "DCRNN"], ordered=True)
pedalme['method'] = pd.Categorical(pedalme['method'], categories=['STGCN', 'IT-STGCN'], ordered=True)

pedalme['mrate'] = pedalme['mrate'].astype(str)
pedalme = pedalme.sort_values(by=['model','mrate'])

fig = px.box(pedalme,x='mrate',y='mse',color='method',width=70, log_y=True,facet_col='model',facet_col_wrap=3)

fig.layout['xaxis']['title']['text']=''
fig.layout['xaxis2']['title']['text']=''
fig.layout['xaxis3']['title']['text']=''
fig.layout['yaxis']['title']['text']=''
fig.layout['yaxis4']['title']['text']='MSE(log scale)'
fig.layout['yaxis7']['title']['text']=''


fig.layout.xaxis4.showticklabels=True
fig.layout.xaxis5.showticklabels=True
fig.layout.xaxis6.showticklabels=True
fig.layout.xaxis7.showticklabels=True
fig.layout.xaxis8.showticklabels=True
fig.layout.xaxis9.showticklabels=True

fig.layout.yaxis2.showticklabels=True
fig.layout.yaxis3.showticklabels=True
fig.layout.yaxis5.showticklabels=True
fig.layout.yaxis6.showticklabels=True
fig.layout.yaxis8.showticklabels=True
fig.layout.yaxis9.showticklabels=True

for i in range(0, 9):
    fig.data[i]['marker']['color'] = 'blue'
    fig.data[i]['name'] = 'Classic'
for i in range(9, 17):    
    fig.data[i]['marker']['color'] = 'red'
    fig.data[i]['name'] = 'Proposed'

fig.update_layout(legend=dict(x=1, y=1, traceorder='normal', orientation='v'))
fig.update_layout(title_text="Pedalme")
fig.update_layout(height=1200, width=2000)
fig.for_each_annotation(lambda a: a.update(text=a.text.split("=")[-1]))  
fig.update_layout(template="seaborn")  
fig.update_layout(legend=dict(
    yanchor="top",
    y=0.99,
    xanchor="left",
    x=0.01
))

with open('pedalme_fig.pkl', 'wb') as file:
    pickle.dump(fig, file)
with open('pedalme_fig.pkl', 'rb') as file:
    pedalme_fig = pickle.load(file)

pedalme_fig

WikiMathsDatasetLoader

wikimath = pd.concat([
    df.query("dataset=='wikimath' & mtype=='rand' & inter_method == 'linear' & nof_filters==12 & lags==8 & epoch==50 & model=='GConvGRU' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='wikimath' & mtype=='rand' & inter_method == 'linear' & nof_filters==64 & lags==8 & epoch==50 & model=='GConvLSTM' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='wikimath' & mtype=='rand' & inter_method == 'linear' & nof_filters==64 & lags==8 & epoch==50 & model=='GCLSTM' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='wikimath' & mtype=='rand' & inter_method == 'linear' & nof_filters==32 & lags==8 & epoch==50 & model=='LRGCN' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='wikimath' & mtype=='rand' & inter_method == 'linear' & nof_filters==12 & lags==8 & epoch==50 & model=='DyGrEncoder' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='wikimath' & mtype=='rand' & inter_method == 'linear' & lags==8 & epoch==50 & model=='EvolveGCNH' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='wikimath' & mtype=='rand' & inter_method == 'linear' & lags==8 & epoch==50 & model=='EvolveGCNO' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='wikimath' & mtype=='rand' & inter_method == 'linear' & nof_filters==12 & lags==8 & epoch==50 & model=='TGCN' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)"),
    df.query("dataset=='wikimath' & mtype=='rand' & inter_method == 'linear' & nof_filters==12 & lags==8 & epoch==50 & model=='DCRNN' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.8)")
], ignore_index=True)

wikimath['model'] = pd.Categorical(wikimath['model'], categories=["GConvGRU", "GConvLSTM", "GCLSTM", "LRGCN", "DyGrEncoder", "EvolveGCNH", "EvolveGCNO", "TGCN", "DCRNN"], ordered=True)
wikimath['method'] = pd.Categorical(wikimath['method'], categories=['STGCN', 'IT-STGCN'], ordered=True)

wikimath['mrate'] = wikimath['mrate'].astype(str)
wikimath = wikimath.sort_values(by=['model','mrate'])

fig = px.box(wikimath,x='mrate',y='mse',color='method',width=70, log_y=True,facet_col='model',facet_col_wrap=3)

fig.layout['xaxis']['title']['text']=''
fig.layout['xaxis2']['title']['text']=''
fig.layout['xaxis3']['title']['text']=''
fig.layout['yaxis']['title']['text']=''
fig.layout['yaxis4']['title']['text']='MSE(log scale)'
fig.layout['yaxis7']['title']['text']=''

fig.layout.xaxis4.showticklabels=True
fig.layout.xaxis5.showticklabels=True
fig.layout.xaxis6.showticklabels=True
fig.layout.xaxis7.showticklabels=True
fig.layout.xaxis8.showticklabels=True
fig.layout.xaxis9.showticklabels=True

fig.layout.yaxis2.showticklabels=True
fig.layout.yaxis3.showticklabels=True
fig.layout.yaxis5.showticklabels=True
fig.layout.yaxis6.showticklabels=True
fig.layout.yaxis8.showticklabels=True
fig.layout.yaxis9.showticklabels=True

for i in range(0, 9):
    fig.data[i]['marker']['color'] = 'blue'
    fig.data[i]['name'] = 'Classic'
for i in range(9, 17):    
    fig.data[i]['marker']['color'] = 'red'
    fig.data[i]['name'] = 'Proposed'

fig.update_layout(legend=dict(x=1, y=1, traceorder='normal', orientation='v'))
fig.update_layout(title_text="Wikimath")
fig.update_layout(height=1200, width=2000)
fig.for_each_annotation(lambda a: a.update(text=a.text.split("=")[-1]))  
fig.update_layout(template="seaborn")  
fig.update_layout(legend=dict(
    yanchor="top",
    y=0.99,
    xanchor="left",
    x=0.01
))

with open('wikimath_fig.pkl', 'wb') as file:
    pickle.dump(fig, file)
with open('wikimath_fig.pkl', 'rb') as file:
    wikimath_fig = pickle.load(file)

wikimath_fig

Windmillsmall

windmillsmall = pd.concat([
    df.query("dataset=='windmillsmall' & mtype=='rand' & inter_method == 'linear' & nof_filters==12 & lags==8 & epoch==50 & model=='GConvGRU' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.7)"),
    df.query("dataset=='windmillsmall' & mtype=='rand' & inter_method == 'linear' & nof_filters==16 & lags==8 & epoch==50 & model=='GConvLSTM' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.7)"),
    df.query("dataset=='windmillsmall' & mtype=='rand' & inter_method == 'linear' & nof_filters==16 & lags==8 & epoch==50 & model=='GCLSTM' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.7)"),
    df.query("dataset=='windmillsmall' & mtype=='rand' & inter_method == 'linear' & nof_filters==12 & lags==8 & epoch==50 & model=='LRGCN' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.7)"),
    df.query("dataset=='windmillsmall' & mtype=='rand' & inter_method == 'linear' & nof_filters==12 & lags==8 & epoch==50 & model=='DyGrEncoder' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.7)"),
    df.query("dataset=='windmillsmall' & mtype=='rand' & inter_method == 'linear' & lags==8 & epoch==50 & model=='EvolveGCNH' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.7)"),
    df.query("dataset=='windmillsmall' & mtype=='rand' & inter_method == 'linear' & lags==8 & epoch==50 & model=='EvolveGCNO' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.7)"),
    df.query("dataset=='windmillsmall' & mtype=='rand' & inter_method == 'linear' & nof_filters==12 & lags==8 & epoch==50 & model=='TGCN' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.7)"),
    df.query("dataset=='windmillsmall' & mtype=='rand' & inter_method == 'linear' & nof_filters==4 & lags==8 & epoch==50 & model=='DCRNN' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.6 | mrate == 0.7)")
], ignore_index=True)

windmillsmall['model'] = pd.Categorical(windmillsmall['model'], categories=["GConvGRU", "GConvLSTM", "GCLSTM", "LRGCN", "DyGrEncoder", "EvolveGCNH", "EvolveGCNO", "TGCN", "DCRNN"], ordered=True)
windmillsmall['method'] = pd.Categorical(windmillsmall['method'], categories=['STGCN', 'IT-STGCN'], ordered=True)

windmillsmall['mrate'] = windmillsmall['mrate'].astype(str)
windmillsmall = windmillsmall.sort_values(by=['model','mrate'])

fig = px.box(windmillsmall,x='mrate',y='mse',color='method',width=70, log_y=True,facet_col='model',facet_col_wrap=3)

fig.layout['xaxis']['title']['text']=''
fig.layout['xaxis2']['title']['text']=''
fig.layout['xaxis3']['title']['text']=''
fig.layout['yaxis']['title']['text']=''
fig.layout['yaxis4']['title']['text']='MSE(log scale)'
fig.layout['yaxis7']['title']['text']=''

fig.layout.xaxis4.showticklabels=True
fig.layout.xaxis5.showticklabels=True
fig.layout.xaxis6.showticklabels=True
fig.layout.xaxis7.showticklabels=True
fig.layout.xaxis8.showticklabels=True
fig.layout.xaxis9.showticklabels=True

fig.layout.yaxis2.showticklabels=True
fig.layout.yaxis3.showticklabels=True
fig.layout.yaxis5.showticklabels=True
fig.layout.yaxis6.showticklabels=True
fig.layout.yaxis8.showticklabels=True
fig.layout.yaxis9.showticklabels=True


for i in range(0, 9):
    fig.data[i]['marker']['color'] = 'blue'
    fig.data[i]['name'] = 'Classic'
for i in range(9, 17):    
    fig.data[i]['marker']['color'] = 'red'
    fig.data[i]['name'] = 'Proposed'

fig.update_layout(legend=dict(x=1, y=1, traceorder='normal', orientation='v'))
fig.update_layout(title_text="Windmillsmall")
fig.update_layout(height=1200, width=2000)
fig.for_each_annotation(lambda a: a.update(text=a.text.split("=")[-1]))  
fig.update_layout(template="seaborn")  
fig.update_layout(legend=dict(
    yanchor="top",
    y=0.99,
    xanchor="left",
    x=0.005
))


with open('windmillsmall_fig.pkl', 'wb') as file:
    pickle.dump(fig, file)
with open('windmillsmall_fig.pkl', 'rb') as file:
    windmillsmall_fig = pickle.load(file)

windmillsmall_fig

Montevideobus

monte = pd.concat([
    df.query("dataset=='monte' & mtype=='rand' & inter_method == 'nearest' & nof_filters==12 & lags==4 & epoch==50 & model=='GConvGRU' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.7 | mrate == 0.8)"),
    df.query("dataset=='monte' & mtype=='rand' & inter_method == 'nearest' & nof_filters==12 & lags==4 & epoch==50 & model=='GConvLSTM' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.7 | mrate == 0.8)"),
    df.query("dataset=='monte' & mtype=='rand' & inter_method == 'nearest' & nof_filters==12 & lags==4 & epoch==50 & model=='GCLSTM' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.7 | mrate == 0.8)"),
    df.query("dataset=='monte' & mtype=='rand' & inter_method == 'nearest' & nof_filters==2 & lags==4 & epoch==50 & model=='LRGCN' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.7 | mrate == 0.8)"),
    df.query("dataset=='monte' & mtype=='rand' & inter_method == 'nearest' & nof_filters==12 & lags==4 & epoch==50 & model=='DyGrEncoder' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.7 | mrate == 0.8)"),
    df.query("dataset=='monte' & mtype=='rand' & inter_method == 'nearest' & lags==4 & epoch==50 & model=='EvolveGCNH' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.7 | mrate == 0.8)"),
    df.query("dataset=='monte' & mtype=='rand' & inter_method == 'nearest' & lags==4 & epoch==50 & model=='EvolveGCNO' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.7 | mrate == 0.8)"),
    df.query("dataset=='monte' & mtype=='rand' & inter_method == 'nearest' & nof_filters==8 & lags==4 & epoch==50 & model=='TGCN' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.7 | mrate == 0.8)"),
    df.query("dataset=='monte' & mtype=='rand' & inter_method == 'nearest' & nof_filters==12 & lags==4 & epoch==50 & model=='DCRNN' & (mrate == 0.3 | mrate == 0.5 | mrate == 0.7 | mrate == 0.8)")
], ignore_index=True)

monte['model'] = pd.Categorical(monte['model'], categories=["GConvGRU", "GConvLSTM", "GCLSTM", "LRGCN", "DyGrEncoder", "EvolveGCNH", "EvolveGCNO", "TGCN", "DCRNN"], ordered=True)
monte['method'] = pd.Categorical(monte['method'], categories=['STGCN', 'IT-STGCN'], ordered=True)

monte['mrate'] = monte['mrate'].astype(str)
monte = monte.sort_values(by=['model','mrate'])

fig = px.box(monte,x='mrate',y='mse',color='method',width=70, log_y=True,facet_col='model',facet_col_wrap=3)

fig.layout['xaxis']['title']['text']=''
fig.layout['xaxis2']['title']['text']=''
fig.layout['xaxis3']['title']['text']=''
fig.layout['yaxis']['title']['text']=''
fig.layout['yaxis4']['title']['text']='MSE(log scale)'
fig.layout['yaxis7']['title']['text']=''


fig.layout.xaxis4.showticklabels=True
fig.layout.xaxis5.showticklabels=True
fig.layout.xaxis6.showticklabels=True
fig.layout.xaxis7.showticklabels=True
fig.layout.xaxis8.showticklabels=True
fig.layout.xaxis9.showticklabels=True

fig.layout.yaxis2.showticklabels=True
fig.layout.yaxis3.showticklabels=True
fig.layout.yaxis5.showticklabels=True
fig.layout.yaxis6.showticklabels=True
fig.layout.yaxis8.showticklabels=True
fig.layout.yaxis9.showticklabels=True


for i in range(0, 9):
    fig.data[i]['marker']['color'] = 'blue'
    fig.data[i]['name'] = 'Classic'
for i in range(9, 17):    
    fig.data[i]['marker']['color'] = 'red'
    fig.data[i]['name'] = 'Proposed'

fig.update_layout(legend=dict(x=1, y=1, traceorder='normal', orientation='v'))
fig.update_layout(title_text="MontevideoBus")
fig.update_layout(height=1200, width=2000)
fig.for_each_annotation(lambda a: a.update(text=a.text.split("=")[-1]))  
fig.update_layout(template="seaborn")  
fig.update_layout(legend=dict(
    yanchor="top",
    y=0.99,
    xanchor="left",
    x=0.01
))



with open('monte_fig.pkl', 'wb') as file:
    pickle.dump(fig, file)
with open('monte_fig.pkl', 'rb') as file:
    monte_fig = pickle.load(file)

monte_fig