# Time series modeling
URL: https://docs.datarobot.com/en/docs/classic-ui/modeling/time/ts-flow-overview.html

> Follow the steps used to create time series models.

# Time series modeling

> [!NOTE] Availability information
> Contact your DataRobot representative for information on enabling automated time series (AutoTS) modeling.

Time series modeling forecasts multiple future values of the target. With [out-of-time validation (OTV)](https://docs.datarobot.com/en/docs/classic-ui/modeling/special-workflows/otv.html), by contrast, you are not forecasting but instead modeling time-relevant data and predicting the target value on each individual row. Time series forecast modeling is based on the following framework; see [the reference section](https://docs.datarobot.com/en/docs/reference/pred-ai-ref/ts-reference/ts-framework.html) for a description of the framework elements. See the section on [nowcasting](https://docs.datarobot.com/en/docs/classic-ui/modeling/time/nowcasting.html) to better understand that framework.

## Requirements and availability

Be sure to review the time step, data requirements, interval units, and acceptable project types for time series modeling, which are described in detail below.

- Time steps
- Data requirements
- Interval units
- Project types

See these additional considerations for [OTV](https://docs.datarobot.com/en/docs/classic-ui/modeling/special-workflows/otv.html#feature-considerations) and [time series](https://docs.datarobot.com/en/docs/reference/pred-ai-ref/ts-reference/ts-consider.html) modeling.

## Basic workflow

The following describes the steps to build time series models. Each step links to detailed explanations and descriptions of the options, where applicable. See the time series [overview and description](https://docs.datarobot.com/en/docs/classic-ui/modeling/time/whatis-time.html) for detailed descriptions of how DataRobot implements time series modeling.

1. Load your dataset and select the target feature. If the dataset contains a date feature, theSet up time-aware modelinglink activates. Click the link to get started.
2. From the dropdown, select the primary date/time feature. The dropdown lists all date/time features that DataRobot detected duringEDA1.
3. After selecting a feature, DataRobot computes and then loads a histogram of the time feature plotted against the target feature (feature-over-time). Note that if your dataset qualifies formultiseries modeling, this histogram represents the average of the time feature values across all series plotted against the target feature.
4. Select the time series approach you would like to apply: Or, useAutomated machine learning(OTV) when your data is time-relevant but you are not forecasting (instead, you are predicting the target value on each individual row). Use this if you have single event data, such as patient intake or loan defaults.
5. If you selected time series and DataRobot detects series data, set the series ID formultiseriesmodeling.
6. If you were prompted that your time step was irregular, consider employing thedata prep tool.
7. Customize the window settings (Feature Derivation Window (FDW) and Forecast Window (FW)) to configure how DataRobot derives features for the modeling dataset. Before modifying these values, see thedetailed guidancefor the meaning and implication of each window. NoteIf usingnowcasting, these window settings differ.
8. Set the training window format, eitherDurationorRow Count, to specify how Autopilot chooses training periods when building models. Before setting this value, seethe detailsof row count vs. duration and how they apply to different folds. Note that, for irregular datasets, the setting defaults toRow Count. Use thedata prep toolbefore changing this setting.
9. Consider whether to set"known in advance" (KA)features or to upload anevent calendar(both set in the advanced options).
10. Features treated as KA variables are used unlagged when making predictions.
11. Calendars list events for DataRobot to use when automatically deriving time series features (setting features as unlagged when making predictions).
12. Explore what a feature looks like over time to view itstrendsand determine whether there are gaps in your data (which is a data flaw you need to know about). To access these histograms, expand a numeric feature and click the expand a numeric feature, click theOver Timetab, and clickCompute Feature Over Time: In this example, you can see a strong weekly pattern as well as a seasonal pattern. You can also change the resolution to see how the data aggregates at different intervals. ClickShow time binsto see the number of rows per bin (blue bars at the bottom of the plot). Visualization of data density can provide information about potentialmissing values. Read further options forinteracting with theOver Timechart.
13. To modify additional settings used for modeling (date/time format, training window, validation length, etc.), scroll down and expandShow advanced options. See thefull documentationfor more information.
14. Once all configuration is set, choosea modeling modeand pressStart.
15. When the modeling process begins, DataRobot analyzes the target and creates time-based features to use for modeling. Display theDatapage to watch the new features as they are created. By default DataRobot displays theDerived Modeling Datapanel; to see your original data, clickOriginal Time Series Data.
16. After reviewing the dataset, consider whether you want torestore any featuresthat were pruned by the feature reduction process.
17. Finally, if desired work with thetime series feature listsused for modeling.

## Next steps

The following sections describe how to continue with time series modeling:

| Section | Description |
| --- | --- |
| Time series Leaderboard models | Working with Leaderboard models, including changing training and sampling criteria. |
| Making predictions | Making predictions and preparing for deployment. |
| Customize project settings | Modifying default partitioning and window settings for use-case specific implementations. |

And further reading:

| Section | Description |
| --- | --- |
| Framework | The framework DataRobot uses to build time series models, including common patterns in time series data. |
| Derived modeling dataset | The feature derivation process in DataRobot, which creates a new modeling dataset for time series projects. |
| Feature lists | Specialized for time series modeling. |
| Automated Feature Engineering for Time Series Data | A more technical discussion of the general framework for developing time series models, including generating features and preprocessing the data as well as automating the process to apply advanced machine learning algorithms to almost any time series problem. |

## Deep dive: Requirements

The following sections provide details about models and project requirements, including:

- DataRobot builds both the standard algorithms and special time series blueprints to run specific models for time series. As always, you can run any time series models that DataRobot did not run from theRepository.
- DataRobot generates both traditional time series models (e.g., the ARIMA family) and advanced time series models (e.g., XGBoost).
- For models with the suffix "with Forecast Distance Modeling," DataRobot builds a different model for each distance in the future, each having a unique blueprint to make that prediction.
- The "Baseline prediction using most recent value" model (also known as "naive predictions") uses the most recent value or seasonal differences as the prediction; this model can be used as a baseline for judging performance.

### Time steps

The first step in time series modeling is to be certain that your data is the correct type to employ forecasting or nowcasting. DataRobot categorizes data based on the [time step](https://docs.datarobot.com/en/docs/reference/glossary/index.html#time-step) —the typical time difference between rows—as one of three types:

| Time step | Description | Example |
| --- | --- | --- |
| Regular | Regularly spaced events | Monday through Sunday |
| Semi-regular | Data that is mostly regularly spaced | Every business day but not weekends. |
| Irregular | No consistent time step | Random birthdays |

Assuming a regular or semi-regular time step, DataRobot's time series functionality works by encoding time-sensitive components as features, transforming your original input dataset into a [modeling dataset](https://docs.datarobot.com/en/docs/classic-ui/modeling/time/ts-modeling-data/ts-create-data.html) that can use conventional machine learning techniques. (Note that a time step is different than a [time interval](https://docs.datarobot.com/en/docs/classic-ui/modeling/time/ts-flow-overview.html#interval-units), which is described below.) For each original row of your data, the modeling dataset includes both:

- New rows representing examples of predicting different distances into the future.
- For each input feature, new columns of lagged features and rolling statistics for predicting that new distance.

> [!NOTE] Note
> When a time step is irregular, you can use [row-based partitioning](https://docs.datarobot.com/en/docs/classic-ui/modeling/time/ts-adv-modeling/ts-customization.html#duration-and-row-count) or the [data prep tool](https://docs.datarobot.com/en/docs/classic-ui/modeling/time/ts-modeling-data/ts-data-prep.html) tool (to avoid the inaccurate rolling statistics these gaps can cause).

### Data requirements

To activate time-series modeling:

- The time series dataset must meet the file size and row requirements .
- Even if your data contains time features, time series forecasting mode may be disabled if the data contains irregular time units or non-unique time stamps. If this happens, the time series data prep tool for potential solutions.
- The dataset must contain a column with a variable type “Date” for partitioning.

> [!NOTE] Note
> There are times that you may want to [partition without holdout](https://docs.datarobot.com/en/docs/classic-ui/modeling/time/ts-leaderboard.html#partition-without-holdout), which changes the minimum ingest rows and also the output of various visualizations.

If the requirements above are met, the date/time partitioning feature becomes available through the Set up time-aware modeling link on the Start screen.

### Interval units

Although many of the examples in this documentation show a time unit of "days," DataRobot supports several intervals for time series and multiseries modeling. Currently, DataRobot supports time steps that are integer multiples of the following units:

- row
- millisecond
- second
- minute
- hour
- day
- week
- month
- quarter
- year

For example, the time step between rows can be every 15 minutes (a multiple of minutes) but cannot be a fraction such as 13.23 minutes. DataRobot automatically detects the time unit and time step, and if it cannot, rejects the dataset as irregular. Datasets using milliseconds as a time unit must specify training and partitioning boundaries at the second level, and must span multiple seconds, for partitioning to operate correctly. Additionally, they must use the default forecast point to use a fractional-second forecast point.

### Project types

DataRobot’s time series modeling supports both regression and binary classification projects. Each type has a full selection of models available from Autopilot or the Repository, specific to the project type. Both types have generally the same workflow and options, with the following differences found in binary classification projects:

- In the advanced option settings, the following are disabled:
- Simple and seasonal differencing are not applied.
- Only classification metrics are supported.
- No differencing is performed, so feature lists using a differenced target are not created. By default, Autopilot runs on Baseline only (average baseline) and Time Series Informative Features . Note that "average baseline" refers to the average of the target in the feature derivation window .
- Classification blueprints do not use naive predictions as offset in modeling.

---
