Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
pat-s committed Apr 16, 2024
2 parents 24231bf + 11578e9 commit 9778043
Show file tree
Hide file tree
Showing 78 changed files with 210 additions and 210 deletions.
12 changes: 6 additions & 6 deletions R/ResamplingRepeatedSpCVknndm.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#'
#' task = mlr3spatial::as_task_classif_st(sf::st_as_sf(train_points), "target", positive = "TRUE")
#'
#' cv_knndm = rsmp("repeated_spcv_knndm", ppoints = pred_points, repeats = 2)
#' cv_knndm = rsmp("repeated_spcv_knndm", predpoints = pred_points, repeats = 2)
#' cv_knndm$instantiate(task)

#' #' ### Individual sets:
Expand All @@ -52,7 +52,7 @@ ResamplingRepeatedSpCVKnndm = R6Class("ResamplingRepeatedSpCVKnndm",
null.ok = TRUE)
})
),
ppoints = p_uty(default = NULL,
predpoints = p_uty(default = NULL,
custom_check = crate(function(x) {
checkmate::check_class(x, "sfc_POINT",
null.ok = TRUE)
Expand Down Expand Up @@ -108,13 +108,13 @@ ResamplingRepeatedSpCVKnndm = R6Class("ResamplingRepeatedSpCVKnndm",

# Set values to default if missing
mlr3misc::map(
c("modeldomain", "ppoints", "space", "maxp", "folds", "clustering",
c("modeldomain", "predpoints", "space", "maxp", "folds", "clustering",
"linkf", "samplesize", "sampling"),
function(x) private$.set_default_param_values(x)
)

if (is.null(pv$modeldomain) && is.null(pv$ppoints)) {
stopf("Either 'modeldomain' or 'ppoints' need to be set.")
if (is.null(pv$modeldomain) && is.null(pv$predpoints)) {
stopf("Either 'modeldomain' or 'predpoints' need to be set.")
}

if (!is.null(groups)) {
Expand Down Expand Up @@ -164,7 +164,7 @@ ResamplingRepeatedSpCVKnndm = R6Class("ResamplingRepeatedSpCVKnndm",
map(seq_len(pv$repeats), function(i) {
inds = CAST::knndm(tpoints = points,
modeldomain = self$param_set$values$modeldomain,
ppoints = self$param_set$values$ppoints,
predpoints = self$param_set$values$predpoints,
k = self$param_set$values$folds,
maxp = self$param_set$values$maxp,
clustering = self$param_set$values$clustering,
Expand Down
8 changes: 4 additions & 4 deletions R/ResamplingSpCVKnndm.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ResamplingSpCVKnndm = R6Class("ResamplingSpCVKnndm",
null.ok = TRUE)
})
),
ppoints = p_uty(default = NULL,
predpoints = p_uty(default = NULL,
custom_check = crate(function(x) {
checkmate::check_class(x, "sfc_POINT",
null.ok = TRUE)
Expand Down Expand Up @@ -87,8 +87,8 @@ ResamplingSpCVKnndm = R6Class("ResamplingSpCVKnndm",

pv = self$param_set$values

if (is.null(pv$modeldomain) && is.null(pv$ppoints)) {
stopf("Either 'modeldomain' or 'ppoints' need to be set.")
if (is.null(pv$modeldomain) && is.null(pv$predpoints)) {
stopf("Either 'modeldomain' or 'predpoints' need to be set.")
}

if (!is.null(groups)) {
Expand Down Expand Up @@ -156,7 +156,7 @@ ResamplingSpCVKnndm = R6Class("ResamplingSpCVKnndm",
inds = CAST::knndm(
tpoints = points,
modeldomain = self$param_set$values$modeldomain,
ppoints = self$param_set$values$ppoints,
predpoints = self$param_set$values$predpoints,
k = self$param_set$values$folds,
maxp = self$param_set$values$maxp,
clustering = self$param_set$values$clustering,
Expand Down
8 changes: 4 additions & 4 deletions man/mlr_resamplings_repeated_spcv_knndm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/mlr_resamplings_spcv_knndm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9778043

Please sign in to comment.