> ## Documentation Index
> Fetch the complete documentation index at: https://nixtlaverse.nixtla.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Long Horizon

> Download and wrangling utility for long-horizon datasets.

##

### `ETTm2`

```python theme={null}
ETTm2(freq='15T', name='ETTm2', n_ts=7, test_size=11520, val_size=11520, horizons=(96, 192, 336, 720))
```

The ETTm2 dataset monitors an electricity transformer
from a region of a province of China including oil temperature
and variants of load (such as high useful load and high useless load)
from July 2016 to July 2018 at a fifteen minute frequency.

Reference:

* [Zhou, et al. Informer: Beyond Efficient Transformer for Long Sequence
  Time-Series Forecasting. AAAI 2021.](https://arxiv.org/abs/2012.07436)

### `ETTm1`

```python theme={null}
ETTm1(freq='15T', name='ETTm1', n_ts=7, test_size=11520, val_size=11520, horizons=(96, 192, 336, 720))
```

The ETTm1 dataset monitors an electricity transformer
from a region of a province of China including oil temperature
and variants of load (such as high useful load and high useless load)
from July 2016 to July 2018 at a fifteen minute frequency.

### `ETTh2`

```python theme={null}
ETTh2(freq='H', name='ETTh2', n_ts=1, test_size=11520, val_size=11520, horizons=(96, 192, 336, 720))
```

The ETTh2 dataset monitors an electricity transformer
from a region of a province of China including oil temperature
and variants of load (such as high useful load and high useless load)
from July 2016 to July 2018 at an hourly frequency.

### `ETTh1`

```python theme={null}
ETTh1(freq='H', name='ETTh1', n_ts=1, test_size=11520, val_size=11520, horizons=(96, 192, 336, 720))
```

The ETTh1 dataset monitors an electricity transformer
from a region of a province of China including oil temperature
and variants of load (such as high useful load and high useless load)
from July 2016 to July 2018 at an hourly frequency.

### `ECL`

```python theme={null}
ECL(freq='15T', name='ECL', n_ts=321, test_size=5260, val_size=2632, horizons=(96, 192, 336, 720))
```

The Electricity dataset reports the fifteen minute electricity
consumption (KWh) of 321 customers from 2012 to 2014.
For comparability, we aggregate it hourly.

Reference:

* [Li, S et al. Enhancing the locality and breaking the memory bottleneck of
  Transformer on time series forecasting. NeurIPS 2019.](http://arxiv.org/abs/1907.00235)

### `Exchange`

```python theme={null}
Exchange(freq='D', name='Exchange', n_ts=8, test_size=1517, val_size=760, horizons=(96, 192, 336, 720))
```

The Exchange dataset is a collection of daily exchange rates of
eight countries relative to the US dollar. The countries include
Australia, UK, Canada, Switzerland, China, Japan, New Zealand and
Singapore from 1990 to 2016.

Reference:

* [Lai, G., Chang, W., Yang, Y., and Liu, H. Modeling Long and Short-Term Temporal
  Patterns with Deep Neural Networks. SIGIR 2018.](http://arxiv.org/abs/1703.07015)

### `TrafficL`

```python theme={null}
TrafficL(freq='H', name='traffic', n_ts=862, test_size=3508, val_size=1756, horizons=(96, 192, 336, 720))
```

This large Traffic dataset was collected by the California Department
of Transportation, it reports road hourly occupancy rates of 862 sensors,
from January 2015 to December 2016.

Reference:

* [Lai, G., Chang, W., Yang, Y., and Liu, H. Modeling Long and
  Short-Term Temporal Patterns with Deep Neural Networks.
  SIGIR 2018.](http://arxiv.org/abs/1703.07015)
* [Wu, H., Xu, J., Wang, J., and Long, M. Autoformer: Decomposition Transformers
  with auto-correlation for long-term series forecasting.
  NeurIPS 2021.](https://arxiv.org/abs/2106.13008).

### `ILI`

```python theme={null}
ILI(freq='W', name='ili', n_ts=7, test_size=193, val_size=97, horizons=(24, 36, 48, 60))
```

This dataset reports weekly recorded influenza-like illness (ILI)
patients from Centers for Disease Control and Prevention of the
United States from 2002 to 2021. It is measured as a ratio of ILI
patients versus the total patients in the week.

Reference:

* [Wu, H., Xu, J., Wang, J., and Long, M. Autoformer: Decomposition Transformers
  with auto-correlation for long-term series forecasting. NeurIPS 2021.](https://arxiv.org/abs/2106.13008).

### `Weather`

```python theme={null}
Weather(freq='10M', name='weather', n_ts=21, test_size=10539, val_size=5270, horizons=(96, 192, 336, 720))
```

This Weather dataset contains the 2020 year of 21 meteorological
measurements
recorded every 10 minutes from the Weather Station of the Max Planck Biogeochemistry
Institute in Jena, Germany.

Reference:

* [Wu, H., Xu, J., Wang, J., and Long, M. Autoformer: Decomposition Transformers
  with auto-correlation for long-term series forecasting. NeurIPS 2021.](https://arxiv.org/abs/2106.13008).

### `LongHorizon`

```python theme={null}
LongHorizon(source_url='https://nhits-experiments.s3.amazonaws.com/datasets.zip')
```

This Long-Horizon datasets wrapper class, provides
with utility to download and wrangle the following datasets:
ETT, ECL, Exchange, Traffic, ILI and Weather.

* Each set is normalized with the train data mean and standard deviation.
* Datasets are partitioned into train, validation and test splits.
* For all datasets: 70%, 10%, and 20% of observations are train, validation, test,
  except ETT that uses 20% validation.

#### `LongHorizon.download`

```python theme={null}
download(directory)
```

Download ETT Dataset.

**Parameters:**

| Name        | Type                     | Description                         | Default    |
| ----------- | ------------------------ | ----------------------------------- | ---------- |
| `directory` | <code>[str](#str)</code> | Directory path to download dataset. | *required* |

#### `LongHorizon.load`

```python theme={null}
load(directory, group, cache=True)
```

Downloads and long-horizon forecasting benchmark datasets.

**Parameters:**

| Name        | Type                       | Description                                                                                                     | Default           |
| ----------- | -------------------------- | --------------------------------------------------------------------------------------------------------------- | ----------------- |
| `directory` | <code>[str](#str)</code>   | Directory where data will be downloaded.                                                                        | *required*        |
| `group`     | <code>[str](#str)</code>   | Group name. Allowed groups: 'ETTh1', 'ETTh2', 'ETTm1', 'ETTm2', 'ECL', 'Exchange', 'Traffic', 'Weather', 'ILI'. | *required*        |
| `cache`     | <code>[bool](#bool)</code> | If `True` saves and loads                                                                                       | <code>True</code> |

**Returns:**

| Type                                                                                                                                                                                               | Description                                                                                                                                                                                                                                                                            |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <code>[Tuple](#typing.Tuple)\[[DataFrame](#pandas.DataFrame), [Optional](#typing.Optional)\[[DataFrame](#pandas.DataFrame)], [Optional](#typing.Optional)\[[DataFrame](#pandas.DataFrame)]]</code> | Tuple\[pd.DataFrame, Optional\[pd.DataFrame], Optional\[pd.DataFrame]]: Target time series with columns \['unique\_id', 'ds', 'y'], Exogenous time series with columns \['unique\_id', 'ds', 'y'], Static exogenous variables with columns \['unique\_id', 'ds'] and static variables. |
