Fits an RVFL model using glmnet on augmented random feature space.

rvflnet(
  x,
  y,
  n_hidden = 200L,
  activation = c("sigmoid", "tanh", "relu", "identity"),
  W_type = c("gaussian", "uniform", "sobol"),
  seed = 1,
  scale = TRUE,
  include_original = TRUE,
  store_y = FALSE,
  family = c("gaussian", "binomial", "poisson", "multinomial", "cox", "mgaussian"),
  ...
)

Arguments

x

design matrix

y

response vector

n_hidden

number of random hidden units (must be > 0)

activation

activation function ("tanh", "relu", "sigmoid", "identity", or custom function)

W_type

type of random weights ("gaussian", "uniform", "sobol")

seed

random seed for reproducibility

scale

logical, whether to standardize inputs

include_original

logical, whether to include original features (default TRUE)

store_y

logical, whether to store y in model (for residuals, default FALSE)

family

response type ("gaussian", "binomial", "poisson", "multinomial", "cox", "mgaussian"). For family = "cox", y must be a Surv object from the survival package.

...

additional arguments passed to glmnet::glmnet

Value

object of class "rvflnet"

Examples

if (FALSE) { # \dontrun{
x <- matrix(rnorm(100*5), 100, 5)
y <- x[,1] + sin(x[,2]) + rnorm(100, 0, 0.1)
model <- rvflnet(x, y, n_hidden = 50, activation = "tanh")
predict(model, newx = x[1:10,])
coef(model)  # Note: coefficients apply to [X | random features] space
} # }