Description Usage Arguments Value See Also Examples
kfold_data
returns rows from data for a specific species for the kth
fold. The get data from pre-made folds use get_fold_data
1 | kfold_data(species_name, data, folds, fold, training)
|
species_name |
Character vector. The name of the species you want get the fold data for. |
data |
Dataframe. The occurrence or background data you want to get the fold data for. |
folds |
Dataframe. The occurrence or background folds as created by
|
fold |
Integer. Indicate which kth fold you want to return data for. |
training |
Logical. If |
Filtered version of data.
lapply_kfold_species
, get_fold_data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## random data folds
set.seed(42)
occ_data <- data.frame(species = rep("Abalistes stellatus", 50),
longitude = runif(50, -180, 180), latitude = runif(50, -90, 90))
bg_data <- data.frame(species = rep("background", 1000),
longitude = runif(1000, -180, 180), latitude = runif(1000, -90, 90))
folds <- kfold_occurrence_background(occ_data, bg_data)
## alternative with real data (but see also the function get_fold_data)
# occ_data <- get_occurrences("Abalistes stellatus")
# bg_data <- load_background("random")
# folds <- load_folds("random")
## get training and test data for the first fold
occ_training <- kfold_data("Abalistes stellatus", occ_data, folds$occurrence,
fold = 1, training = TRUE)
occ_test <- kfold_data("Abalistes stellatus", occ_data, folds$occurrence,
fold = 1, training = FALSE)
bg_training <- kfold_data("Abalistes stellatus", bg_data, folds$background,
fold = 1, training = TRUE)
bg_test <- kfold_data("Abalistes stellatus", bg_data, folds$background,
fold = 1, training = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.