Skip to contents

Check the balance of presences vs pseudoabsences among splits

Usage

check_splits_balance(splits, .col)

Arguments

splits

the data splits (an rset or split object), generated by a function such as spatialsample::spatial_block_cv()

.col

the column containing the presences

Value

a tibble of the number of presences and pseudoabsences in the assessment and analysis set of each split (or training and testing in an initial split)

Examples

lacerta_thin <- readRDS(system.file("extdata/lacerta_thin_all_vars.rds",
  package = "tidysdm"
))
lacerta_cv <- spatial_block_cv(lacerta_thin, v = 5)
check_splits_balance(lacerta_cv, class)
#> # A tibble: 5 × 4
#>   presence_assessment background_assessment presence_analysis
#>                 <int>                 <int>             <int>
#> 1                  80                   262                32
#> 2                 102                   263                10
#> 3                  82                   277                30
#> 4                  98                   266                14
#> 5                  86                   276                26
#> # ℹ 1 more variable: background_analysis <int>