Package 'bayesianrvfl'

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

Help Index


Bayesian optimization using surrogate models

Description

Bayesian optimization using surrogate models

Usage

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,
  ...
)

Arguments

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

Description

Fitting base rvfl

Usage

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
)

Arguments

seed

Multistart nlminb

Description

Multistart nlminb

Usage

msnlminb(objective, nb_iter = 100, lower, upper, cl = NULL, max_fails = 3, ...)

Arguments

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

Value

list with the best solution


Multistart nmkb

Description

Multistart nmkb

Usage

msnmkb(objective, nb_iter = 100, lower, upper, cl = NULL, ...)

Arguments

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

Value

list with the best solution


Predict from an rvfl

Description

Predict from an rvfl

Usage

predict_rvfl(fit_obj, newx, ci = NULL, graph = FALSE)

Arguments

graph

Predict Method for Elastic Net Models

Description

Predict Method for Elastic Net Models

Usage

## S3 method for class 'glmnet_rvfl'
predict(object, newdata, s = 0.1, ...)

Arguments

object

Fitted model object

newdata

New data for prediction

s

Value of the penalty parameter lambda at which predictions are required

...

Additional arguments

Value

Predictions for new data


Predict Method for Matérn 5/2 Models

Description

Predict Method for Matérn 5/2 Models

Usage

## S3 method for class 'matern52'
predict(object, newdata, ci = NULL, ...)

Arguments

object

Fitted model object

newdata

New data for prediction

ci

Confidence interval (optional)

...

Additional arguments

Value

Predictions for new data


Predict Method for RVFL Models

Description

Predict Method for RVFL Models

Usage

## S3 method for class 'rvfl'
predict(object, newdata, ci = NULL, graph = FALSE, ...)

Arguments

object

Fitted model object

newdata

New data for prediction

ci

Confidence interval (optional)

graph

Whether to create a graph (optional)

...

Additional arguments

Value

Predictions for new data


Predict Method for RVFL MCMC Models

Description

Predict Method for RVFL MCMC Models

Usage

## S3 method for class 'rvfl_mcmc'
predict(object, newdata, ci = NULL, graph = FALSE, ...)

Arguments

object

Fitted model object

newdata

New data for prediction

ci

Confidence interval (optional)

graph

Whether to create a graph (optional)

...

Additional arguments

Value

Predictions for new data


Update function

Description

Update function

Usage

update_params(
  fit_obj,
  newx,
  newy,
  re_clust = TRUE,
  method = c("direct", "polyak"),
  alpha = 0.5
)

Arguments

alpha