public class BanditTrainer extends Object
Constructor and Description |
---|
BanditTrainer() |
Modifier and Type | Method and Description |
---|---|
static double |
averageRegret(String outputFile,
int[] sizes,
int replications,
int bandits)
Computes average regret relative to perfect knowledge given uniform random probabilities.
|
static double |
commitTime(String outputFile,
int n,
double p1,
double p2,
int cutoff)
Records which bandit was chosen for many runs of the same scenario.
|
static void |
main(String[] args) |
static double |
totalRegret(String cumulativeOutput,
String perTurnOutput,
int replications,
int bandits,
int maxSteps,
BanditFactory modelFactory,
DistributionGenerator refSampler)
Computes average regret relative to perfect knowledge given uniform random probabilities.
|
public static void main(String[] args) throws FileNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException, InterruptedException
public static double commitTime(String outputFile, int n, double p1, double p2, int cutoff) throws FileNotFoundException
plot(tapply(z$k, floor(z$i/10), mean), type='l')
outputFile
- Where to write resultsn
- How many steps to followp1
- First probability of rewardp2
- Second probability of rewardcutoff
- Only keep results after this many stepsFileNotFoundException
- If the directory holding the output directory doesn't exist.public static double averageRegret(String outputFile, int[] sizes, int replications, int bandits) throws FileNotFoundException
> x=read.delim(file='~/Apache/storm-aggregator/regret.tsv') > bxp(list(com.mapr.stats=t(as.matrix(x[,2:6])), n=rep(1000,times=8),names=x$n))
outputFile
- Where to put the outputsizes
- The different size experiments to usereplications
- Number of times to repeat the experimentbandits
- How many bandits to simulateFileNotFoundException
- If the output file can't be opened due to a missing directory.public static double totalRegret(String cumulativeOutput, String perTurnOutput, int replications, int bandits, int maxSteps, BanditFactory modelFactory, DistributionGenerator refSampler) throws FileNotFoundException
> x=read.delim(file='~/Apache/storm-aggregator/regret.tsv') > bxp(list(com.mapr.stats=t(as.matrix(x[,2:6])), n=rep(1000,times=8),names=x$n))
cumulativeOutput
- Where to write the cumulative regret resultsperTurnOutput
- Where to write the per step regret resultsreplications
- How many times to replicate the experimentbandits
- How many bandits to emulatemaxSteps
- Maximum number of trials to run per experimentmodelFactory
- How to construct the solver.refSampler
- How to get reward distributions for banditsFileNotFoundException
- If the output file can't be opened due to
a missing directory.Copyright © 2013. All Rights Reserved.