<jupyter_start><jupyter_text>model_conjugate <- stan_model("bernoulli-bandits-conjugate.stan")fit_bernoulli_bandit <- function(y, z, K) {  data <- list(K = K, N = length(y), y = y, z = z)  sampling(model_conjugate, algorithm = "Fixed_param", data = data,            warmup = 0, chains = 1, iter = 1000, refresh = 0)}expectation <- function(fit, param) {  posterior_summary <- summary(fit, pars = param, probs = c())  posterior_summary$summary[ , "mean"]}thompson_sampling_policy <- function(y, z, K) {  posterior <- fit_bernoulli_bandit(y, z, K)  p_best <- expectation(posterior, "is_best")  sample(K, 1, replace = TRUE, p_best)}<jupyter_code>model = compile_model(filename)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15482954545454544, 'fraction_numerical': 0.011363636363636364, 'mean_word_length': 5.527777777777778, 'pattern_counts': {'":': 0, '<': 13, '<?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': '389719', 'license': 'MIT', 'n_tokens_mistral': 276, 'n_tokens_neox': 253, 'n_words': 53, 'path': 'useStan.ipynb', 'repo_name': 'Faur/Multi-Armed-Bayesian-Bandits', 'size': '704'}