Learn R Programming

dtwSat (version 0.2.8)

twdtwCrossValidation-class: class "twdtwCrossValidation"

Description

This class stores the results of the cross-validation.

Usage

# S4 method for twdtwCrossValidation
show(object)

# S4 method for twdtwCrossValidation summary(object, conf.int = 0.95, ...)

Arguments

object

an object of class twdtwCrossValidation.

conf.int

specifies the confidence level (0-1) for interval estimation of the population mean. For more details see mean_cl_boot.

...

Other arguments. Not used.

Slots

partitions:

A list with the indices of time series used for training.

accuracy:

A list with the accuracy and other TWDTW information for each data partitions.

Author

Victor Maus, vwmaus1@gmail.com

References

Maus:2019dtwSat

Maus:2016dtwSat

See Also

twdtwMatches-class, createPatterns, and twdtwApply.

Examples

Run this code
if (FALSE) {
# Data folder 
data_folder = system.file("lucc_MT/data", package = "dtwSat")

# Read dates 
dates = scan(paste(data_folder,"timeline", sep = "/"), what = "dates")

# Read raster time series 
evi = brick(paste(data_folder,"evi.tif", sep = "/"))
raster_timeseries = twdtwRaster(evi, timeline = dates)

# Read field samples 
field_samples = read.csv(paste(data_folder,"samples.csv", sep = "/")) 
table(field_samples[["label"]])

# Read field samples projection 
proj_str = scan(paste(data_folder,"samples_projection", sep = "/"), 
     what = "character")

# Get sample time series from raster time series 
field_samples_ts = getTimeSeries(raster_timeseries, 
     y = field_samples, proj4string = proj_str)
field_samples_ts

# Run cross validation
set.seed(1)
# Define TWDTW weight function 
log_fun = logisticWeight(alpha=-0.1, beta=50) 
cross_validation = twdtwCrossValidate(field_samples_ts, times=3, p=0.1, 
                          freq = 8, formula = y ~ s(x, bs="cc"), weight.fun = log_fun)
cross_validation

summary(cross_validation)

plot(cross_validation)

}

Run the code above in your browser using DataLab