train_tsc: Train a time-series classifier

Description Usage Arguments Value Examples

View source: R/TSClassifier.R

Description

Set the "java.options" option to use a higher memory if required (e.g. "-Xmx2048m").

Usage

1
2
train_tsc(data, target = NULL, classifier, par_vals = NULL,
  model_path = NULL, data_path = NULL, cleanup_data = FALSE)

Arguments

data

character(1) | data.frame
Either a path to the dataset or a data.frame that should be saved to disk for modeling. In case a data.frame is provided, the dataset is saved to disk via data_to_path.

target

character(1)
Name of the target variable.

classifier

character(1)
Character describing the classifier. See ?tsc_classifiers.

par_vals

list
(Optional) Hyperparameters for the models.
See ?tsc_classifiers for hyperparameters.

model_path

character(1)
Path where the resulting model should be saved to.

data_path

character(1)
Path where train and test data should be saved to. Defaults to a temporary file.

cleanup_data

logical(1)
Should the data be deleted from disk after training / prediction?

Value

NULL, Writes a Java instance of TrainAndPredict to model_path.

Examples

1
2
3
4
5
  data = data.frame(matrix(rnorm(300), nrow = 30))
  data$class = factor(sample(letters[1:2], 10, replace = TRUE))
  model_path = tempfile()
  train_tsc(data, target = "class", classifier = "weka.classifiers.trees.J48",
    model_path = model_path)

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