<jupyter_start><jupyter_text>heatmaps_list[0].keys()<jupyter_code>heatmaps_list[-1].keys()<jupyter_output><empty_output><jupyter_text>ssims = {}ssims['normal'] = {}ssims['tumor'] = {}for heatmaps in heatmaps_list[4:]:    base = heatmaps['rep0']    for r in range(1, rep):        for m in base.keys():            if not m in ssims[heatmaps['type']]:                ssims[heatmaps['type']][m] = []            import pdb; pdb.set_trace()            if m != 'Squaregrid':                ssims[heatmaps['type']][m].append(ssim(base[m], heatmaps['rep{}'.format(r)][m])) SSIM for different repetitions of LIMEfor _type in ['normal', 'tumor']:    for m in  base.keys():  ssims[_type].keys():        if m != 'Squaregrid':            print _type, m, np.mean(ssims[_type][m]), np.std(ssims[_type][m])<jupyter_code>h['path']
for h in heatmaps_list[:]:
    print '\n'+h['path'], h['pred']
    if 'normal' in h['path']:
        type_ ='normal'
    else:
        type_='tumor'
    
    for m in ['SLIC', 'Felzenszwalb']:#, 'AVG']:
        #print m+'\n'
        list_ = []
        for rep in range(1,10):
            #print rep, ssim(h['rep0'][m], h['rep{}'.format(rep)][m])
            list_.append(ssim(h['rep{}'.format(rep-1)][m], h['rep{}'.format(rep)][m]))
        print m, np.mean(list_), np.std(list_)
img_idx=0
alpha=0.8
figsize = (12.8, 4.8)
fig, axes = plt.subplots(nrows=1, ncols=4, figsize=figsize)
axes[0].set_title('original', size='xx-large')
axes[1].set_title('SLIC', size='xx-large')
axes[2].set_title('Felzenszwalb', size='xx-large')
#axes[3].set_title('Quickshift', size='xx-large')
#axes[3].set_title('AVG', size='xx-large')

path = heatmaps_list[img_idx]['path'].split(', ')[1][:-5]
print path
masks = data['pannuke'][path+'mask'][0]
img = np.asarray(data['pannuke'][path+'patch'][0], dtype=np.uint8)
#binary_masks = binarize_all_masks(masks)

#axes[i, j].imshow(np.asarray(heatmaps[i]['original'], dtype=np.uint8))
axes[0].imshow(np.asarray(heatmaps_list[img_idx]['original'],dtype=np.uint8))

axes[1].imshow(heatmaps_list[img_idx]['rep0']['SLIC'], cmap='jet')
axes[2].imshow(heatmaps_list[img_idx]['rep6']['Felzenszwalb'], cmap='jet')
#axes[3].imshow(heatmaps_list[img_idx]['AVG'], cmap='jet')

for i in range(4):
    axes[i].axis('off')
plt.show()<jupyter_output>pannuke/fold3/509/normal/center/
{'fraction_non_alphanumeric': 0.22448979591836735, 'fraction_numerical': 0.018671298306556665, 'mean_word_length': 4.605839416058394, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '381760', 'license': 'MIT', 'n_tokens_mistral': 952, 'n_tokens_neox': 912, 'n_words': 141, 'path': 'Quantitative_eval_pannuke.ipynb', 'repo_name': 'maragraziani/XAI_evaluation', 'size': '2303'}