| cv_densemlp | R Documentation |
Fits densemlp() on each of folds training splits and evaluates it on the
held-out fold via densemlp_metrics().
cv_densemlp(
x,
y,
task = c("auto", "regression", "binary", "multiclass", "survival", "count"),
folds = 5L,
seed = 1L,
ncores = 1L,
verbose = FALSE,
weights = NULL,
...
)
x |
Predictor data.frame or matrix. |
y |
Outcome vector. |
task |
|
folds |
Number of cross-validation folds. |
seed |
Random seed for fold assignment; fold |
ncores |
Number of cores used to fit folds in parallel (see
|
verbose |
Print per-fold progress. |
weights |
Optional non-negative case weights, one per row. Each fold
is fitted with its training rows' weights (see |
... |
Additional arguments passed to |
A list of class densemlp_cv with fold_metrics (one row per fold),
summary (mean and SD per metric across folds), and task.
set.seed(1)
x <- data.frame(a = rnorm(60), b = rnorm(60))
y <- x$a - 0.5 * x$b + rnorm(60, sd = 0.1)
cv <- cv_densemlp(x, y, folds = 3, epochs = 20, hidden_units = c(8))
cv$summary
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.