In almost all cases, use step_dct instead. The discrete cosine transform has better compaction in general. DCT coefficients are always real, while DFT returns complex numbers, which increases the number of dimensions.

step_fft(
  recipe,
  ...,
  role = "predictor",
  trained = FALSE,
  k = 4,
  dct = TRUE,
  series = NULL,
  skip = FALSE,
  id = recipes::rand_id("tff")
)

Arguments

recipe

A recipe object. The step will be added to the sequence of operations for this recipe.

...

One or more selector functions to choose which variables are affected by the step. See selections() for more details. For the tidy method, these are not currently used.

role

For model terms created by this step, what analysis role should they be assigned?. By default, the function assumes that the new columns created from the original variables will be used as predictors in a model.

trained

A logical to indicate if the quantities for preprocessing have been estimated.

k

The number of discrete Fourier transform coefficients

skip

A logical. Should the step be skipped when the recipe is baked by bake.recipe()? While all operations are baked when prep.recipe() is run, some operations may not be able to be conducted on new data (e.g. processing the outcome variable(s)). Care should be taken when using skip = TRUE as it may affect the computations for subsequent operations

id

A character string that is unique to this step to identify it.

coefs

A list of the length and coefficient indices for each time series passed to the step, created once the step has been trained.

References

Sayood, K. Introduction to Data Compression