Esempio n. 1
0
def runner(num_experts, sample_id):
    #(num_experts, outcomes, experts_reports, T, num_repetitions) = set_params('reader_forecasts1920.csv',num_experts,sample_id)
    (num_experts, outcomes, experts_reports, T,
     num_repetitions) = set_params('', num_experts, sample_id)

    regret_elf(num_experts, outcomes, experts_reports, T, num_repetitions,
               sample_id)

    regret_mwu(num_experts, outcomes, experts_reports, T, num_repetitions,
               sample_id)

    regret_wsu(num_experts, outcomes, experts_reports, T, num_repetitions,
               sample_id)

    regret_hedge(num_experts, outcomes, experts_reports, T, num_repetitions,
                 sample_id)

    regret_exp3(num_experts, outcomes, experts_reports, T, num_repetitions,
                sample_id)

    regret_wsux(num_experts, outcomes, experts_reports, T, num_repetitions,
                sample_id)
Esempio n. 2
0
cpy2 = deepcopy(bids)
cp3 = deepcopy(bids)
noise_cpy1 = deepcopy(noise)
noise_cpy2 = deepcopy(noise)
#winexp regret has to be returned as a list of all the regrets for all the rounds
#threshold passed as an argument is the ctr above which I get clicked
(winexp, winexp_regrets) = regret_winexp(bidder_winexp, T, num_repetitions,
                                         num_bidders, num_slots, outcome_space,
                                         rank_scores, ctr, reserve, values,
                                         cpy1, threshold, noise_cpy1,
                                         num_adaptive)

#this has to be returned as a list of all the regrets for all the rounds
#no need to observe threshold
(exp3, exp3_regrets) = regret_exp3(bidder_exp3, T, num_repetitions,
                                   num_bidders, num_slots, outcome_space,
                                   rank_scores, ctr, reserve, values, cpy2,
                                   threshold, noise_cpy2, num_adaptive)

final_winexp = np.array(
    [winexp[i] for i in range(min_num_rounds, max_num_rounds)])
winexp_arr = np.array(winexp_regrets)  #size repetitions x T
winexp_10_percentile = [
    np.percentile(winexp_arr[:, t], 10) for t in range(0, T)
]
winexp_90_percentile = [
    np.percentile(winexp_arr[:, t], 90) for t in range(0, T)
]
final_exp3 = np.array([exp3[i] for i in range(min_num_rounds, max_num_rounds)])
exp3_arr = np.array(exp3_regrets)  #size repetitions x T
exp3_10_percentile = [np.percentile(exp3_arr[:, t], 10) for t in range(0, T)]
exp3_90_percentile = [np.percentile(exp3_arr[:, t], 90) for t in range(0, T)]
Esempio n. 3
0
    ]
    principal_dgrind_regr = [
        Principal(T, calA, num_repetitions, p, a_G)
        for _ in range(0, num_repetitions)
    ]
    principal_exp3 = [
        Principal(T, calA, num_repetitions, p, a_G)
        for _ in range(0, num_repetitions)
    ]

    agents_exp3 = [Agent(t, agent_types, cp_xreal, delta) for t in range(T)]
    agents_dgrind_regr = [
        Agent(t, agent_types, cp_xreal, delta) for t in range(T)
    ]

    oracle_exp3 = Oracle(deepcopy(agents_exp3), calA, T)
    resp_lst_exp3 = deepcopy(resp_lst_dgrind)
    oracle_dgrind_regr = Oracle(deepcopy(agents_dgrind_regr), calA, T)
    resp_lst_dgrind_regr = deepcopy(resp_lst_dgrind)

    (dgrind, dgrind_regrets) = regret_dgrind(0, principal_dgrind,
                                             agents_dgrind, oracle_dgrind,
                                             resp_lst_dgrind, T,
                                             num_repetitions, num_agents, dim)
    (exp3, exp3_regrets) = regret_exp3(principal_exp3, agents_exp3,
                                       oracle_exp3, resp_lst_exp3, T,
                                       num_repetitions, num_agents, dim)
    (dgrind_regress, dgrind_regrets_regress) = regret_dgrind(
        1, principal_dgrind_regr, agents_dgrind_regr, oracle_dgrind_regr,
        resp_lst_dgrind_regr, T, num_repetitions, num_agents, dim)