예제 #1
0
    return regret, pulls


experiment = Experiment(6)
experiment.log_code()

N = 50
N1 = 1
pz = .4
q = (0.00001, 0.00001, .4, .65)
epsilon = .3
pY = ParallelConfounded.pY_epsilon_best(q, pz, epsilon)

simulations = 10000

model = ScaleableParallelConfounded(q, pz, pY, N1, N - N1)

T_vals = range(25, 626, 25)

algorithms = [
    GeneralCausal(),
    SuccessiveRejects(),
    AlphaUCB(2),
    ThompsonSampling()
]

regret, pulls = regret_vs_T(model, algorithms, T_vals, simulations=simulations)

experiment.plot_regret(regret, T_vals, "T", algorithms, legend_loc=None)
예제 #2
0
experiment = Experiment(1)
experiment.log_code()

# Experiment 1
N = 50
epsilon = .3
simulations = 10000
T = 400
algorithms = [
    GeneralCausal(truncate='None'),
    ParallelCausal(),
    SuccessiveRejects(),
    AlphaUCB(2),
    ThompsonSampling()
]
m_vals = range(2, N, 2)

regret, models = regret_vs_m(algorithms,
                             m_vals,
                             N,
                             T,
                             epsilon,
                             simulations=simulations)

experiment.plot_regret(regret,
                       m_vals,
                       "m",
                       algorithms,
                       legend_loc="lower right")
experiment.log_state(globals())
예제 #3
0
    
    return m_vals,regret,models
    
   
experiment = Experiment(4)
experiment.log_code()
    
N = 50
N1_vals = range(1,N,3)
pz = .4
q = (0.00001,0.00001,.4,.65)
epsilon = .3
simulations = 10000
T = 400
algorithms = [SuccessiveRejects(),GeneralCausal(),AlphaUCB(2),ThompsonSampling()]


epsilon = .3
pY = ParallelConfounded.pY_epsilon_best(q,pz,epsilon)

m_vals,regret,models = regret_vs_m_general(algorithms,N1_vals,N,T,pz,pY,q,epsilon,simulations = simulations)
experiment.plot_regret(regret,m_vals,"m",algorithms,legend_loc = "lower right",legend_extra = [ParallelCausal])