<jupyter_start><jupyter_text>RBA-M Algorithm Behavior<jupyter_code>reward_probabilities = {0: [[0.1, 0.1, 0.1, 0.9, 0.1], 
                            [0.1, 0.1, 0.9, 0.1, 0.1], 
                            [0.1, 0.9, 0.1, 0.1, 0.1], 
                            [0.9, 0.1, 0.1, 0.1, 0.1], 
                            [0.25, 0.25, 0.25, 0.25]],
                        
                       1500: [[0.9, 0.1, 0.1, 0.1, 0.1], 
                             [0.1, 0.9, 0.1, 0.1, 0.1], 
                             [0.1, 0.1, 0.9, 0.1, 0.1], 
                             [0.1, 0.1, 0.1, 0.9, 0.1], 
                             [0.25, 0.25, 0.25, 0.25]]} #Rank weight.

number_of_pulls = 3000
number_of_simulation = 1000

mcs = simulator.RankedMonteCarloSimulator()
results_ths = mcs.run("rbam", algs.ThompsomSampling, reward_probabilities, number_of_simulation, number_of_pulls)
results_ucb1 = mcs.run("rbam", algs.UCB1, reward_probabilities, number_of_simulation, number_of_pulls)
results_ucbtuned = mcs.run("rbam", algs.UCBTuned, reward_probabilities, number_of_simulation, number_of_pulls)

plot_results_proba('Thompsom Sampling', results_ths)
plot_results_proba('UCB1', results_ucb1)
plot_results_proba('UCB-Tuned', results_ucbtuned)
plot_result_rewards(results_ucb1, results_ths, results_ucbtuned)
print('Cumulative Rewards for UCB1: {}'.format(results_ucb1[3][-1]))
print('Cumulative Rewards for UCB Tuned: {}'.format(results_ucbtuned[3][-1]))
print('Cumulative Rewards for THS: {}'.format(results_ths[3][-1]))<jupyter_output>Cumulative Rewards for UCB1: 1283.8849999999693
Cumulative Rewards for UCB Tuned: 1687.4009999999248
Cumulative Rewards for THS: 1341.8469999999625
{'fraction_non_alphanumeric': 0.1457465794170137, 'fraction_numerical': 0.10826888756692445, 'mean_word_length': 2.496881496881497, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 3, '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': '292163', 'license': 'Apache-2.0', 'n_tokens_mistral': 783, 'n_tokens_neox': 658, 'n_words': 120, 'path': 'Monte_Carlo_RBAM.ipynb', 'repo_name': 'rsoaresp/mabalgs', 'size': '1681'}