Skip to content

fetch_electricity_demand

yohou.datasets.fetch_electricity_demand(*, data_home=None, download_if_missing=True, n_retries=3, delay=1.0)

Fetch the Australian Electricity Demand dataset from Monash/Zenodo.

5 half-hourly time series of electricity demand from five Australian states: New South Wales, Queensland, South Australia, Tasmania, and Victoria (232 272 time steps).

Parameters

Name Type Description Default
data_home str, PathLike, or None

Specify another download and cache folder for the datasets. By default all yohou data is stored in ~/yohou_data/.

None
download_if_missing bool

If False, raise an OSError if the data is not locally available instead of trying to download it.

True
n_retries int

Number of retries when HTTP errors are encountered.

3
delay float

Number of seconds between retries.

1.0

Returns

Type Description
Bunch

Dictionary-like object with the following attributes:

frame : pl.DataFrame DataFrame with "time" (Datetime) and 5 state columns using the __ separator convention (e.g. "nsw__demand"). feature_names : list of str Non-time column names. DESCR : str Full description of the dataset. frequency : str "30m". n_series : int 5. filename : str Path to the cached parquet file.

See Also

References

  1. Godahewa, R., Bergmeir, C., Webb, G. I., Hyndman, R. J., & Montero-Manso, P. (2021). "Monash Time Series Forecasting Archive." Neural Information Processing Systems Track on Datasets and Benchmarks. https://doi.org/10.5281/zenodo.4659727

Examples

>>> from yohou.datasets import fetch_electricity_demand
>>> bunch = fetch_electricity_demand()
>>> bunch.frame.columns[:2]
['time', 'nsw__demand']

Source Code

Source code in src/yohou/datasets/_fetchers.py
def fetch_electricity_demand(
    *,
    data_home: str | os.PathLike | None = None,
    download_if_missing: bool = True,
    n_retries: int = 3,
    delay: float = 1.0,
) -> Bunch:
    """Fetch the Australian Electricity Demand dataset from Monash/Zenodo.

    5 half-hourly time series of electricity demand from five
    Australian states: New South Wales, Queensland, South Australia,
    Tasmania, and Victoria (232 272 time steps).

    Parameters
    ----------
    data_home : str, PathLike, or None
        Specify another download and cache folder for the datasets.
        By default all yohou data is stored in ``~/yohou_data/``.
    download_if_missing : bool, default=True
        If ``False``, raise an ``OSError`` if the data is not locally
        available instead of trying to download it.
    n_retries : int, default=3
        Number of retries when HTTP errors are encountered.
    delay : float, default=1.0
        Number of seconds between retries.

    Returns
    -------
    Bunch
        Dictionary-like object with the following attributes:

        frame : pl.DataFrame
            DataFrame with ``"time"`` (Datetime) and 5 state columns
            using the ``__`` separator convention
            (e.g. ``"nsw__demand"``).
        feature_names : list of str
            Non-time column names.
        DESCR : str
            Full description of the dataset.
        frequency : str
            ``"30m"``.
        n_series : int
            ``5``.
        filename : str
            Path to the cached parquet file.

    See Also
    --------
    - [`fetch_pedestrian_counts`][yohou.datasets._fetchers.fetch_pedestrian_counts] : Hourly pedestrian sensor series.
    - [`fetch_kdd_cup`][yohou.datasets._fetchers.fetch_kdd_cup] : Hourly air quality series.
    - [`get_data_home`][yohou.datasets._fetchers.get_data_home] : Return the path of the data directory.

    References
    ----------
    [1] Godahewa, R., Bergmeir, C., Webb, G. I., Hyndman, R. J., &
        Montero-Manso, P. (2021). "Monash Time Series Forecasting Archive."
        Neural Information Processing Systems Track on Datasets and
        Benchmarks. https://doi.org/10.5281/zenodo.4659727

    Examples
    --------
    >>> from yohou.datasets import fetch_electricity_demand
    >>> bunch = fetch_electricity_demand()  # doctest: +SKIP
    >>> bunch.frame.columns[:2]  # doctest: +SKIP
    ['time', 'nsw__demand']

    """
    return _fetch_dataset(
        metadata=ELECTRICITY_DEMAND,
        dataset_name="electricity_demand",
        value_column_name="demand",
        data_home=data_home,
        download_if_missing=download_if_missing,
        n_retries=n_retries,
        delay=delay,
    )

Tutorials

The following example notebooks use this component:

  • How to Tune Fourier Seasonality Terms


    Explore how Fourier harmonic count affects seasonal fit quality, compare Fourier vs Pattern seasonality, and tune harmonics jointly with GridSearchCV.

    View ยท Open in marimo