Learn R Programming

RemixAutoML (version 0.4.2)

TimeSeriesDataPrepare: TimeSeriesDataPrepare is a function that takes raw data and returns time series data

Description

TimeSeriesDataPrepare is a function that takes raw data and returns the necessary time series data and objects for model building. It also fills any time gaps with zeros. Use this before you run any time series model functions.

Usage

TimeSeriesDataPrepare(
  data,
  TargetName,
  DateName,
  Lags,
  SeasonalLags,
  MovingAverages,
  SeasonalMovingAverages,
  TimeUnit,
  FCPeriods,
  HoldOutPeriods,
  TSClean = TRUE,
  ModelFreq = TRUE,
  FinalBuild = FALSE
)

Arguments

data

Source data.table for forecasting

TargetName

Name of your target variable

DateName

Name of your date variable

Lags

The max number of lags you want to test

SeasonalLags

The max number of seasonal lags you want to test

MovingAverages

The max number of moving average terms

SeasonalMovingAverages

The max number of seasonal moving average terms

TimeUnit

The level of aggregation your dataset comes in. Choices include: 1Min, 5Min, 10Min, 15Min, and 30Min, hour, day, week, month, quarter, year

FCPeriods

The number of forecast periods you want to have forecasted

HoldOutPeriods

The number of holdout samples to compare models against

TSClean

TRUE or FALSE. TRUE will kick off a time series cleaning operation. Outliers will be smoothed and imputation will be conducted.

ModelFreq

TRUE or FALSE. TRUE will enable a model-based time frequency calculation for an alternative frequency value to test models on.

FinalBuild

Set to TRUE to create data sets with full data

Value

Time series data sets to pass onto auto modeling functions

See Also

Other Time Series Helper: FinalBuildArfima(), FinalBuildArima(), FinalBuildETS(), FinalBuildNNET(), FinalBuildTBATS(), FinalBuildTSLM(), GenerateParameterGrids(), OptimizeArfima(), OptimizeArima(), OptimizeETS(), OptimizeNNET(), OptimizeTBATS(), OptimizeTSLM(), ParallelAutoARIMA(), ParallelAutoArfima(), ParallelAutoETS(), ParallelAutoNNET(), ParallelAutoTBATS(), ParallelAutoTSLM(), PredictArima(), RL_Performance(), Regular_Performance(), StackedTimeSeriesEnsembleForecast(), WideTimeSeriesEnsembleForecast()

Examples

Run this code
# NOT RUN {
data <- data.table::fread(
  file.path(PathNormalizer(
    "C:\\Users\\aantico\\Documents\\Package\\data"),
    "tsdata.csv"))
TimeSeriesDataPrepare(
  data = data,
  TargetName = "Weekly_Sales",
  DateName = "Date",
  Lags = 5,
  MovingAverages,
  SeasonalMovingAverages,
  SeasonalLags = 1,
  TimeUnit = "week",
  FCPeriods = 10,
  HoldOutPeriods = 10,
  TSClean = TRUE,
  ModelFreq = TRUE,
  FinalBuild = FALSE)
# }

Run the code above in your browser using DataLab