View source: R/TuningInstanceSingleCrit.R
autoplot.TuningInstanceSingleCrit | R Documentation |
Generates plots for mlr3tuning::TuningInstanceSingleCrit.
## S3 method for class 'TuningInstanceSingleCrit' autoplot( object, type = "marginal", cols_x = NULL, trafo = FALSE, learner = mlr3::lrn("regr.ranger"), grid_resolution = 100, ... )
object |
(mlr3tuning::TuningInstanceSingleCrit. |
type |
(
|
cols_x |
( |
trafo |
( |
learner |
(mlr3::Learner) |
grid_resolution |
( |
... |
( |
ggplot2::ggplot()
object.
The theme_mlr3()
and viridis color maps are applied by default to all
autoplot()
methods. To change this behavior set
options(mlr3.theme = FALSE)
.
if (requireNamespace("mlr3tuning") && requireNamespace("patchwork")) { library(mlr3tuning) learner = lrn("classif.rpart") learner$param_set$values$cp = to_tune(0.001, 0.1) learner$param_set$values$minsplit = to_tune(1, 10) instance = TuningInstanceSingleCrit$new( task = tsk("iris"), learner = learner, resampling = rsmp("holdout"), measure = msr("classif.ce"), terminator = trm("evals", n_evals = 10)) tuner = tnr("random_search") tuner$optimize(instance) # plot performance versus batch number autoplot(instance, type = "performance") # plot cp values versus performance autoplot(instance, type = "marginal", cols_x = "cp") # plot transformed parameter values versus batch number autoplot(instance, type = "parameter", trafo = TRUE) # plot parallel coordinates plot autoplot(instance, type = "parallel") # plot pairs autoplot(instance, type = "pairs") }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.