Skip to contents

From a given named matrix or a named data.frame a Dataset is created. The user needs to specify the target covariable/columnname as a string. Optionally the type can be set to either regression or classification. If this is not provided the target will be automatically inferred from the type in matrix or data.frame.

Usage

Dataset(
  data,
  target,
  type = NULL,
  name = as.name(deparse(substitute(data), 20)[[1]])
)

Arguments

data

A matrix or data.frame object with relevant data and named columns.

target

A string of a column name of data specifying the target.

type

A string specifying whether a regression or classification should be done.

name

Name attribute that will be stored internally.

Value

An object of class 'Dataset' with attributes 'data' containing the actual data as a data.frame, 'target' with the name of the target covariable, 'type' which is either 'classification' or 'regression' and 'name'.

Examples

cars.data <- Dataset(cars, target = "dist")