classify.array {TSEAL} | R Documentation |
Classifies observations based on a pretrained model.
Description
This function allows to classify observations based on a pretrained model that could have been obtained in several ways (such as using the train model function).
Usage
## S3 method for class 'array'
classify(data, model, ...)
Arguments
data |
Sample from the population (dim x length x cases) |
model |
pretrained discriminant model (lda or qda) |
... |
Additional arguments |
Value
A factor with predicted class of each observation
See Also
Examples
load(system.file("extdata/ECGExample.rda",package = "TSEAL"))
# We simulate that the second series has been obtained after
Series1 <- ECGExample[, , 1:9]
Series2 <- ECGExample[, , 10, drop = FALSE]
# Training a discriminant model
MWA <- MultiWaveAnalysis(Series1, "haar", features = c("var"))
MWADiscrim <- StepDiscrim(MWA, c(rep(1, 5), rep(2, 4)), maxvars = 5,
features = c("var"))
model <- trainModel(MWADiscrim, c(rep(1, 5), rep(2, 4)), "linear")
# Using the discriminant trained on new data
prediction <- classify(Series2, model)
[Package TSEAL version 0.1.3 Index]