Skip to content

traffic_bay

Bases: time_series_dataloader

A data loader for San Francisco Bay Area traffic time series datasets.

This class handles loading, partitioning, and preparing San Francisco Bay Area traffic time series data for training and testing.

Attributes:

Name Type Description
name str

Name of the dataset, default is 'traffic_bay'.

x_len int

Length of the input time series.

y_len int

Length of the output time series.

xy_gap int

Gap between the input and output time series.

coverage_year_range int

Range of years covered by the data.

time_granularity str

Time granularity of the data, e.g., 'minutely', 'hourly', etc.

target_attributes str

Target attribute to predict, default is 'All'.

Methods:

Name Description
__init__

Initializes the traffic data loader for the Bay Area with dataset-specific configurations.

Source code in tinybig/data/time_series_dataloader.py
class traffic_bay(time_series_dataloader):
    """
    A data loader for San Francisco Bay Area traffic time series datasets.

    This class handles loading, partitioning, and preparing San Francisco Bay Area traffic time series data for training and testing.

    Attributes
    ----------
    name : str
        Name of the dataset, default is 'traffic_bay'.
    x_len : int
        Length of the input time series.
    y_len : int
        Length of the output time series.
    xy_gap : int
        Gap between the input and output time series.
    coverage_year_range : int
        Range of years covered by the data.
    time_granularity : str
        Time granularity of the data, e.g., 'minutely', 'hourly', etc.
    target_attributes : str
        Target attribute to predict, default is 'All'.

    Methods
    -------
    __init__(...)
        Initializes the traffic data loader for the Bay Area with dataset-specific configurations.
    """
    def __init__(
        self,
        name: str = TRAFFIC_BAY_DATA_PROFILE['name'],
        x_len: int = 10,
        y_len: int = 1,
        xy_gap: int = 1,
        coverage_year_range: int = 1,
        time_granularity: str = 'minutely',
        target_attributes: str = 'All',
        *args, **kwargs
    ):
        """
        Initializes the Bay Area traffic data loader with specific configurations.

        Parameters
        ----------
        name : str, optional
            Name of the dataset, default is 'traffic_bay'.
        x_len : int, optional
            Length of the input time series, default is 10.
        y_len : int, optional
            Length of the output time series, default is 1.
        xy_gap : int, optional
            Gap between the input and output time series, default is 1.
        coverage_year_range : int, optional
            Range of years covered by the data, default is 1.
        time_granularity : str, optional
            Time granularity of the data, default is 'minutely'.
        target_attributes : str, optional
            Target attribute to predict, default is 'All'.
        *args, **kwargs
            Additional arguments for the parent class initialization.

        Returns
        -------
        None
        """
        super().__init__(
            name=name,
            data_profile=TRAFFIC_BAY_DATA_PROFILE,
            x_len=x_len, y_len=y_len, xy_gap=xy_gap,
            coverage_year_range=coverage_year_range,
            time_granularity=time_granularity,
            target_attributes=target_attributes,
            *args, **kwargs
        )

__init__(name=TRAFFIC_BAY_DATA_PROFILE['name'], x_len=10, y_len=1, xy_gap=1, coverage_year_range=1, time_granularity='minutely', target_attributes='All', *args, **kwargs)

Initializes the Bay Area traffic data loader with specific configurations.

Parameters:

Name Type Description Default
name str

Name of the dataset, default is 'traffic_bay'.

TRAFFIC_BAY_DATA_PROFILE['name']
x_len int

Length of the input time series, default is 10.

10
y_len int

Length of the output time series, default is 1.

1
xy_gap int

Gap between the input and output time series, default is 1.

1
coverage_year_range int

Range of years covered by the data, default is 1.

1
time_granularity str

Time granularity of the data, default is 'minutely'.

'minutely'
target_attributes str

Target attribute to predict, default is 'All'.

'All'
*args

Additional arguments for the parent class initialization.

()
**kwargs

Additional arguments for the parent class initialization.

()

Returns:

Type Description
None
Source code in tinybig/data/time_series_dataloader.py
def __init__(
    self,
    name: str = TRAFFIC_BAY_DATA_PROFILE['name'],
    x_len: int = 10,
    y_len: int = 1,
    xy_gap: int = 1,
    coverage_year_range: int = 1,
    time_granularity: str = 'minutely',
    target_attributes: str = 'All',
    *args, **kwargs
):
    """
    Initializes the Bay Area traffic data loader with specific configurations.

    Parameters
    ----------
    name : str, optional
        Name of the dataset, default is 'traffic_bay'.
    x_len : int, optional
        Length of the input time series, default is 10.
    y_len : int, optional
        Length of the output time series, default is 1.
    xy_gap : int, optional
        Gap between the input and output time series, default is 1.
    coverage_year_range : int, optional
        Range of years covered by the data, default is 1.
    time_granularity : str, optional
        Time granularity of the data, default is 'minutely'.
    target_attributes : str, optional
        Target attribute to predict, default is 'All'.
    *args, **kwargs
        Additional arguments for the parent class initialization.

    Returns
    -------
    None
    """
    super().__init__(
        name=name,
        data_profile=TRAFFIC_BAY_DATA_PROFILE,
        x_len=x_len, y_len=y_len, xy_gap=xy_gap,
        coverage_year_range=coverage_year_range,
        time_granularity=time_granularity,
        target_attributes=target_attributes,
        *args, **kwargs
    )