stratifySample: Performs stratified cross validation sampling of a data...

Description Usage Arguments Value Examples

View source: R/stratify_sample.R

Description

Generates cross validation folds in a stratified way.

Usage

1
2
stratifySample(data, targetVariable, nfolds = 5, uniqueID = NULL,
  keepData = FALSE, positiveResponse = 1, seed = NULL)

Arguments

data

A dataframe which contains the base data to be split.

targetVariable

A string giving the name of the binary variable to stratify by.

nfolds

An integer giving the number of cross validation folds.

uniqueID

A string giving the name of a unique row identifier. Note, if there is no identifier, the function will filter the dataset by index.

keepData

A Boolean indicating whether or not to keep the entire dataset along with extra columns indicating the folds.

positiveResponse

The value of the target variable which indicates a positive response. Must be 1 or 0.

seed

The seed value to use to reproduce results.

Value

An object of the class StratifiedXValS3.

Examples

1

JL-Woodcock/stRatify documentation built on Nov. 5, 2019, 2:17 p.m.