def fit_comparison(sessions_A, sessions_B, agent, fig_no = 1, title = None, max_change = 0.005): ''' Fit the two groups of sessions with the specified agent and plot the results on the same axis. ''' fit_A = mf.fit_population(sessions_A, agent, max_change = max_change) fit_B = mf.fit_population(sessions_B, agent, max_change = max_change) rp.scatter_plot_comp(fit_A, fit_B, fig_no = fig_no) if title:p.title(title)
def plots(sessions_A, sessions_B, RL_agent, LR_agent = None, title = None, max_change_LR = 0.001, max_change_RL = 0.01, test_time = 20, parallel = False, test_data = None): if test_data: RL_fit_A = test_data['RL_fit']['fit_A'] RL_fit_B = test_data['RL_fit']['fit_B'] LR_fit_A = test_data['LR_fit']['fit_A'] LR_fit_B = test_data['LR_fit']['fit_B'] title = test_data['title'] else: RL_fit_A = mf.fit_population(sessions_A, RL_agent, max_change = max_change_RL, parallel = parallel) RL_fit_B = mf.fit_population(sessions_B, RL_agent, max_change = max_change_RL, parallel = parallel) LR_fit_A = mf.fit_population(sessions_A, LR_agent, max_change = max_change_LR, parallel = parallel) LR_fit_B = mf.fit_population(sessions_B, LR_agent, max_change = max_change_LR, parallel = parallel) trial_rate_comparison(sessions_A, sessions_B, test_time, 1, title) reversal_comparison(sessions_A, sessions_B, 2, title) rp.scatter_plot_comp(LR_fit_A, LR_fit_B, fig_no = 3) p.title(title) rp.pop_fit_comparison(RL_fit_A, RL_fit_B, fig_no = 4, normalize = False) p.suptitle(title) abs_preference_comparison(sessions_A, sessions_B, RL_fit_A, RL_fit_B, RL_agent, 5, title)