get_fold_data: Get fold data

Description Usage Arguments Details Value See Also Examples

View source: R/load.R

Description

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

Usage

1
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.

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.

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.

See Also

list_species lapply_kfold_species lapply_species kfold_data

Examples

1
2
3
4
5
6
7
8
9
## 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

## End(Not run)

samuelbosch/marinespeed documentation built on Dec. 17, 2019, 11:47 p.m.