Learn R Programming

marinespeed (version 0.1.0)

get_folds: Get folds

Description

get_folds returns the different pre-generated folds information. To get the fold data for a species see also get_fold_data.

Usage

get_folds(type = "disc")

Arguments

type
character. The type of partitioning you want to load.

Value

A list with two entries "background" and "species", each entry is a dataframe with species name column and 5 fold columns as created by kfold_occurrence_background

Details

The different supported 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

lapply_kfold_species get_fold_data get_occurrences get_background kfold_data

Examples

Run this code
## Not run: ------------------------------------
# folds <- get_folds("random")
# 
# abalistes <- "Abalistes stellatus"
# occ <- get_occurrences(abalistes)
# bg <- get_background("random")
# 
# occ_train <- kfold_data(abalistes, occ, folds$species, k=1, training=TRUE)
# occ_test <- kfold_data(abalistes, occ, folds$species, k=1, training=FALSE)
# bg_train <- kfold_data(abalistes, bg, folds$background, k=1, training=TRUE)
# bg_test <- kfold_data(abalistes, bg, folds$background, k=1, training=FALSE)
## ---------------------------------------------

Run the code above in your browser using DataLab