data_to_path: Dump a data.frame to a .arff file.

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Saves a data.frame to an arff, so it can be used for the time-series classifier.

Usage

1
2
data_to_path(data, target = "target", data_path = NULL,
  step = "train")

Arguments

data

data.frame | character
Either a data.frame containing the data, or the file path. In the latter case, nothing happens and the file path is only checked for consistency.

target

character
Target variable.

data_path

character
Path to save data to. If NULL, a temporary file is created.

step

character
Step in the procedure, either "train or "test". Some additional steps are performed in case "train".

Value

The file path

Examples

1
2
3
  data = data.frame(matrix(rnorm(300), nrow = 30))
  data$class = factor(sample(letters[1:2], 10, replace = TRUE))
  data_to_path(data, target = "class", data_path = tempfile(), step = "train")

compstat-lmu/TSClassification documentation built on Nov. 18, 2019, 6:56 a.m.