crossv_lpo: Generate cross-validated leave-p-out test/training pairs

Description Usage Arguments Examples

View source: R/crossv_lpo.R

Description

Generate cross-validated leave-one-out or leave-p-out test/training pairs. The function leave-p-out generates leave-p-out test/training pairs. The function leave-one-out is convenience function for the common special case of leave-one-out cross-validation, p = 1.

Usage

1
2
3
crossv_lpo(n, size = 1L)

crossv_loo(n)

Arguments

n

A positive, scalar integer representing the number of observations (items to choose from).

size

A scalar integer representing the number of items to include in the training set.

Examples

1
2
3
4
5
6
7
# Example originally from modelr::crossv_mc
library("purrr")
# leave-on-out cross-validation
crossv_loo(10)

# leave-two-out cross-validation
crossv_lpo(10, size = 2)

jrnold/ramsleep documentation built on May 29, 2019, 11:43 a.m.