predict_tsc: Predict using a TrainAndPredict Object.

Description Usage Arguments Value Examples

View source: R/TSClassifier.R

Description

Predicts newdata using the model obtained during training.

Usage

1
2
predict_tsc(newdata, target = NULL, model_path, data_path = NULL,
  cleanup_data = FALSE)

Arguments

newdata

character(1) | data.frame
Either a data.frame containing the data, or a file path to data used for prediction.

target

character(1)
Name of the target variable. Can be NULL.

model_path

character(1)
Path where the prediction model should be obtained from.

data_path

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

cleanup_data

logical(1)
Should newdata be deleted from disk after training?

Value

factor Vector of predictions.

Examples

1
2
3
4
5
6
  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)
  predict_tsc(data, target = "class", model_path = model_path)

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