load_classification#
- load_classification(name, split=None, extract_path=None, return_metadata=True)[source]#
Load a classification dataset.
Loads a TSC dataset from extract_path, or from timeseriesclassification.com, if not on extract path.
Data is assumed to be in the standard .ts format: each row is a (possibly multivariate) time series. Each dimension is separated by a colon, each value in a series is comma separated. For examples see aeon.datasets.data.tsc. ArrowHead is an example of a univariate equal length problem, BasicMotions an equal length multivariate problem.
Data is stored in extract_path/name/name.ts, extract_path/name/name_TRAIN.ts and extract_path/name/name_TEST.ts.
- Parameters:
- namestr
Name of data set. If a dataset that is listed in tsc_data_lists is given, this function will look in the extract_path first, and if it is not present, attempt to download the data from www.timeseriesclassification.com, 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/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)
- Returns:
- X: np.ndarray or list of np.ndarray
- y: numpy array
The class labels for each case in X
- metadata: optional
returns the following meta data ‘problemname’,timestamps, missing,univariate,equallength, class_values targetlabel should be false, and classlabel true
Examples
>>> from aeon.datasets import load_classification >>> X, y, meta = load_classification(name="ArrowHead") #DOCTEST +Skip