load_forecastingdata#

load_forecastingdata(name, replace_missing_vals='NAN', value_column_name='series_value', return_type='default_tsf', extract_path=None)[source]#

Fetch forecasting datasets from Monash Time Series Forecasting Archive.

Downloads and extracts dataset if not already downloaded. Fetched dataset is in the standard .tsf format. See https://forecastingdata.org/ for more details.

Parameters:
name: str

Name of data set. If a dataset that is listed in tsf_all_dataset is given, this function will look in the extract_path first, and if it is not present, attempt to download the data from https://forecastingdata.org/, saving it to the extract_path.

replace_missing_vals: str, default=”NAN”

A term to indicate the missing values in series in the returning dataframe.

value_column_name: str, default=”series_value”

Any name that is preferred to have as the name of the column containing series values in the returning dataframe.

return_typestr - “pd_multiindex_hier”, “default_tsf” (default), or valid sktime

mtype string for in-memory data container format specification of the return type: - “pd_multiindex_hier” = pd.DataFrame of sktime type pd_multiindex_hier - “default_tsf” = container that faithfully mirrors tsf format from the original

implementation in: rakshitha123/TSForecasting blob/master/utils/data_loader.py.

  • other valid mtype strings are Panel or Hierarchical mtypes in

    datatypes.MTYPE_REGISTER. If Panel or Hierarchical mtype str is given, a conversion to that mtype will be attempted

For tutorials and detailed specifications, see examples/AA_datatypes_and_datasets.ipynb

extract_pathstr, optional (default=None)

the path to look for the data. If no path is provided, the function looks in sktime/datasets/data/. If a path is given, it can be absolute, e.g. C:/Temp or relative, e.g. Temp or ./Temp.

Returns:
loaded_data: pd.DataFrame

The converted dataframe containing the time series.

metadata: dict

The metadata for the forecasting problem. The dictionary keys are: “frequency”, “forecast_horizon”, “contain_missing_values”, “contain_equal_length”