Learn R Programming

marinespeed (version 0.1.0)

get_fold_data: Get fold data

Description

get_fold_data returns a list of training and test occurrence and background data fold(s) for one or more species.

Usage

get_fold_data(species, fold_type, k)

Arguments

species
dataframe or character vector. Row from the dataframe returned by list_species or the name of the species.
fold_type
character. Type of partitioning you want to use, default is "disc".
k
integer vector. Numbers of the folds you want to get data for, if you want all folds use 1:5, which is the default.

Value

A 5 element list with fold data filled in for all k. Fold data consists of a list with 4 elements: occurrence_training, occurrence_test, background_training and background_test.

Details

The different fold_type are: "disc": 5-fold disc partitioning of occurrences with pairwise distance sampled and buffer filtered random background points, equivalent to calling kfold_occurrence_background with occurrence_fold_type = "disc", k = 5, pwd_sample = TRUE, background_buffer = 200*1000 "grid_4" and "grid_9": 4-fold and 9-fold grid partitioning of occurrences with pairwise distance sampled and buffer filtered random background points, equivalent to calling kfold_occurrence_background with occurrence_fold_type = "grid", k = 4, pwd_sample = TRUE, background_buffer = 200*1000 "random": 5-fold random partitioning of occurrences and random background points, equivalent to calling kfold_occurrence_background with occurrence_fold_type = "random", k = 5, pwd_sample = FALSE, background_buffer = 0 "targetgroup": same way of partitioning as the "random" folds but instead of random background points, a random subset of all occurrences points was used creating a targetgroup background points set which has the same sampling bias as the entire dataset.

See Also

list_species lapply_kfold_species lapply_species kfold_data

Examples

Run this code
## Not run: ------------------------------------
# aba_folds <- get_fold_data("Abalistes stellatus", "random", k = 1:5)
# k1 <- aba_folds[[1]]
# k1$occurrence_training
# k1$occurrence_test
# k1$background_training
# k1$background_test
## ---------------------------------------------

Run the code above in your browser using DataLab