createtest: Create a classification or regression test case

Description Usage Arguments Value Examples

Description

Create a test, which can be run using any of the available runtest functions

Usage

1
2
3
createtest(data, problem = c("classification", "regression"), dependent,
  data_transform = identity, train_index, method, name, description = "",
  ...)

Arguments

data

A data frame

problem

Either classification or regression. This influences how the algorithms are trained and what method is used to determine performance

dependent

The dependent variable: the name of the column containing the prediction goal

data_transform

A quoted function name that transforms the data. It should maintain it in data frame form and maintain the dependent variable.

train_index

A vector of the rows to be used as training set. All other rows will form the holdout set

method

The regression or classification method

name

The name of the test. Printed in the test results

description

Optional. A more elaborate description of the test

...

Extra arguments used while running the test.

Value

An object of class 'classification' or 'regression', which holds the data, method, etc. for executing the test case.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data(iris)
# A classification test
test <- createtest(data = iris, 
                  dependent = "Species",
                  problem = "classification",
                  method = "randomForest",
                  name = "An example classification test",
                  train_index = sample(150, 100)
)

# A regression test
test <- createtest(data = iris, 
                  dependent = "Sepal.Width",
                  problem = "regression",
                  method = "randomForest",
                  name = "An example regression test",
                  train_index = sample(150, 100)
)

sjoerdvds/crtests documentation built on May 30, 2019, 12:05 a.m.