tests/testthat/test-05-regression-02-dtwb.R

# =================================================================================================
# setup
# =================================================================================================

## Original objects in env
ols <- ls()

# =================================================================================================
# dtwb with L1 and L2 norms
# =================================================================================================

test_that("Pairwise proxy distances give the same result as references", {
    skip_on_cran()
    local_edition(2)

    D2_L1 <- proxy::dist(data[31L:46L], data[71L:86L], method = "dtw_basic")
    D2_L2 <- proxy::dist(data[31L:16L], data[71L:16L], method = "dtw_basic", norm = "L2")

    expect_known_value(D2_L1, "rds/dtwb_l1.rds")
    expect_known_value(D2_L2, "rds/dtwb_l2.rds")
})

# =================================================================================================
# clean
# =================================================================================================
rm(list = setdiff(ls(), ols))

Try the dtwclust package in your browser

Any scripts or data that you put into this service are public.

dtwclust documentation built on Sept. 11, 2024, 9:07 p.m.