<jupyter_start><jupyter_text>InceptionV3 5cat<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/Epidural_results/archInceptionV3_5cat_results/"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_inceptionV3 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

df_epoch_results_inceptionV3 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    # Get inner look
    r_inner = re.compile(r'(?<=k)[0-9]+')
    k_val = r_inner.search(item).group(0)
    print("k_val = ", k_val)
    
    with open('/scratch/paulcalle/Epidural_results/archInceptionV3_5cat_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    ind_min_val_loss = np.argmin(history_temp['val_loss'])
    if ind_min_val_loss > max_epoch:
        max_epoch = ind_min_val_loss
    
    df_epoch_results_inceptionV3.loc["K%s_outer"%k_outer, "k%s_val"%k_val] = ind_min_val_loss
    
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][ind_min_val_loss]
    print("val_acc = ", val_acc)
    
    df_val_results_inceptionV3.loc["K%s_outer"%k_outer,"k%s_val"%k_val] = val_acc
    
print("max epoch = ",max_epoch)
df_epoch_results_inceptionV3
df_epoch_results_inceptionV3.to_csv("arch_inceptionV3_5cat_epoch.csv")
df_val_results_inceptionV3
df_val_results_inceptionV3.to_csv("arch_inceptionV3_5cat.csv")
import pickle
with open('/scratch/paulcalle/Epidural_results/archRESNET50_results/pred_val_K1_outer_k2_val.npy', 'rb') as f:
    prob_temp = np.load(f)
prob_temp
prob_temp.shape<jupyter_output><empty_output><jupyter_text>Resnet50 5cat<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/Epidural_results/archRESNET50_5cat_results/"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_resnet50 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

df_epoch_results_resnet50 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    # Get inner look
    r_inner = re.compile(r'(?<=k)[0-9]+')
    k_val = r_inner.search(item).group(0)
    print("k_val = ", k_val)
    
    with open('/scratch/paulcalle/Epidural_results/archRESNET50_5cat_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    ind_min_val_loss = np.argmin(history_temp['val_loss'])
    if ind_min_val_loss > max_epoch:
        max_epoch = ind_min_val_loss
    
    df_epoch_results_resnet50.loc["K%s_outer"%k_outer, "k%s_val"%k_val] = ind_min_val_loss
    
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][ind_min_val_loss]
    print("val_acc = ", val_acc)
    
    df_val_results_resnet50.loc["K%s_outer"%k_outer,"k%s_val"%k_val] = val_acc
    
print("max epoch = ",max_epoch)
df_epoch_results_resnet50
df_epoch_results_resnet50.to_csv("arch_resnet50_5cat_epoch.csv")
df_val_results_resnet50
df_val_results_resnet50.to_csv("arch_resnet50_5cat.csv")<jupyter_output><empty_output><jupyter_text>Xception 5cat<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/Epidural_results/archXception_5cat_results/"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_xception = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

df_epoch_results_xception = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    # Get inner look
    r_inner = re.compile(r'(?<=k)[0-9]+')
    k_val = r_inner.search(item).group(0)
    print("k_val = ", k_val)
    
    with open('/scratch/paulcalle/Epidural_results/archXception_5cat_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    ind_min_val_loss = np.argmin(history_temp['val_loss'])
    if ind_min_val_loss > max_epoch:
        max_epoch = ind_min_val_loss
    
    df_epoch_results_xception.loc["K%s_outer"%k_outer, "k%s_val"%k_val] = ind_min_val_loss
    
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][ind_min_val_loss]
    print("val_acc = ", val_acc)
    
    df_val_results_xception.loc["K%s_outer"%k_outer,"k%s_val"%k_val] = val_acc
    
print("max epoch = ",max_epoch)
df_epoch_results_xception
df_epoch_results_xception.to_csv("arch_xception_5cat_epoch.csv")
df_val_results_xception
df_val_results_xception.to_csv("arch_xception_5cat.csv")<jupyter_output><empty_output><jupyter_text>InceptionV3 bin1<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/Epidural_results/archInceptionV3_bin1_results/"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_inceptionV3 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

df_epoch_results_inceptionV3 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    # Get inner look
    r_inner = re.compile(r'(?<=k)[0-9]+')
    k_val = r_inner.search(item).group(0)
    print("k_val = ", k_val)
    
    with open('/scratch/paulcalle/Epidural_results/archInceptionV3_bin1_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    ind_min_val_loss = np.argmin(history_temp['val_loss'])
    if ind_min_val_loss > max_epoch:
        max_epoch = ind_min_val_loss
    
    df_epoch_results_inceptionV3.loc["K%s_outer"%k_outer, "k%s_val"%k_val] = ind_min_val_loss
    
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][ind_min_val_loss]
    print("val_acc = ", val_acc)
    
    df_val_results_inceptionV3.loc["K%s_outer"%k_outer,"k%s_val"%k_val] = val_acc
    
print("max epoch = ",max_epoch)
df_epoch_results_inceptionV3
df_epoch_results_inceptionV3.to_csv("arch_inceptionV3_bin1_epoch.csv")
df_val_results_inceptionV3
df_val_results_inceptionV3.to_csv("arch_inceptionV3_bin1.csv")<jupyter_output><empty_output><jupyter_text>InceptionV3 bin2<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/Epidural_results/archInceptionV3_bin2_results/"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_inceptionV3 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

df_epoch_results_inceptionV3 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    # Get inner look
    r_inner = re.compile(r'(?<=k)[0-9]+')
    k_val = r_inner.search(item).group(0)
    print("k_val = ", k_val)
    
    with open('/scratch/paulcalle/Epidural_results/archInceptionV3_bin2_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    ind_min_val_loss = np.argmin(history_temp['val_loss'])
    if ind_min_val_loss > max_epoch:
        max_epoch = ind_min_val_loss
    
    df_epoch_results_inceptionV3.loc["K%s_outer"%k_outer, "k%s_val"%k_val] = ind_min_val_loss
    
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][ind_min_val_loss]
    print("val_acc = ", val_acc)
    
    df_val_results_inceptionV3.loc["K%s_outer"%k_outer,"k%s_val"%k_val] = val_acc
    
print("max epoch = ",max_epoch)
df_epoch_results_inceptionV3
df_epoch_results_inceptionV3.to_csv("arch_inceptionV3_bin2_epoch.csv")
df_val_results_inceptionV3
df_val_results_inceptionV3.to_csv("arch_inceptionV3_bin2.csv")<jupyter_output><empty_output><jupyter_text>InceptionV3 bin3b<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/Epidural_results/archInceptionV3_bin3b_results/"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_inceptionV3 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

df_epoch_results_inceptionV3 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    # Get inner look
    r_inner = re.compile(r'(?<=k)[0-9]+')
    k_val = r_inner.search(item).group(0)
    print("k_val = ", k_val)
    
    with open('/scratch/paulcalle/Epidural_results/archInceptionV3_bin3b_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    ind_min_val_loss = np.argmin(history_temp['val_loss'])
    if ind_min_val_loss > max_epoch:
        max_epoch = ind_min_val_loss
    
    df_epoch_results_inceptionV3.loc["K%s_outer"%k_outer, "k%s_val"%k_val] = ind_min_val_loss
    
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][ind_min_val_loss]
    print("val_acc = ", val_acc)
    
    df_val_results_inceptionV3.loc["K%s_outer"%k_outer,"k%s_val"%k_val] = val_acc
    
print("max epoch = ",max_epoch)
df_epoch_results_inceptionV3
df_epoch_results_inceptionV3.to_csv("arch_inceptionV3_bin3b_epoch.csv")
df_val_results_inceptionV3
df_val_results_inceptionV3.to_csv("arch_inceptionV3_bin3b.csv")<jupyter_output><empty_output><jupyter_text>InceptionV3 bin4<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/Epidural_results/archInceptionV3_bin4_results/"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_inceptionV3 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

df_epoch_results_inceptionV3 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    # Get inner look
    r_inner = re.compile(r'(?<=k)[0-9]+')
    k_val = r_inner.search(item).group(0)
    print("k_val = ", k_val)
    
    with open('/scratch/paulcalle/Epidural_results/archInceptionV3_bin4_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    ind_min_val_loss = np.argmin(history_temp['val_loss'])
    if ind_min_val_loss > max_epoch:
        max_epoch = ind_min_val_loss
    
    df_epoch_results_inceptionV3.loc["K%s_outer"%k_outer, "k%s_val"%k_val] = ind_min_val_loss
    
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][ind_min_val_loss]
    print("val_acc = ", val_acc)
    
    df_val_results_inceptionV3.loc["K%s_outer"%k_outer,"k%s_val"%k_val] = val_acc
    
print("max epoch = ",max_epoch)
df_epoch_results_inceptionV3
df_epoch_results_inceptionV3.to_csv("arch_inceptionV3_bin4_epoch.csv")
df_val_results_inceptionV3
df_val_results_inceptionV3.to_csv("arch_inceptionV3_bin4.csv")<jupyter_output><empty_output><jupyter_text>Resnet 50 bin1<jupyter_code>with open('/scratch/paulcalle/Epidural_results/archRESNET50_bin1_results/history_K8_outer_k5_val.pickle', 'rb') as handle:
    history_temp = pickle.load(handle)
pd.DataFrame(history_temp)
import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/Epidural_results/archRESNET50_bin1_results/"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_resnet50 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

df_epoch_results_resnet50 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    # Get inner look
    r_inner = re.compile(r'(?<=k)[0-9]+')
    k_val = r_inner.search(item).group(0)
    print("k_val = ", k_val)
    
    with open('/scratch/paulcalle/Epidural_results/archRESNET50_bin1_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    ind_min_val_loss = np.argmin(history_temp['val_loss'])
    if ind_min_val_loss > max_epoch:
        max_epoch = ind_min_val_loss
    
    df_epoch_results_resnet50.loc["K%s_outer"%k_outer, "k%s_val"%k_val] = ind_min_val_loss
    
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][ind_min_val_loss]
    print("val_acc = ", val_acc)
    
    df_val_results_resnet50.loc["K%s_outer"%k_outer,"k%s_val"%k_val] = val_acc
    
print("max epoch = ",max_epoch)
df_epoch_results_resnet50
df_epoch_results_resnet50.to_csv("arch_resnet50_bin1_epoch.csv")
df_val_results_resnet50
df_val_results_resnet50.to_csv("arch_resnet50_bin1.csv")<jupyter_output><empty_output><jupyter_text>Resnet 50 bin2<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/Epidural_results/archRESNET50_bin2_results/"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_resnet50 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

df_epoch_results_resnet50 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])
max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    # Get inner look
    r_inner = re.compile(r'(?<=k)[0-9]+')
    k_val = r_inner.search(item).group(0)
    print("k_val = ", k_val)
    
    with open('/scratch/paulcalle/Epidural_results/archRESNET50_bin2_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    ind_min_val_loss = np.argmin(history_temp['val_loss'])
    if ind_min_val_loss > max_epoch:
        max_epoch = ind_min_val_loss
    
    df_epoch_results_resnet50.loc["K%s_outer"%k_outer, "k%s_val"%k_val] = ind_min_val_loss
    
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][ind_min_val_loss]
    print("val_acc = ", val_acc)
    
    df_val_results_resnet50.loc["K%s_outer"%k_outer,"k%s_val"%k_val] = val_acc
    
print("max epoch = ",max_epoch)
df_epoch_results_resnet50
df_epoch_results_resnet50.to_csv("arch_resnet50_bin2_epoch.csv")
df_val_results_resnet50
df_val_results_resnet50.to_csv("arch_resnet50_bin2.csv")<jupyter_output><empty_output><jupyter_text>Resnet 50 bin3b<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/Epidural_results/archRESNET50_bin3b_results/"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_resnet50 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

df_epoch_results_resnet50 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    # Get inner look
    r_inner = re.compile(r'(?<=k)[0-9]+')
    k_val = r_inner.search(item).group(0)
    print("k_val = ", k_val)
    
    with open('/scratch/paulcalle/Epidural_results/archRESNET50_bin3b_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    print(history_temp)
    
    # Search index of validation
    ind_min_val_loss = np.argmin(history_temp['val_loss'])
    if ind_min_val_loss > max_epoch:
        max_epoch = ind_min_val_loss
    
    df_epoch_results_resnet50.loc["K%s_outer"%k_outer, "k%s_val"%k_val] = ind_min_val_loss
    
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][ind_min_val_loss]
    print("val_acc = ", val_acc)
    
    df_val_results_resnet50.loc["K%s_outer"%k_outer,"k%s_val"%k_val] = val_acc
    
print("max epoch = ",max_epoch)
df_epoch_results_resnet50
df_epoch_results_resnet50.to_csv("arch_resnet50_bin3b_epoch.csv")
df_val_results_resnet50
df_val_results_resnet50.to_csv("arch_resnet50_bin3b.csv")<jupyter_output><empty_output><jupyter_text>Resnet 50 bin4<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/Epidural_results/archRESNET50_bin4_results/"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_resnet50 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

df_epoch_results_resnet50 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    # Get inner look
    r_inner = re.compile(r'(?<=k)[0-9]+')
    k_val = r_inner.search(item).group(0)
    print("k_val = ", k_val)
    
    with open('/scratch/paulcalle/Epidural_results/archRESNET50_bin4_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    print(history_temp)
    
    # Search index of validation
    ind_min_val_loss = np.argmin(history_temp['val_loss'])
    if ind_min_val_loss > max_epoch:
        max_epoch = ind_min_val_loss
    
    df_epoch_results_resnet50.loc["K%s_outer"%k_outer, "k%s_val"%k_val] = ind_min_val_loss
    
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][ind_min_val_loss]
    print("val_acc = ", val_acc)
    
    df_val_results_resnet50.loc["K%s_outer"%k_outer,"k%s_val"%k_val] = val_acc
    
print("max epoch = ",max_epoch)
df_epoch_results_resnet50
df_epoch_results_resnet50.to_csv("arch_resnet50_bin4_epoch.csv")
df_val_results_resnet50
df_val_results_resnet50.to_csv("arch_resnet50_bin4.csv")<jupyter_output><empty_output><jupyter_text>Xception bin1<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/Epidural_results/archXception_bin1_results/"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_xception = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

df_epoch_results_xception = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    # Get inner look
    r_inner = re.compile(r'(?<=k)[0-9]+')
    k_val = r_inner.search(item).group(0)
    print("k_val = ", k_val)
    
    with open('/scratch/paulcalle/Epidural_results/archXception_bin1_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    ind_min_val_loss = np.argmin(history_temp['val_loss'])
    if ind_min_val_loss > max_epoch:
        max_epoch = ind_min_val_loss
    
    df_epoch_results_xception.loc["K%s_outer"%k_outer, "k%s_val"%k_val] = ind_min_val_loss
    
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][ind_min_val_loss]
    print("val_acc = ", val_acc)
    
    df_val_results_xception.loc["K%s_outer"%k_outer,"k%s_val"%k_val] = val_acc
    
print("max epoch = ",max_epoch)
df_epoch_results_xception
df_epoch_results_xception.to_csv("arch_xception_bin1_epoch.csv")
df_val_results_xception
df_val_results_xception.to_csv("arch_xception_bin1.csv")<jupyter_output><empty_output><jupyter_text>Xception bin2<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/Epidural_results/archXception_bin2_results/"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_xception = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

df_epoch_results_xception = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    # Get inner look
    r_inner = re.compile(r'(?<=k)[0-9]+')
    k_val = r_inner.search(item).group(0)
    print("k_val = ", k_val)
    
    with open('/scratch/paulcalle/Epidural_results/archXception_bin2_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    ind_min_val_loss = np.argmin(history_temp['val_loss'])
    if ind_min_val_loss > max_epoch:
        max_epoch = ind_min_val_loss
    
    df_epoch_results_xception.loc["K%s_outer"%k_outer, "k%s_val"%k_val] = ind_min_val_loss
    
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][ind_min_val_loss]
    print("val_acc = ", val_acc)
    
    df_val_results_xception.loc["K%s_outer"%k_outer,"k%s_val"%k_val] = val_acc
    
print("max epoch = ",max_epoch)
df_epoch_results_xception
df_epoch_results_xception.to_csv("arch_xception_bin2_epoch.csv")
df_val_results_xception
df_val_results_xception.to_csv("arch_xception_bin2.csv")<jupyter_output><empty_output><jupyter_text>Xception bin3b<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/Epidural_results/archXception_bin3b_results/"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_xception = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

df_epoch_results_xception = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    # Get inner look
    r_inner = re.compile(r'(?<=k)[0-9]+')
    k_val = r_inner.search(item).group(0)
    print("k_val = ", k_val)
    
    with open('/scratch/paulcalle/Epidural_results/archXception_bin3b_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    ind_min_val_loss = np.argmin(history_temp['val_loss'])
    if ind_min_val_loss > max_epoch:
        max_epoch = ind_min_val_loss
    
    df_epoch_results_xception.loc["K%s_outer"%k_outer, "k%s_val"%k_val] = ind_min_val_loss
    
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][ind_min_val_loss]
    print("val_acc = ", val_acc)
    
    df_val_results_xception.loc["K%s_outer"%k_outer,"k%s_val"%k_val] = val_acc
    
print("max epoch = ",max_epoch)
df_epoch_results_xception
df_epoch_results_xception.to_csv("arch_xception_bin3b_epoch.csv")
df_val_results_xception
df_val_results_xception.to_csv("arch_xception_bin3b.csv")<jupyter_output><empty_output><jupyter_text>Xception bin4<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/Epidural_results/archXception_bin4_results/"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_xception = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

df_epoch_results_xception = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                     columns=["k%s_val"%i for i in np.arange(1,9,1)])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    # Get inner look
    r_inner = re.compile(r'(?<=k)[0-9]+')
    k_val = r_inner.search(item).group(0)
    print("k_val = ", k_val)
    
    with open('/scratch/paulcalle/Epidural_results/archXception_bin4_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    ind_min_val_loss = np.argmin(history_temp['val_loss'])
    if ind_min_val_loss > max_epoch:
        max_epoch = ind_min_val_loss
    
    df_epoch_results_xception.loc["K%s_outer"%k_outer, "k%s_val"%k_val] = ind_min_val_loss
    
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][ind_min_val_loss]
    print("val_acc = ", val_acc)
    
    df_val_results_xception.loc["K%s_outer"%k_outer,"k%s_val"%k_val] = val_acc
    
print("max epoch = ",max_epoch)
df_epoch_results_xception
df_epoch_results_xception.to_csv("arch_xception_bin4_epoch.csv")
df_val_results_xception
df_val_results_xception.to_csv("arch_xception_bin4.csv")<jupyter_output><empty_output><jupyter_text>Resnet 50 test bin1<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/Epidural_results/archRESNET50_bin1_test_results"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_resnet50 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                                          columns = ["accuracy"])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    with open('/scratch/paulcalle/Epidural_results/archRESNET50_bin1_test_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    
   
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][-1]
    print("val_acc = ", val_acc)
    
    df_val_results_resnet50.loc["K%s_outer"%k_outer] = val_acc
    
print("max epoch = ",max_epoch)
df_val_results_resnet50
df_val_results_resnet50.to_csv("arch_resnet50_test_bin1.csv")<jupyter_output><empty_output><jupyter_text>Resnet 50 test bin2<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/Epidural_results/archRESNET50_bin2_test_results"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_resnet50 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                                          columns = ["accuracy"])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    with open('/scratch/paulcalle/Epidural_results/archRESNET50_bin2_test_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    
   
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][-1]
    print("val_acc = ", val_acc)
    
    df_val_results_resnet50.loc["K%s_outer"%k_outer] = val_acc
    
print("max epoch = ",max_epoch)
df_val_results_resnet50
df_val_results_resnet50.to_csv("arch_resnet50_test_bin2.csv")<jupyter_output><empty_output><jupyter_text>Resnet 50 test bin3b<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/Epidural_results/archRESNET50_bin3b_test_results"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_resnet50 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                                          columns = ["accuracy"])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    with open('/scratch/paulcalle/Epidural_results/archRESNET50_bin3b_test_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    
   
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][-1]
    print("val_acc = ", val_acc)
    
    df_val_results_resnet50.loc["K%s_outer"%k_outer] = val_acc
    
print("max epoch = ",max_epoch)
df_val_results_resnet50
df_val_results_resnet50.to_csv("arch_resnet50_test_bin3b.csv")<jupyter_output><empty_output><jupyter_text>Resnet 50 test bin4<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/Epidural_results/archRESNET50_bin4_test_results"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_resnet50 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,9,1)],
                                          columns = ["accuracy"])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    with open('/scratch/paulcalle/Epidural_results/archRESNET50_bin4_test_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    
   
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][-1]
    print("val_acc = ", val_acc)
    
    df_val_results_resnet50.loc["K%s_outer"%k_outer] = val_acc
    
print("max epoch = ",max_epoch)
df_val_results_resnet50
df_val_results_resnet50.to_csv("arch_resnet50_test_bin4.csv")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12850217035909578, 'fraction_numerical': 0.0190540616720221, 'mean_word_length': 4.104892086330935, 'pattern_counts': {'":': 0, '<': 111, '<?xml version=': 0, '>': 92, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '19', 'dir': 'jupyter-structured-clean-dedup', 'id': '487006', 'license': 'MIT', 'n_tokens_mistral': 14304, 'n_tokens_neox': 14320, 'n_words': 2246, 'path': 'Classification/Processing_results.ipynb', 'repo_name': 'thepanlab/OCT-Epidural', 'size': '35478'}