load_basic_motions#

load_basic_motions(split=None, return_X_y=True, return_type=None)[source]#

Load the BasicMotions time series classification problem and returns X and y.

This is an equal length multivariate time series classification problem. It loads a 4 class classification problem with number of cases, n, where n = 80 (if split is None) or 40 (if split is “train”/”test”) of series length m = 100.

Parameters:
split: None or one of “TRAIN”, “TEST”, optional (default=None)

Whether to load the train or test instances of the problem. By default it loads both train and test instances (in a single container).

return_X_y: bool, optional (default=True)

If True, returns (features, target) separately instead of a single dataframe with columns for features and the target.

return_type: valid Panel mtype str or None, optional (default=None=”nested_univ”)

Memory data format specification to return X in, None = “nested_univ” type. str can be any supported sktime Panel mtype,

for list of mtypes, see datatypes.MTYPE_REGISTER for specifications, see examples/AA_datatypes_and_datasets.ipynb

commonly used specifications:

“nested_univ: nested pd.DataFrame, pd.Series in cells “numpy3D”/”numpy3d”/”np3D”: 3D np.ndarray (instance, variable, time index) “numpy2d”/”np2d”/”numpyflat”: 2D np.ndarray (instance, time index) “pd-multiindex”: pd.DataFrame with 2-level (instance, time) MultiIndex

Exception is raised if the data cannot be stored in the requested type.

Returns:
X: sktime data container, following mtype specification return_type

The time series data for the problem, with n instances

y: 1D numpy array of length n, only returned if return_X_y if True

The class labels for each time series instance in X If return_X_y is False, y is appended to X instead.

Raises:
ValueError if argument “numpy2d”/”numpyflat” is passed as return_type
Notes
Dimensionality: multivariate, 6
Series length: 100
Train cases: 40
Test cases: 40
Number of classes: 4
The data was generated as part of a student project where four students performed
four activities whilst wearing a smart watch. The watch collects 3D accelerometer
and a 3D gyroscope It consists of four classes, which are walking, resting,
running and badminton. Participants were required to record motion a total of
five times, and the data is sampled once every tenth of a second, for a ten second
period.
Dataset details: http://www.timeseriesclassification.com/description.php?Dataset
=BasicMotions