Classification assessment

Description

This functions create data partitions and compute assessment metrics.

Usage

1
2
3
4
5
## S4 method for signature 'twdtwTimeSeries'
splitDataset(object, times = 1, p = 0.1, ...)

## S4 method for signature 'list'
twdtwAssess(object, matrix = FALSE)

Arguments

object

an object of class twdtwTimeSeries or twdtwMatches.

times

Number of partitions to create.

p

the percentage of data that goes to training. See createDataPartition for details.

...

Other arguments to be passed to createPatterns.

matrix

logical. If TRUE retrieves the confusion matrix. FALSE retrieves User's Accuracy (UA) and Producer's Accuracy (PA). Dafault is FALSE.

Details

splitDataset:

This function splits the a set of time series into training and validation. The function uses stratified sampling and a simple random sampling for each stratum. Each data partition returned by this function has the temporal patterns and a set of time series for validation.

twdtwAssess:

The function splitDataset performs the assessment of the classification based on the labels of the classified time series (Reference) and the labels of the classification (Predicted). This function returns a data.frame with User's and Produce's Accuracy or a list for confusion matrices.

Author(s)

Victor Maus, vwmaus1@gmail.com

See Also

twdtwMatches-class, twdtwApply, and twdtwClassify.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
load(system.file("lucc_MT/field_samples_ts.RData", package="dtwSat"))
set.seed(1)
partitions = splitDataset(field_samples_ts, p=0.1, times=5, 
                          freq = 8, formula = y ~ s(x, bs="cc"))
log_fun = logisticWeight(alpha=-0.1, beta=50) 
twdtw_res = lapply(partitions, function(x){
   res = twdtwApply(x = x$ts, y = x$patterns, weight.fun = log_fun, n=1)
   twdtwClassify(x = res)
})
assessment = twdtwAssess(twdtw_res)
head(assessment, 5)

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.