Fits RVFL features then applies cv.glmnet.
cv.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 hidden units
- activation
activation function
- W_type
random feature type ("gaussian", "uniform", "sobol")
- seed
random seed
- scale
logical scaling
- include_original
logical, whether to include original features
- store_y
logical, whether to store y in model
- family
response type
- ...
additional arguments passed to glmnet::cv.glmnet
Value
object of class "cv.rvflnet"
Examples
if (FALSE) { # \dontrun{
x <- matrix(rnorm(100*5), 100, 5)
y <- x[,1] + sin(x[,2]) + rnorm(100, 0, 0.1)
cv_model <- cv.rvflnet(x, y, n_hidden = 50, nfolds = 5)
plot(cv_model)
predict(cv_model, newx = x[1:10,])
} # }