load_regression

load_regression(name: str, split=None, extract_path=None, return_metadata: bool = False, load_equal_length: bool = True, load_no_missing: bool = True)[source]

Download/load a TSML regression collection.

If the data is stored locally on “extract_path” it is loaded from there. If not, it is downloaded from the Zenodo TSML community (https://zenodo.org/communities/tsml) then loaded into memory. It does this by calling _load_collection (see that functions documentation for more detail) then further checks whether a classification problem has been loaded by mistake. If this happens, it raises an error.

Parameters:
namestring

Name of the problem to load or download.

extract_pathNone or str, default = None

Path of the location for the data file. If None, data is written to os.path.dirname(__file__)/local_data/<name>/.

splitNone or str{“train”, “test”}, default=None

Whether to load the train or test partition of the problem. By default it loads both into a single dataset, otherwise it looks only for files of the format <name>_TRAIN.ts or <name>_TEST.ts.

return_metadataboolean, default = False

If True, returns a tuple (X, y, metadata)

load_equal_lengthboolean, default=True

This is for the case when the standard release has unequal length series. The downloaded zip for these contain a version made equal length through truncation. These versions all have the suffix _eq after the name. If this flag is set to True, the function first attempts to load files called <name>_eq_TRAIN.ts/TEST.ts. If these are not present, it will load the normal version.

load_no_missingboolean, default=True

This is for the case when the standard release has missing values. The downloaded zip for these contain a version with imputed missing values. These versions all have the suffix _nmv after the name. If this flag is set to True, the function first attempts to load files called <name>_nmv_TRAIN.ts/TEST.ts. If these are not present, it will load the normal version.

Returns:
Xnp.ndarray or list of np.ndarray
ynp.ndarray

The target response variable for each case in X

metadata: dict, optional

returns the following metadata ‘problemname’,timestamps, missing,univariate,equallength. targetlabel should be true, and classlabel false

Raises:
URLError or HTTPError

If the website is not accessible.

ValueError

If a dataset name that does not exist on the repo is given, if a webpage is requested that does not exist or if a classification problem were loaded in error.

Examples

>>> from aeon.datasets import load_regression
>>> X, y=load_regression("FloodModeling1")

Deprecated since version 1.4.0: load_regression parameters load_equal_length and load_no_missing will default to False in version 1.5.0