module datasetsforecast.hierarchical


class Labour

Labour(freq: str = ‘MS’, horizon: int = 8, papers_horizon: int = 12, seasonality: int = 12, test_size: int = 125, tags_names: Tuple[str] = (‘Country’, ‘Country/Region’, ‘Country/Gender/Region’, ‘Country/Employment/Gender/Region’))

method __init__

__init__(
    freq: str = 'MS',
    horizon: int = 8,
    papers_horizon: int = 12,
    seasonality: int = 12,
    test_size: int = 125,
    tags_names: Tuple[str] = ('Country', 'Country/Region', 'Country/Gender/Region', 'Country/Employment/Gender/Region')
) → None

class TourismLarge

TourismLarge(freq: str = ‘MS’, horizon: int = 12, papers_horizon: int = 12, seasonality: int = 12, test_size: int = 57, tags_names: Tuple[str] = (‘Country’, ‘Country/State’, ‘Country/State/Zone’, ‘Country/State/Zone/Region’, ‘Country/Purpose’, ‘Country/State/Purpose’, ‘Country/State/Zone/Purpose’, ‘Country/State/Zone/Region/Purpose’))

method __init__

__init__(
    freq: str = 'MS',
    horizon: int = 12,
    papers_horizon: int = 12,
    seasonality: int = 12,
    test_size: int = 57,
    tags_names: Tuple[str] = ('Country', 'Country/State', 'Country/State/Zone', 'Country/State/Zone/Region', 'Country/Purpose', 'Country/State/Purpose', 'Country/State/Zone/Purpose', 'Country/State/Zone/Region/Purpose')
) → None

class TourismSmall

TourismSmall(freq: str = ‘Q’, horizon: int = 4, papers_horizon: int = 4, seasonality: int = 4, test_size: int = 9, tags_names: Tuple[str] = (‘Country’, ‘Country/Purpose’, ‘Country/Purpose/State’, ‘Country/Purpose/State/CityNonCity’))

method __init__

__init__(
    freq: str = 'Q',
    horizon: int = 4,
    papers_horizon: int = 4,
    seasonality: int = 4,
    test_size: int = 9,
    tags_names: Tuple[str] = ('Country', 'Country/Purpose', 'Country/Purpose/State', 'Country/Purpose/State/CityNonCity')
) → None

class Traffic

Traffic(freq: str = ‘D’, horizon: int = 14, papers_horizon: int = 7, seasonality: int = 7, test_size: int = 91, tags_names: Tuple[str] = (‘Level1’, ‘Level2’, ‘Level3’, ‘Level4’))

method __init__

__init__(
    freq: str = 'D',
    horizon: int = 14,
    papers_horizon: int = 7,
    seasonality: int = 7,
    test_size: int = 91,
    tags_names: Tuple[str] = ('Level1', 'Level2', 'Level3', 'Level4')
) → None

class Wiki2

Wiki2(freq: str = ‘D’, horizon: int = 14, papers_horizon: int = 7, seasonality: int = 7, test_size: int = 91, tags_names: Tuple[str] = (‘Views’, ‘Views/Country’, ‘Views/Country/Access’, ‘Views/Country/Access/Agent’, ‘Views/Country/Access/Agent/Topic’))

method __init__

__init__(
    freq: str = 'D',
    horizon: int = 14,
    papers_horizon: int = 7,
    seasonality: int = 7,
    test_size: int = 91,
    tags_names: Tuple[str] = ('Views', 'Views/Country', 'Views/Country/Access', 'Views/Country/Access/Agent', 'Views/Country/Access/Agent/Topic')
) → None

class OldTraffic

OldTraffic(freq: str = ‘D’, horizon: int = 1, papers_horizon: int = 1, seasonality: int = 7, test_size: int = 91, tags_names: Tuple[str] = (‘Level1’, ‘Level2’, ‘Level3’, ‘Level4’))

method __init__

__init__(
    freq: str = 'D',
    horizon: int = 1,
    papers_horizon: int = 1,
    seasonality: int = 7,
    test_size: int = 91,
    tags_names: Tuple[str] = ('Level1', 'Level2', 'Level3', 'Level4')
) → None

class OldTourismLarge

OldTourismLarge(freq: str = ‘MS’, horizon: int = 12, papers_horizon: int = 12, seasonality: int = 12, test_size: int = 57, tags_names: Tuple[str] = (‘Country’, ‘Country/State’, ‘Country/State/Zone’, ‘Country/State/Zone/Region’, ‘Country/Purpose’, ‘Country/State/Purpose’, ‘Country/State/Zone/Purpose’, ‘Country/State/Zone/Region/Purpose’))

method __init__

__init__(
    freq: str = 'MS',
    horizon: int = 12,
    papers_horizon: int = 12,
    seasonality: int = 12,
    test_size: int = 57,
    tags_names: Tuple[str] = ('Country', 'Country/State', 'Country/State/Zone', 'Country/State/Zone/Region', 'Country/Purpose', 'Country/State/Purpose', 'Country/State/Zone/Purpose', 'Country/State/Zone/Region/Purpose')
) → None

class HierarchicalData


method download

download(directory: str) → None
Download Hierarchical Datasets. Args:
  • directory (str): Directory path to download dataset.

method load

load(
    directory: str,
    group: str,
    cache: bool = True
) → Tuple[DataFrame, DataFrame]
Downloads hierarchical forecasting benchmark datasets. Args:
  • directory (str): Directory where data will be downloaded.
  • group (str): Group name.
  • cache (bool): If True saves and loads
Returns: Tuple[pd.DataFrame, pd.DataFrame]: Target time series with columns [‘unique_id’, ‘ds’, ‘y’]. Containes the base time series, Summing matrix of size (hierarchies, bottom).