load_classification

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

Download/load a TSML classification 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 regression problem has been loaded by mistake. If this happens, it raises an error.

Parameters:
namestr

Name of data set. If a dataset that is listed in tsc_datasets is given, this function will look in the extract_path first, and if it is not present, attempt to download the data from zenodo, saving it to the extract_path.

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.

extract_pathstr, default=None

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

return_metadataboolean, default = True

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:
X: np.ndarray or list of np.ndarray
y: np.ndarray

The class labels for each case in X

metadata: dict, optional

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

Raises:
URLError or HTTPError

If the website is not accessible.

ValueError

If a dataset name that does not exist on the repo is given or if a webpage is requested that does not exist.

Examples

>>> from aeon.datasets import load_classification
>>> X, y = load_classification(name="ArrowHead")

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