load_tsf_to_dataframe#
- load_tsf_to_dataframe(full_file_path_and_name, replace_missing_vals_with='NaN', value_column_name='series_value', return_type='pd_multiindex_hier')[source]#
Convert the contents in a .tsf file into a dataframe.
This code was extracted from rakshitha123/TSForecasting /master/utils/data_loader.py.
- Parameters:
- full_file_path_and_name: str
The full path to the .tsf file.
- replace_missing_vals_with: 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
- “tsf_default” = container that faithfully mirrors tsf format from the originalimplementation 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
- 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”