knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

resampleR

resamplerR is like M.Kuhn`s rsample, but all resamples are realised as plain data.table objects. This package aims to be as easy to extend as possible.

Installation

You can install dev version of resampleR from GitHub with:

devtools::install_github("statist-bhfz/resampleR")

Example

This is a basic example which shows you how to solve a common problem:

library(resampleR)

cv_base(as.data.table(iris), "Species")

dt <- data.table(
    user = rep(1:100, each = 5),
    date = as.POSIXct(rep(seq(1.8*10e8, 1.8*10e8 + 388800, by = 86400), 100),
                      origin = "1960-01-01"),
    target = rnorm(5e2)
)

cv_split_group_kfold(dt, "target", "user")

cv_split_temporal(dt, "target", "user", "date")

repeated_kfold(expr = quote(cv_base(as.data.table(iris), "Species")))


statist-bhfz/resampleR documentation built on Sept. 2, 2019, 8:14 p.m.