<jupyter_start><jupyter_text>TOP K precisionFor the top K in FIGRank, how many match the most influential by human evaluationFor example, one obse nominated account x, y, z in a surveyFor all the FIGs of the observer including all topics and polarity, topk(x) is the best ranking of x.<jupyter_code>topk = lambda df, k: (df[range(1, 5)] <= k).sum().sum() / (~np.isnan(df[range(1, 5)])).sum().sum()
pab = [p
    for p in [0.85, 0.9, 0.7, 0.5, 0.3, 0.1]
#     for a in [0.5, 1.0, 1.5, 2.0]
#     for b in [0.5, 1.0, 1.5, 2.0]
    # for a in [0.5, 0.9, 0.7, 0.3, 0.1]
    # for b in [0.5, 0.9, 0.7, 0.3, 0.1]
]

res_fig2 = {"fig2": fig2()}
res_fig1 = {p: fig1(p) for p in tqdm(pab)}
res_fig3 = {p: fig3(p) for p in tqdm(pab)}
eval_fig1 = {
    p: {
        k: topk(pd.DataFrame.from_records(res_fig1[p]), k)
        for k in [1, 2, 3, 4, 5, 10, 15, 20, 30, 40, 50, 100, 116]
    }
    for p in tqdm(res_fig1.keys())
}

eval_fig2 = {
    key: {
        k: topk(pd.DataFrame.from_records(res_fig2[key]), k)
        for k in [1, 2, 3, 4, 5, 10, 15, 20, 30, 40, 50, 100, 116]
    }
    for key in tqdm(res_fig2.keys())
}

eval_fig3 = {
    p: {
        k: topk(pd.DataFrame.from_records(res_fig3[p]), k)
        for k in [1, 2, 3, 4, 5, 10, 15, 20, 30, 40, 50, 100, 116]
    }
    for p in tqdm(res_fig3.keys())
}
report_fig1 = pd.DataFrame.from_dict(eval_fig1, orient="index")
display(report_fig1)
idxmax = report_fig1.idxmax()
display(pd.concat([report_fig1.loc[ind, :] for ind in set(idxmax)], axis=1).T)
report_fig2 = pd.DataFrame.from_dict(eval_fig2, orient="index")
display(report_fig2)
idxmax = report_fig2.idxmax()
display(pd.concat([report_fig2.loc[ind, :] for ind in set(idxmax)], axis=1).T)
report_fig3 = pd.DataFrame.from_dict(eval_fig3, orient="index")
display(report_fig3)
idxmax = report_fig3.idxmax()
display(pd.concat([report_fig3.loc[ind, :] for ind in set(idxmax)], axis=1).T)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1767466110531804, 'fraction_numerical': 0.08133472367049009, 'mean_word_length': 3.525943396226415, 'pattern_counts': {'":': 1, '<': 6, '<?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': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '548347', 'license': 'MIT', 'n_tokens_mistral': 937, 'n_tokens_neox': 842, 'n_words': 223, 'path': 'open/code/rank_account.ipynb', 'repo_name': 'ruiliu310/dartpost-research', 'size': '1918'}