
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.
TimeSeriesDataPrepare(
data,
TargetName,
DateName,
Lags,
SeasonalLags,
MovingAverages,
SeasonalMovingAverages,
TimeUnit,
FCPeriods,
HoldOutPeriods,
TSClean = TRUE,
ModelFreq = TRUE,
FinalBuild = FALSE
)
Source data.table for forecasting
Name of your target variable
Name of your date variable
The max number of lags you want to test
The max number of seasonal lags you want to test
The max number of moving average terms
The max number of seasonal moving average terms
The level of aggregation your dataset comes in. Choices include: 1Min, 5Min, 10Min, 15Min, and 30Min, hour, day, week, month, quarter, year
The number of forecast periods you want to have forecasted
The number of holdout samples to compare models against
TRUE or FALSE. TRUE will kick off a time series cleaning operation. Outliers will be smoothed and imputation will be conducted.
TRUE or FALSE. TRUE will enable a model-based time frequency calculation for an alternative frequency value to test models on.
Set to TRUE to create data sets with full data
Time series data sets to pass onto auto modeling functions
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()
# 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