---
title: Time series modeling
description: Follow the steps used to create time series models.
---

# Time series modeling {: #time-series-modeling }

!!! info "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)](otv), 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](ts-framework) for a description of the framework elements. See the section on [nowcasting](nowcasting) to better understand that framework.

![](images/framework-1.png)

## Requirements and availability {: #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](#time-steps)
* [Data requirements](#data-requirements)
* [Interval units](#interval-units)
* [Project types](#project-types)

See these additional considerations for [OTV](otv#feature-considerations) and [time series](ts-consider) modeling.

## Basic workflow {: 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](whatis-time) 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, the **Set up time-aware modeling** link activates. Click the link to get started.

	![](images/time-enable.png)

2. From the dropdown, select the primary date/time feature. The dropdown lists all date/time features that DataRobot detected during [EDA1](eda-explained).

	![](images/time-select.png)

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 for [multiseries modeling](multiseries), this histogram represents the average of the time feature values across all series plotted against the target feature.

	![](images/time-histo.png)

4. Select the time series approach you would like to apply:

	![](images/tam1.png)

	* Use [**Automated time series forecasting**](ts-flow-overview) when you want to forecast multiple future values of the target (for example, predicting sales for each day next week). Use this to extrapolate future values in a continuous sequence.
	* Use [**Automated time series nowcasting**](nowcasting) when you want to use modeling to determine current values.

    Or, use [**Automated machine learning**](otv) (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 for [multiseries](multiseries) modeling.

    ![](images/ts-multi-1.png)

  	* If DataRobot does not detect a series but your dataset qualifies, set the series identifier using [**Advanced options**](multiseries#set-the-series-id-through-advanced-options).
  	* To enable [segmented modeling](ts-segmented), after selecting the series identifier, click to change the value of **Segmentation method** from *None* to your segment ID.

  		![](images/ts-segment-1.png)

6. If you were prompted that your time step was irregular, consider employing the [data prep tool](ts-data-prep).

	![](images/tsd-prep-6.png)

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 the [detailed guidance](ts-customization#set-window-values) for the meaning and implication of each window.

	!!! note
    	If using [nowcasting](nowcasting), these window settings differ.

	![](images/time-windows-1.png)

8. Set the training window format, either **Duration** or **Row Count**, to specify how Autopilot chooses training periods when building models. Before setting this value, see [the details](ts-customization#duration-and-row-count) of row count vs. duration and how they apply to different folds. Note that, for irregular datasets, the setting defaults to **Row Count**. Use the [data prep tool](ts-data-prep) before changing this setting.

	![](images/otp-training.png)

9. Consider whether to set ["known in advance" (KA)](ts-adv-opt#set-known-in-advance-ka) features or to upload an [event calendar](ts-adv-opt#calendar-files) (both set in the advanced options).

  * Features treated as KA variables are used unlagged when making predictions.
  * Calendars list events for DataRobot to use when automatically deriving time series features (setting features as unlagged when making predictions).

	![](images/time-kia-cal.png)

10. Explore what a feature looks like over time to view its [trends](glossary/index#trend) and 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 the [**Over Time**](ts-leaderboard#understand-a-features-over-time-chart) tab, and click **Compute Feature Over Time**:

  	![](images/time-fot.png)

  	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. Click **Show time bins** to see the number of rows per bin (blue bars at the bottom of the plot). Visualization of data density can provide information about potential [missing values](ts-create-data#handle-missing-values).

  	Read further options for [interacting with the **Over Time**](ts-leaderboard#understand-a-features-over-time-chart) chart.

11. To modify additional settings used for modeling (date/time format, training window, validation length, etc.), scroll down and expand **Show advanced options**. See the [full documentation](ts-adv-opt) for more information.

	![](images/time-show-adv.png)

12. Once all configuration is set, choose [a modeling mode](multistep-ta) and press **Start**.

13. When the modeling process begins, DataRobot analyzes the target and creates time-based features to use for modeling. Display the **Data** page to watch the new features as they are created. By default DataRobot displays the **Derived Modeling Data** panel; to see your original data, click **Original Time Series Data**.

	* Click [**View more info**](ts-create-data#review-data-and-new-features) for more specific feature generation details, including access to the derivation log.

	    ![](images/time-data-summary.png)

	*  View the [Feature Lineage](ts-leaderboard#feature-lineage-tab) chart to understand the process that created any feature:

	    ![](images/time-feat-line.png)

14. After reviewing the dataset, consider whether you want to [restore any features](restore-features) that were pruned by the feature reduction process.

15. Finally, if desired work with the [time series feature lists](ts-feature-lists) used for modeling.

## Next steps {: next-steps }

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

Section | Describes...
------- | -----------
[Time series Leaderboard models](ts-leaderboard#investigate-models) | Working with Leaderboard models, including changing training and sampling criteria.
[Making predictions](ts-predictions) | Making predictions and preparing for deployment.
[Customize project settings](ts-customization) | Modifying default partitioning and window settings for use-case specific implementations.

And further reading:

Section | Describes...
------- | -----------
[Framework](ts-framework) | The framework DataRobot uses to build time series models, including common [patterns](ts-framework#common-patterns-of-time-series-data) in time series data.
[Derived modeling dataset](ts-create-data#review-data-and-new-features) | DataRobot's feature derivation process, which freates a new modeling dataset for time series projects.
[Feature lists](ts-feature-lists) | Specialized for time series modeling.
[Automated Feature Engineering for Time Series Data](https://www.kdnuggets.com/2017/11/automated-feature-engineering-time-series-data.html){ target=_blank } |  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 {: #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 the [**Repository**](repository).

* 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.

??? info "For a time series project with multiple FDs, what do the displayed Leaderboard evaluation metrics correspond to?"

     When a project has multiple FDs, the Leaderboard metric is a calculated summary across all FDs, across all dates, and across all series. That is, for each FD DataRobot generates predictions for each day in validation and for each series. Then, using actuals for each of those predictions, DataRobot calculate the loss metric such that the Leaderboard shows the loss metrics across all those predictions. If there are  too many FDs, sampling is used.
     
     For example, for a project with 30 series, 30 days of validation, and 30 FDs, DataRobot generates `30*30*30` predictions and then applies the loss function.

### Time steps {: #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_](glossary/index#time-step)&mdash;the typical time difference between rows&mdash;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](ts-create-data) that can use conventional machine learning techniques. (Note that a time step is different than a [time interval](#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
	When a time step is irregular, you can use [row-based partitioning](ts-customization#duration-and-row-count) or the [data prep tool](ts-data-prep) tool (to avoid the inaccurate rolling statistics these gaps can cause).

### Data requirements {: #data-requirements }

To activate time-series modeling:

* The time series dataset must meet the [file size and row requirements](file-types#time-series-file-import-sizes).
* 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](ts-data-prep) for potential solutions.
* The dataset must contain a column with a [variable type “Date”](file-types#special-column-detection) for partitioning.

!!! note
	There are times that you may want to [partition without holdout](ts-leaderboard#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 {: #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 {: #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:
	* [**Treat as exponential trend?**](ts-adv-opt#treat-as-exponential-trend)
	* [**Apply differencing?**](ts-adv-opt#apply-differencing)
	* [**Exposure**](additional#set-exposure)
* 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](ts-customization#set-window-values).
* Classification blueprints do not use naive predictions as offset in modeling.