<jupyter_start><jupyter_text>Explained variance<jupyter_code>ica_data = load_json_model('../paeru_104_imodulon_ica.json')
explained_variance_values = {}
for i in ica_data.A.index:
    explained_variance_values.update({i:explained_variance(ica_data,imodulons=i)})
fig,ax = plt.subplots(figsize=[7,5])
count = 0
sorted_dict = []
for i in sorted(explained_variance_values.values(), reverse = True):
    for j in explained_variance_values.keys():
        if explained_variance_values[j] == i:
            sorted_dict.append(j)
            
for i in sorted(explained_variance_values.values(),reverse =True):
    ax.bar(count,i)
    count += 1
    
ax.set_title("Explained Variance Plot",fontsize=14)
ax.set_ylabel("Explained Variance")
plt.xticks([],fontsize=12)


total = 0
for i in sorted(explained_variance_values.values(),reverse =True):
    total+=i
total<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12655367231638417, 'fraction_numerical': 0.013559322033898305, 'mean_word_length': 5.374100719424461, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '42465', 'license': 'MIT', 'n_tokens_mistral': 333, 'n_tokens_neox': 319, 'n_words': 51, 'path': 'notebooks/05_ica_summary.ipynb', 'repo_name': 'akanksha-r/modulome_paeru1.0', 'size': '885'}