create_dtw_grids: Create a parameter grid list for 'dtwclust' and 'dtw'...

View source: R/create-dtw-grids.R

create_dtw_gridsR Documentation

Create a parameter grid list for dtwclust and dtw distance functions

Description

create_dtw_grids() creates a nested, parameter grid list for dtwclust and dtw distance functions to be used in dtw_dist_gridsearch().

Usage

create_dtw_grids(params)

Arguments

params

A named list of parameter name-value pairs. The names should be the names of the distance functions that correspond to the parameter name-value pairs.

Value

Named, nested list where each element is a list of elements that represent each possible configuration for the parameters of that distance function.

Examples


params_ls_lg <- list(dtw_basic = list(window.size = 5:10,
                                      norm = c("L1", "L2"),
                                      step.pattern = list(dtw::symmetric1, dtw::symmetric2)),
                     dtw2 = list(step.pattern = list(dtw::symmetric1, dtw::symmetric2),
                                 window.size = 5:10),
                     dtw_lb = list(window.size = 5:10,
                                   norm = c("L1", "L2"),
                                   dtw.func = "dtw_basic",
                                   step.pattern = list(dtw::symmetric2)),
                     sbd = list(znorm = TRUE, return.shifted = FALSE),
                     gak = list(normalize = TRUE, window.size = 5:10))

dtw_grids_lg <- create_dtw_grids(params_ls_lg)
str(dtw_grids_lg$dtw_basic[1:4])


# Can still be ran with a minimal "grid"
params_ls_sm <- list(dtw2 = list(step.pattern = list(dtw::symmetric1)))

dtw_grids_sm <- create_dtw_grids(params_ls_sm)
head(dtw_grids_sm)

ercbk/ebtools documentation built on Feb. 22, 2025, 1:51 p.m.