| Title: | Bayesian Quasi-Randomized nnetworks |
|---|---|
| Description: | Bayesian Quasi-Randomized nnetworks. |
| Authors: | T. Moudiki |
| Maintainer: | T. Moudiki <[email protected]> |
| License: | BSD_3_clause Clear + file LICENSE |
| Version: | 0.3.2 |
| Built: | 2026-05-09 07:26:55 UTC |
| Source: | https://github.com/thierrymoudiki/bayesianrvfl |
Bayesian optimization using surrogate models
bayes_opt( objective, lower, upper, type_acq = c("ei", "ucb"), nb_init = 10L, nb_iter = 90L, kappa = 1.96, method = c("standard", "direct_online", "polyak_online"), surrogate_model = c("rvfl", "matern52", "rvfl_emcee", "rf"), optim_surr = c("GCV", "loglik", "cv"), activation_function = c("relu", "tanh", "sigmoid"), type_optim = c("nlminb", "DEoptim", "msnlminb", "randsearch", "none"), early_stopping = FALSE, abs_tol = 1e-07, rel_tol = 0.001, seed = 123, verbose = TRUE, show_progress = TRUE, ... )bayes_opt( objective, lower, upper, type_acq = c("ei", "ucb"), nb_init = 10L, nb_iter = 90L, kappa = 1.96, method = c("standard", "direct_online", "polyak_online"), surrogate_model = c("rvfl", "matern52", "rvfl_emcee", "rf"), optim_surr = c("GCV", "loglik", "cv"), activation_function = c("relu", "tanh", "sigmoid"), type_optim = c("nlminb", "DEoptim", "msnlminb", "randsearch", "none"), early_stopping = FALSE, abs_tol = 1e-07, rel_tol = 0.001, seed = 123, verbose = TRUE, show_progress = TRUE, ... )
objective |
function to be optimized |
lower |
lower bound for search |
upper |
upper bound for search |
type_acq |
type of acquisition function |
nb_init |
number of points in initial design |
nb_iter |
number of iterations of the algo |
kappa |
quantile for ucb |
method |
fit all, or online |
surrogate_model |
surrogate model |
optim_surr |
surrogate hyperparams fitting |
activation_function |
activation for bayesian rvfl |
type_optim |
optim for acquisition (nlminb, DEoptim, msnlminb, randsearch, none) |
early_stopping |
if TRUE, the algorithm will stop if the acquisition function is below a certain threshold |
abs_tol |
absolute tolerance for early stopping |
rel_tol |
relative tolerance for early stopping |
seed |
seed for random number generation |
verbose |
if TRUE, the algorithm will print progress messages |
show_progress |
if TRUE, the algorithm will show a progress bar |
... |
Fitting base rvfl
fit_rvfl( x, y, nb_hidden = 5, n_clusters = 0, nodes_sim = c("sobol", "halton", "unif"), activ = c("relu", "sigmoid", "tanh", "leakyrelu", "elu", "linear"), lambda = 10^seq(from = -10, to = 10, length.out = 100), method = c("svd", "solve", "chol"), compute_Sigma = FALSE, seed = 123 )fit_rvfl( x, y, nb_hidden = 5, n_clusters = 0, nodes_sim = c("sobol", "halton", "unif"), activ = c("relu", "sigmoid", "tanh", "leakyrelu", "elu", "linear"), lambda = 10^seq(from = -10, to = 10, length.out = 100), method = c("svd", "solve", "chol"), compute_Sigma = FALSE, seed = 123 )
seed |
Multistart nlminb
msnlminb(objective, nb_iter = 100, lower, upper, cl = NULL, max_fails = 3, ...)msnlminb(objective, nb_iter = 100, lower, upper, cl = NULL, max_fails = 3, ...)
objective |
function to be minimized |
nb_iter |
number of iterations |
lower |
lower bounds |
upper |
upper bounds |
cl |
number of cores to be used |
max_fails |
maximum consecutive failures before adjusting parameters |
... |
other arguments to be passed to nlminb |
list with the best solution
Multistart nmkb
msnmkb(objective, nb_iter = 100, lower, upper, cl = NULL, ...)msnmkb(objective, nb_iter = 100, lower, upper, cl = NULL, ...)
objective |
function to be minimized |
nb_iter |
number of iterations |
lower |
lower bounds |
upper |
upper bounds |
cl |
number of cores to be used |
... |
other arguments to be passed to nmkb |
list with the best solution
Predict from an rvfl
predict_rvfl(fit_obj, newx, ci = NULL, graph = FALSE)predict_rvfl(fit_obj, newx, ci = NULL, graph = FALSE)
graph |
Predict Method for Elastic Net Models
## S3 method for class 'glmnet_rvfl' predict(object, newdata, s = 0.1, ...)## S3 method for class 'glmnet_rvfl' predict(object, newdata, s = 0.1, ...)
object |
Fitted model object |
newdata |
New data for prediction |
s |
Value of the penalty parameter lambda at which predictions are required |
... |
Additional arguments |
Predictions for new data
Predict Method for Matérn 5/2 Models
## S3 method for class 'matern52' predict(object, newdata, ci = NULL, ...)## S3 method for class 'matern52' predict(object, newdata, ci = NULL, ...)
object |
Fitted model object |
newdata |
New data for prediction |
ci |
Confidence interval (optional) |
... |
Additional arguments |
Predictions for new data
Predict Method for RVFL Models
## S3 method for class 'rvfl' predict(object, newdata, ci = NULL, graph = FALSE, ...)## S3 method for class 'rvfl' predict(object, newdata, ci = NULL, graph = FALSE, ...)
object |
Fitted model object |
newdata |
New data for prediction |
ci |
Confidence interval (optional) |
graph |
Whether to create a graph (optional) |
... |
Additional arguments |
Predictions for new data
Predict Method for RVFL MCMC Models
## S3 method for class 'rvfl_mcmc' predict(object, newdata, ci = NULL, graph = FALSE, ...)## S3 method for class 'rvfl_mcmc' predict(object, newdata, ci = NULL, graph = FALSE, ...)
object |
Fitted model object |
newdata |
New data for prediction |
ci |
Confidence interval (optional) |
graph |
Whether to create a graph (optional) |
... |
Additional arguments |
Predictions for new data
Update function
update_params( fit_obj, newx, newy, re_clust = TRUE, method = c("direct", "polyak"), alpha = 0.5 )update_params( fit_obj, newx, newy, re_clust = TRUE, method = c("direct", "polyak"), alpha = 0.5 )
alpha |