<jupyter_start><jupyter_text>Plot weight against LOR<jupyter_code>from seffnet.default_predictor import predictor
from seffnet.constants import DEFAULT_WEIGHTED_FULLGRAPH_PICKLE
import pybel
import networkx as nx
from tqdm import tqdm_notebook as tqdm
graph = pybel.from_pickle(DEFAULT_WEIGHTED_FULLGRAPH_PICKLE)
info = {}
for edge in tqdm(graph.edges()):
    if edge[0].namespace == 'pubchem.compound':
        if edge[1].namespace != 'uniprot':
            continue 
        r = predictor.find_new_relation(
        source_curie=edge[0].namespace+':'+edge[0].identifier,
        target_curie=edge[1].namespace+':'+edge[1].identifier,
        )
        for iden, edge_d in graph[edge[0]][edge[1]].items():
            weight = edge_d['weight']
        lor = r['lor']
        info[edge] = (weight, lor)
len(info.keys())
weights = [w for w, lor in info.values()]
lors = [lor for w, lor in info.values()]
len(lors)
import matplotlib.pyplot as plt
plt.plot(lors, weights, 'bo')
plt.ylabel('weights')
plt.xlabel('lors')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13541666666666666, 'fraction_numerical': 0.007575757575757576, 'mean_word_length': 4.15609756097561, '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': '163401', 'license': 'MIT', 'n_tokens_mistral': 387, 'n_tokens_neox': 379, 'n_words': 79, 'path': 'notebooks/plot_weight_against_lor.ipynb', 'repo_name': 'AldisiRana/SE_KGE', 'size': '1056'}