Skip to content
Back to formatted view

Raw Message

Message-ID: <CAPk9CsHyGQY-XBgSJLws8zH10=Cz1cSgCtpQQeVxPtGmzeDQjQ@mail.gmail.com>
Date: 2021-03-20T21:31:13Z
From: babelproofreader
Subject: Custom annotation vector in R tsmp package

I'd like to use a custom annotation vector (av) for a matrix profile (mp)
produced using the tsmp package, but I am unsure how to amend said profile
produced by e.g. the compute function.

I note that the package provides some functions to do this for "standard"
cases, such as av_complexity, av_hardlimit_artifact etc. and then av_apply,
but I want to apply a custom av. I have tried directly replacing the mp in
the results produced by compute, i.e.

result <- compute( data , ... )
result$mp <- my_av_mp

but this doesn't work as I get the following error

Error in `[.data.frame`(matrix_profile$mp, min_idx) :
undefined columns selected

Trying

result$mp[,1] <- my_av_mp

doesn't give an error, but when I try to use the amended result further,
i.e.

motif_results <- find_motif( result , n_motifs = 5 , ... )

I get the error

Error in apply(.mp$mp, 2, which.min) : dim(X) must have a positive length

What is the correct way to apply a custom av with the tsmp package?

	[[alternative HTML version deleted]]