| R6_hype | R Documentation |
Hyperparameter optimization
Hyperparameter optimization
XData frame of inputs that have been evaluated or will be evaluated next.
ZOutput at X
runtimeThe time it took to evaluate each row of X
parnamesNames of the parameters
parlowerrawLower bounds for each parameter on raw scale
parupperrawUpper bounds for each parameter on raw scale
parlowertransLower bounds for each parameter on transformed scale
paruppertransUpper bounds for each parameter on transformed scale
parlistList of all parameters
modlistA list with details about the model. The user shouldn't ever edit this directly.
ffexpAn ffexp R6 object used to run the experiment and store the results.
eval_funcThe function we evaluate.
extract_output_funcA function that takes in the output from 'eval_func' and returns the value we are trying to minimize.
par_all_ctsAre all the parameters continuous?
verboseHow much should be printed? 0 is none, 1 is standard, 2 is more, 5+ is a lot
modGaussian process model used to predict what the output will be.
new()Create hype R6 object.
R6_hype$new( eval_func, ..., X0 = NULL, Z0 = NULL, n_lhs, extract_output_func, verbose = 1, model = "GauPro", covtype = "matern5_2", nugget.estim = TRUE )
eval_funcThe function used to evaluate new points.
...Hyperparameters to optimize over.
X0Data frame of initial points to run, or points already evaluated. If already evaluated, give in outputs in "Z0"
Z0Evaluated outputs at "X0".
n_lhsThe number that should initially be run using a maximin Latin hypercube.
extract_output_funcA function that takes in the output from 'eval_func' and returns the value we are trying to minimize.
verboseHow much should be printed? 0 is none, 1 is standard, 2 is more, 5+ is a lot
modelWhat package to fit the Gaussian process model with. Either "GauPro" or "DiceKriging"/"DK".
covtypeCovariance/correlation/kernel function for the GP model.
nugget.estimShould the nugget be estimated when fitting the GP model?
add_data()Add data to the experiment results.
R6_hype$add_data(X, Z)
XData frame with names matching the input parameters
ZOutput at rows of X matching the experiment output.
add_X()Add new inputs to run. This allows the user to specify what they want run next.
R6_hype$add_X(X)
XData frame with names matching the input parameters.
add_LHS()Add new input points using a maximin Latin hypercube. Latin hypercubes are usually more spacing than randomly picking points.
R6_hype$add_LHS(n, just_return_df = FALSE)
nNumber of points to add.
just_return_dfInstead of adding to experiment, should it just return the new set of values?
convert_trans_to_raw()Convert parameters from transformed scale to raw scale.
R6_hype$convert_trans_to_raw(Xtrans)
XtransParameters on the transformed scale
convert_raw_to_trans()Convert parameters from raw scale to transformed scale.
R6_hype$convert_raw_to_trans(Xraw)
XrawParameters on the raw scale
change_par_bounds()Change lower/upper bounds of a parameter
R6_hype$change_par_bounds(parname, lower, upper)
parnameName of the parameter
lowerNew lower bound. Leave empty if not changing.
upperNew upper bound. Leave empty if not changing.
add_EI()Add new inputs to run using the expected information criteria
R6_hype$add_EI( n, covtype = NULL, nugget.estim = NULL, model = NULL, eps, just_return = FALSE, calculate_at )
nNumber of points to add.
covtypeCovariance function to use for the Gaussian process model.
nugget.estimShould a nugget be estimated?
modelWhich package should be used to fit the model and calculate the EI? Use "DK" for DiceKriging or "GauPro" for GauPro.
epsExploration parameter. The minimum amount of improvement you care about.
just_returnJust return the EI info, don't actually add the points to the design.
calculate_atCalculate the EI at a specific point.
fit_mod()Fit model to the data collected so far
R6_hype$fit_mod(covtype = NULL, nugget.estim = NULL, model = NULL)
covtypeCovariance function to use for the Gaussian process model.
nugget.estimShould a nugget be estimated?
modelWhich package should be used to fit the model and calculate the EI? Use "DK" for DiceKriging or "GauPro" for GauPro.
run_all()Run all unevaluated input points.
R6_hype$run_all(...)
...Passed into ‘ffexp$run_all'. Can set ’parallel=TRUE' to evaluate multiple points simultaneously as long as all needed variables have been passed to 'varlist'
run_EI_for_time()Add points using the expected information criteria, evaluate them, and repeat until a specified amount of time has passed.
R6_hype$run_EI_for_time( sec, batch_size, covtype = "matern5_2", nugget.estim = TRUE, verbose = 0, model = "GauPro", eps = 0, ... )
secNumber of seconds to run for. It will go over this time limit, finish the current iteration, then stop.
batch_sizeNumber of points to run at once.
covtypeCovariance function to use for the Gaussian process model.
nugget.estimShould a nugget be estimated?
verboseVerbose parameter to pass to ffexp$
modelWhich package should be used to fit the model and calculate the EI? Use "DK" for DiceKriging or "GauPro" for GauPro.
epsExploration parameter. The minimum amount of improvement you care about.
...Passed into 'ffexp$run_all'.
plot()Make a plot to summarize the experiment.
R6_hype$plot()
pairs()Plot pairs of inputs and output
R6_hype$pairs()
plotorder()Plot the output of the points evaluated in order.
R6_hype$plotorder()
plotX()Plot the output as a function of each input.
R6_hype$plotX( addlines = TRUE, addEIlines = TRUE, covtype = NULL, nugget.estim = NULL, model = NULL )
addlinesShould prediction mean and 95% interval be plotted?
addEIlinesShould expected improvement lines be plotted?
covtypeCovariance function to use for the Gaussian process model.
nugget.estimShould a nugget be estimated?
modelWhich package should be used to fit the model and calculate the EI? Use "DK" for DiceKriging or "GauPro" for GauPro.
plotXorder()Plot each input in the order they were chosen. Colored by quality.
R6_hype$plotXorder()
plotinteractions()Plot the 2D plots from inputs to the output. All other variables are held at their values for the best input.
R6_hype$plotinteractions(covtype = "matern5_2", nugget.estim = TRUE)
covtypeCovariance function to use for the Gaussian process model.
nugget.estimShould a nugget be estimated?
print()Print details of the object.
R6_hype$print(...)
...not used
best_params()Returns the best parameters evaluated so far.
R6_hype$best_params()
update_mod_userspeclist()Updates the specifications for the GP model.
R6_hype$update_mod_userspeclist( model = NULL, covtype = NULL, nugget.estim = NULL )
modelWhat package to fit the Gaussian process model with. Either "GauPro" or "DiceKriging"/"DK".
covtypeCovariance/correlation/kernel function for the GP model.
nugget.estimShould the nugget be estimated when fitting the GP model?
clone()The objects of this class are cloneable with this method.
R6_hype$clone(deep = FALSE)
deepWhether to make a deep clone.
# Have df output, but only use one value from it
h1 <- hype(
eval_func = function(a, b) {data.frame(c=a^2+b^2, d=1:2)},
extract_output_func = function(odf) {odf$c[1]},
a = par_unif('a', -1, 2),
b = par_unif('b', -10, 10),
n_lhs = 10
)
h1$run_all()
h1$add_EI(n = 1)
h1$run_all()
#system.time(h1$run_EI_for_time(sec=3, batch_size = 1))
#system.time(h1$run_EI_for_time(sec=3, batch_size = 3))
h1$plotorder()
h1$plotX()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.