Learn R Programming

tsmp (version 0.3.1)

sdts_score: Computes the F-Score of a SDTS prediction

Description

Computes the F-Score of a SDTS prediction.

Usage

sdts_score(gtruth, pred, beta = 1)

Arguments

gtruth

a vector of logical. Ground truth annotation.

pred

a vector of logical. Predicted annotation from sdts_predict()

beta

a numeric. See details. (default is 1).

Value

Returns a list with f_score, precision and recall.

Details

beta is used to balance F-score towards recall (>1) or precision (<1).

References

  • Yeh C-CM, Kavantzas N, Keogh E. Matrix profile IV: Using Weakly Labeled Time Series to Predict Outcomes. Proc VLDB Endow. 2017 Aug 1;10(12):1802<U+2013>12.

Website: https://sites.google.com/view/weaklylabeled

See Also

Other Scalable Dictionaries: sdts_predict, sdts_train

Examples

Run this code
# NOT RUN {
# This is a fast toy example and results are useless. For a complete result, run the code inside
#'Not run' section below.
w <- c(110, 220)
subs <- 11000:20000
tr_data <- mp_test_data$train$data[subs]
tr_label <- mp_test_data$train$label[subs]
te_data <- mp_test_data$test$data[subs]
te_label <- mp_test_data$test$label[subs]
model <- sdts_train(tr_data, tr_label, w, verbose = 0)
predict <- sdts_predict(model, te_data, round(mean(w)))
sdts_score(te_label, predict, 1)

# }
# NOT RUN {
windows <- c(110, 220, 330)
model <- sdts_train(mp_test_data$train$data, mp_test_data$train$label, windows)
predict <- sdts_predict(model, mp_test_data$test$data, round(mean(windows)))
sdts_score(mp_test_data$test$label, predict, 1)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab