Learn R Programming

tspredit (version 1.2.767)

ts_aug_shrink: Augmentation by Shrink

Description

Decrease within-window deviation magnitude by a scaling factor to generate lower-variance variants while preserving the mean.

Usage

ts_aug_shrink(scale_factor = 0.8)

Value

A ts_aug_shrink object.

Arguments

scale_factor

Numeric factor used to scale deviations.

References

  • Q. Wen et al. (2021). Time Series Data Augmentation for Deep Learning: A Survey. IJCAI Workshop on Time Series.

Examples

Run this code
# Shrink augmentation reduces within-window deviations
# Load package and example dataset
library(daltoolbox)
data(tsd)

# Convert to sliding windows and preview
xw <- ts_data(tsd$y, 10)
ts_head(xw)

# Apply shrink augmentation and inspect augmented windows
augment <- ts_aug_shrink()
augment <- fit(augment, xw)
xa <- transform(augment, xw)
ts_head(xa)

Run the code above in your browser using DataLab