autoplot.ResamplingCustomCV {mlr3spatiotempcv} | R Documentation |
Visualization Functions for Non-Spatial CV Methods.
Description
Generic S3 plot()
and autoplot()
(ggplot2) methods.
Usage
## S3 method for class 'ResamplingCustomCV'
autoplot(
object,
task,
fold_id = NULL,
plot_as_grid = TRUE,
train_color = "#0072B5",
test_color = "#E18727",
sample_fold_n = NULL,
...
)
## S3 method for class 'ResamplingCustomCV'
plot(x, ...)
Arguments
object |
|
task |
|
fold_id |
|
plot_as_grid |
|
train_color |
|
test_color |
|
sample_fold_n |
|
... |
Passed to |
x |
|
See Also
mlr3book chapter on "Spatial Analysis"
Examples
if (mlr3misc::require_namespaces(c("sf", "patchwork"), quietly = TRUE)) {
library(mlr3)
library(mlr3spatiotempcv)
task = tsk("ecuador")
breaks = quantile(task$data()$dem, seq(0, 1, length = 6))
zclass = cut(task$data()$dem, breaks, include.lowest = TRUE)
resampling = rsmp("custom_cv")
resampling$instantiate(task, f = zclass)
autoplot(resampling, task) +
ggplot2::scale_x_continuous(breaks = seq(-79.085, -79.055, 0.01))
autoplot(resampling, task, fold_id = 1)
autoplot(resampling, task, fold_id = c(1, 2)) *
ggplot2::scale_x_continuous(breaks = seq(-79.085, -79.055, 0.01))
}