<jupyter_start><jupyter_text>Extracting maximum likelihood estimates from a `model_result`If you want to get the stats out-of a fitted model, use the `evo.tabulate_stats()` app.We first fit a model.<jupyter_code>from cogent3.app import io, evo

loader = io.load_aligned(format="fasta", moltype="dna")
aln = loader("../data/primate_brca1.fasta")
model = evo.model("GN", tree="../data/primate_brca1.tree")
result = model(aln)<jupyter_output><empty_output><jupyter_text>Create and apply `tabulate_stats` app<jupyter_code>tabulator = evo.tabulate_stats()
tabulated = tabulator(result)
tabulated<jupyter_output><empty_output><jupyter_text>`tabulated` is a `tabular_result` instance which, like other result types, has `dict` like behaviour. It also contains key/value pairs for each model parameter type.  Edge parametersThese are all parameters that differ between edges. Since the current model is time-homogeneous (a single rate matrix), only the table only has entries for the branch scalar (denoted "length").<jupyter_code>tabulated["edge params"]<jupyter_output><empty_output><jupyter_text>**NOTE:** Unless the model is time-reversible, the lengths in that table are not ENS ([Kaehler et al](https://academic.oup.com/gbe/article-lookup/doi/10.1093/gbe/evw308)). As we used a non-stationary nucleotide model in this example, the length values are a scalar used to adjust the matrices during optimisation.  Global parametersIn this example, these are the elements of the rate matrix.<jupyter_code>tabulated["global params"]<jupyter_output><empty_output><jupyter_text>Motif parametersIn the current example, these are estimates of the nucleotide probabilities in the unobserved ancestor.<jupyter_code>tabulated["motif params"]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09692132269099202, 'fraction_numerical': 0.0068415051311288486, 'mean_word_length': 6.9411764705882355, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 1, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '27027', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 547, 'n_tokens_neox': 525, 'n_words': 170, 'path': 'doc/app/evo-extract-model-stats.ipynb', 'repo_name': 'tla256/cogent3', 'size': '1754'}