<jupyter_start><jupyter_text>Calculate R2<jupyter_code>R2 = MI_DF[['R2_exp', 'R2_concat', 'R2_power']]
R2.columns = ['exp', 'combined', 'power-law']
R2.index = labels
R2 = R2.T
R2<jupyter_output><empty_output><jupyter_text>AICc<jupyter_code>AICcs = MI_DF[['AICc_exp', 'AICc_concat', 'AICc_power']]
AICcs.columns = ['exp', 'combined.', 'power-law']
AICcs.index = labels
AICcs = AICcs.T
AICcs<jupyter_output><empty_output><jupyter_text>$\Delta$AIC<jupyter_code>delta_AICcs = AICcs.T - np.repeat(np.min(AICcs.T.values, axis=1),3).reshape(len(labels),3)
delta_AICcs = delta_AICcs.T
delta_AICcs<jupyter_output><empty_output><jupyter_text>relative likelihood<jupyter_code>relative_likelihoods = mf.relative_likelihood(delta_AICcs)
relative_likelihoods<jupyter_output><empty_output><jupyter_text>relative probability of models<jupyter_code>prob_models = mf.Prob_model_Given_data_and_models(relative_likelihoods)
prob_models<jupyter_output><empty_output><jupyter_text>Join tables<jupyter_code>AICcs['superlabel'] = 'AICc'
relative_likelihoods['superlabel'] = 'Relative likelihood'
R2['superlabel'] = '$r^2$'
prob_models['superlabel'] = 'Relative probability'
results_table = pd.concat([
    AICcs,
    R2,
    relative_likelihoods,
    prob_models
]).round(3).replace(0, '<0.001').replace(1, '>0.999')
results_table[''] = results_table.index
results_table.set_index(['superlabel', ''], inplace=True)
results_table
results_string = results_table.to_latex(bold_rows=True, escape=False)\
      .replace('>', '$>$')\
      .replace('<', '$<$')\
      .replace('superlabel', '')\
     .replace('\n\\textbf', '\n\midrule\n\\textbf')
print(results_string)<jupyter_output>\begin{tabular}{lll}
\toprule
                     &           &  Cooking \\
\midrule
\textbf{} & {} &          \\
\midrule
\midrule
\textbf{AICc} & \textbf{exp} & -236.312 \\
                     & \textbf{combined.} & -269.057 \\
                     & \textbf{power-law} & -269.846 \\
\midrule
\textbf{$r^2$} & \textbf{exp} &     0.98 \\
                     & \textbf{combined} &    0.991 \\
                     & \textbf{power-law} &    0.991 \\
\midrule
\textbf{Relative likelihood} & \textbf{exp} &   $<$0.001 \\
                     & \textbf{combined.} &    0.674 \\
                     & \textbf{power-law} &   $>$0.999 \\
\midrule
\textbf{Relative probability} & \textbf{exp} &   $<$0.001 \\
                     & \textbf{combined.} &    0.403 \\
                     & \textbf{power-law} &    0.597 \\
\bottomrule
\end{tabular}
{'fraction_non_alphanumeric': 0.1757405924739792, 'fraction_numerical': 0.03242594075260208, 'mean_word_length': 3.3385416666666665, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '248456', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 986, 'n_tokens_neox': 939, 'n_words': 114, 'path': 'notebooks/epic-kitchens2/3.0-epic-kitchens-plotting-results-dataframe.ipynb', 'repo_name': 'timsainb/LongRangeSequentialOrgPaper', 'size': '2498'}