View source: R/fit_bagofpatterns.R
fit_bagofpatterns | R Documentation |
Fit a dictionary to a dataset using SAX to create a 'bag of patterns'
fit_bagofpatterns(
data,
target = "target",
window_size = 0.2,
sparse_windows = FALSE,
normalize = FALSE,
alphabet_size = 4,
word_size = 8,
breakpoints = "quantiles",
word_weighting = tm::weightTf,
maximum_sparsity = NA,
verbose = TRUE
)
data |
a data frame where each row is a time series, along with a column for class |
target |
the name of the column where the class of each row is stored |
window_size |
The size of the sliding windows as applied to the time series, either as a fraction of the length or an integer of precise length. |
sparse_windows |
a logical, indicating whether |
normalize |
a logical, indicating whether each window should be z-normalized ( |
alphabet_size |
the number of distinct letters to use in the compressed SAX representation |
word_size |
the size of the 'words' generated out of the alphabet by SAX |
breakpoints |
the method used to assign letters (see |
word_weighting |
The weighting function for the DTM/TDM (default is term-frequency, effectively unweighted) |
maximum_sparsity |
A optional numeric for the maximal allowed sparsity in the range from bigger zero to smaller one. |
verbose |
whether to print the progress of model creation. |
This function creates a dictionary to a dataset of time series using seewave::SAX
and returns an model that can be used by bake_bagofpatterns
to convert that series
into a histogram of 'words'.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.