Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- cstf: print info log message which column roles are used for partit…
Browse files Browse the repository at this point in the history
…ioning
pat-s committed Jun 2, 2022

Verified

This commit was signed with the committer’s verified signature. The key has expired.
Czaki Grzegorz Bokota
1 parent 141b76c commit 6792a5c
Showing 3 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions R/ResamplingSptCVCstf.R
Original file line number Diff line number Diff line change
@@ -104,6 +104,17 @@ ResamplingSptCVCstf = R6Class("ResamplingSptCVCstf",
)

sample_cast = function(task, stratify = FALSE, folds) {

if (length(task$col_roles$time) && length(task$col_roles$space)) {
lg$info(sprintf("Using column roles 'space' (var. '%s') and 'time' (var. '%s') for partitioning", task$col_roles$space, task$col_roles$time))

} else if (length(task$col_roles$time)) {
lg$info(sprintf("Using column role 'time' (var. '%s') for partitioning", task$col_roles$time))
}
else if (length(task$col_roles$space)) {
lg$info(sprintf("Using column role 'space' (var. '%s') for partitioning", task$col_roles$space))
}

target = if (stratify) task$target_names else NULL
space = task$col_roles$space
time = task$col_roles$time
1 change: 1 addition & 0 deletions R/autoplot_spcv_cstf.R
Original file line number Diff line number Diff line change
@@ -118,6 +118,7 @@ autoplot.ResamplingSptCVCstf = function( # nolint
resampling_sub$instance = resampling_sub$instance[[repeats_id]]
}

# FIXME: check space and time var from column roles!
# check if we are in a 2D or 3D scenario
if (is.null(plot3D)) {
if (!is.null(resampling_sub$space_var) &&
1 change: 1 addition & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -102,6 +102,7 @@ register_mlr3 = function() { # nocov start

.onLoad = function(libname, pkgname) { # nolint
register_mlr3()
assign("lg", lgr::get_logger("mlr3spatiotempcv"), envir = parent.env(environment()))
setHook(packageEvent("mlr3", "onLoad"), function(...) register_mlr3(),
action = "append")
}

0 comments on commit 6792a5c

Please sign in to comment.