Learn R Programming

RemixAutoML (version 0.11.0)

AutoXGBoostCARMA: AutoXGBoostCARMA Automated XGBoost Calendar, Holiday, ARMA, and Trend Variables Forecasting

Description

AutoXGBoostCARMA Automated XGBoost Calendar, Holiday, ARMA, and Trend Variables Forecasting. Create hundreds of thousands of time series forecasts using this function.

Usage

AutoXGBoostCARMA(data, TargetColumnName = "Target",
  DateColumnName = "DateTime", GroupVariables = NULL,
  FC_Periods = 30, TimeUnit = "week", TargetTransformation = FALSE,
  Lags = c(1:5), MA_Periods = c(1:5), CalendarVariables = FALSE,
  HolidayVariable = TRUE, TimeTrendVariable = FALSE,
  DataTruncate = FALSE, ZeroPadSeries = NULL, SplitRatios = c(0.7,
  0.2, 0.1), TreeMethod = "hist", NThreads = max(1,
  parallel::detectCores() - 2), EvalMetric = "MAE", GridTune = FALSE,
  GridEvalMetric = "mae", ModelCount = 1, NTrees = 1000,
  PartitionType = "timeseries", Timer = TRUE)

Arguments

data

Supply your full series data set here

TargetColumnName

List the column name of your target variables column. E.g. "Target"

DateColumnName

List the column name of your date column. E.g. "DateTime"

GroupVariables

Defaults to NULL. Use NULL when you have a single series. Add in GroupVariables when you have a series for every level of a group or multiple groups.

FC_Periods

Set the number of periods you want to have forecasts for. E.g. 52 for weekly data to forecast a year ahead

TimeUnit

List the time unit your data is aggregated by. E.g. "1min", "5min", "10min", "15min", "30min", "hour", "day", "week", "year"

TargetTransformation

Run AutoTransformationCreate() to find best transformation for the target variable. Tests YeoJohnson, BoxCox, and Asigh (also Asin and Logit for proportion target variables).

Lags

Select the periods for all lag variables you want to create. E.g. c(1:5,52)

MA_Periods

Select the periods for all moving average variables you want to create. E.g. c(1:5,52)

CalendarVariables

Set to TRUE to have calendar variables created. The calendar variables are numeric representations of second, minute, hour, week day, month day, year day, week, isoweek, quarter, and year

HolidayVariable

Set to TRUE to have a holiday counter variable created.

TimeTrendVariable

Set to TRUE to have a time trend variable added to the model. Time trend is numeric variable indicating the numeric value of each record in the time series (by group). Time trend starts at 1 for the earliest point in time and increments by one for each success time point.

DataTruncate

Set to TRUE to remove records with missing values from the lags and moving average features created

ZeroPadSeries

Set to "all", "inner", or NULL. See TimeSeriesFill for explanation

SplitRatios

E.g c(0.7,0.2,0.1) for train, validation, and test sets

TreeMethod

Choose from "hist", "gpu_hist"

NThreads

Set the maximum number of threads you'd like to dedicate to the model run. E.g. 8

EvalMetric

Select from "r2", "RMSE", "MSE", "MAE"

GridTune

Set to TRUE to run a grid tune

GridEvalMetric

This is the metric used to find the threshold 'poisson', 'mae', 'mape', 'mse', 'msle', 'kl', 'cs', 'r2'

ModelCount

Set the number of models to try in the grid tune

NTrees

Select the number of trees you want to have built to train the model

PartitionType

Select "random" for random data partitioning "time" for partitioning by time frames

Timer

= TRUE

Value

Returns a data.table of original series and forecasts, the catboost model objects (everything returned from AutoCatBoostRegression()), a time series forecast plot, and transformation info if you set TargetTransformation to TRUE. The time series forecast plot will plot your single series or aggregate your data to a single series and create a plot from that.

See Also

Other Automated Time Series: AutoCatBoostCARMA, AutoH2oDRFCARMA, AutoH2oGBMCARMA, AutoTS

Examples

Run this code
# NOT RUN {
Results <- AutoXGBoostCARMA(data,
                            TargetColumnName = "Target",
                            DateColumnName = "DateTime",
                            GroupVariables = NULL,
                            FC_Periods = 30,
                            TimeUnit = "week",
                            TargetTransformation = FALSE,
                            Lags = c(1:5),
                            MA_Periods = c(1:5),
                            CalendarVariables = FALSE,
                            HolidayVariable = TRUE,
                            TimeTrendVariable = FALSE,
                            DataTruncate = FALSE,
                            ZeroPadSeries = "all",
                            SplitRatios = c(0.7, 0.2, 0.1),
                            TreeMethod = "hist",
                            NThreads = max(1, parallel::detectCores()-2),
                            EvalMetric = "MAE",
                            GridTune = FALSE,
                            GridEvalMetric = "mape",
                            ModelCount = 1,
                            NTrees = 1000,
                            PartitionType = "timeseries",
                            Timer = TRUE)
Results$TimeSeriesPlot
Results$Forecast
Results$ModelInformation$...
# }

Run the code above in your browser using DataLab