data_split: Split a data.frame into training and test sets.

Description Usage Arguments Value

View source: R/data.r

Description

Split a data.frame into training and test sets.

Usage

1
2
3
4
5
6
data_split(
  data = get_data("german"),
  varname = "credit_risk",
  p_test = 0.2,
  p_quiz = 0.5
)

Arguments

data

data.frame

varname

string. output variable name

p_test

real. proportion of samples in the test set

p_quiz

real. proportion of samples from the test set in the quiz set

Value

list with members

train

training set with output variable

test

test set without output variable

y_test

test set output variable

ind_quiz

indices of quiz samples in the test set


adrtod/rchallenge documentation built on Jan. 19, 2020, 10:42 a.m.