| compare | R Documentation |
Compare multiple learners with optional tuning.
compare(
data,
formula,
models,
specs = NULL,
resampling = cv(5),
metrics = NULL,
type = NULL,
conf_level = 0.95,
seed = NULL,
ncores = NULL,
tune = FALSE,
grids = NULL,
metric = NULL,
...
)
data |
Data frame. |
formula |
Model formula. |
models |
Character vector of learner ids. |
specs |
Optional named list of fixed specs per learner. |
resampling |
Resampling object from |
metrics |
Character vector of metrics to report. When |
type |
Prediction type override. |
conf_level |
Confidence level for learner summary intervals. |
seed |
Optional seed. |
ncores |
Optional number of CPU cores used to compare learners. |
tune |
Logical; if |
grids |
Optional tuning grids. Supply either a single data frame to reuse across learners or a named list of data frames keyed by learner id. |
metric |
Optimization metric used when |
... |
Additional arguments passed to |
A funcml_compare object.
cmp <- compare(
data = mtcars,
formula = mpg ~ wt + hp,
models = c("glm", "rpart"),
resampling = cv(3, seed = 1),
metrics = c("rmse", "mae")
)
cmp$results
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.