<jupyter_start><jupyter_text>Scenario D - Peakshape Variation (results evaluation)This file is used to evaluate the inference (numerical) results.The model used in the inference of the parameters is formulated as follows:\begin{equation}\large y = f(x) = \sum\limits_{m=1}^M \big[A_m \cdot f_{pseudo-Voigt}(x)\big] + \epsilon\end{equation}where:\begin{equation}\large f_{pseudo-Voigt}(x) = \eta \cdot \frac{\sigma_m^2}{(x-\mu_m)^2 + \sigma_m^2} + (1 - \eta) \cdot e^{-\frac{(x-\mu_m)^2}{2\cdot\sigma_m^2}}\end{equation}<jupyter_code>%matplotlib inline
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import pymc3 as pm
import arviz as az
import seaborn as sns

#az.style.use('arviz-darkgrid')

print('Running on PyMC3 v{}'.format(pm.__version__))<jupyter_output>WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.<jupyter_text>Import local modules<jupyter_code>import sys
sys.path.append('../../modules')
import results as res
import figures as fig<jupyter_output><empty_output><jupyter_text>Load results and extract convergence information<jupyter_code># list of result files to load
filelst = ['./scenario_peakshape_mruns.csv']

ldf = res.load_results(filelst)
# extract the convergence results per model
labellist = [0.0, 0.25, 0.5, 0.75, 1.0]
dres = res.get_model_summary(ldf, labellist)
# figure size and color mapping
figs=(8,8)

col = "Blues"
col_r = col + "_r"<jupyter_output><empty_output><jupyter_text>Heatmaps of n-peak model vs. n-peak number in dataset  WAIC<jupyter_code>fig.plot_heatmap(dres['waic'], labellist, title="", color=col, fsize=figs, fname="hmap_waic", precision=".0f")<jupyter_output><empty_output><jupyter_text>Rhat<jupyter_code>fig.plot_heatmap(dres['rhat'], labellist, title="", color=col, fsize=figs, fname="hmap_rhat", precision=".2f")<jupyter_output><empty_output><jupyter_text>R2<jupyter_code>fig.plot_heatmap(dres['r2'], labellist, title="", color=col_r, fsize=figs, fname="hmap_r2", precision=".2f")<jupyter_output><empty_output><jupyter_text>BFMI<jupyter_code>fig.plot_heatmap(dres['bfmi'], labellist, title="", color=col_r, fsize=figs, 
                     fname="hmap_bfmi", precision=".2f")<jupyter_output><empty_output><jupyter_text>MCSE<jupyter_code>fig.plot_heatmap(dres['mcse'], labellist, title="", color=col, fsize=figs, fname="hmap_mcse", precision=".2f")<jupyter_output><empty_output><jupyter_text>Noise<jupyter_code>fig.plot_heatmap(dres['noise'], labellist, title="", color=col, fsize=figs, 
                     fname="hmap_noise", precision=".2f")<jupyter_output><empty_output><jupyter_text>ESS<jupyter_code>fig.plot_heatmap(dres['ess'], labellist, title="", color=col_r, fsize=figs, fname="hmap_ess", precision=".0f")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15574067366896052, 'fraction_numerical': 0.01231437884824339, 'mean_word_length': 7.395136778115502, 'pattern_counts': {'":': 0, '<': 40, '<?xml version=': 0, '>': 40, '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': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '271727', 'license': 'MIT', 'n_tokens_mistral': 1085, 'n_tokens_neox': 1050, 'n_words': 186, 'path': 'code/scenarios/scenario_d/scenario_peakshape_evaluation.ipynb', 'repo_name': 'jnispen/PPSDA', 'size': '2761'}