binder

Multi-variate time series classification using InceptionTime#

In this notebook, we use InceptionTime to perform for multi-variate time series classification by deep learning.

[ ]:
""" Imports """
import numpy as np
import seaborn as sns
from sklearn.model_selection import GridSearchCV

from sktime.classification.deep_learning.inceptiontime import InceptionTimeClassifier
from sktime.datasets import load_basic_motions

sns.set_style("whitegrid")

Load a dataset#

The Basic Motions dataset, from timeseriesclassification.com, has time series in six dimensions.

[ ]:
X_train, y_train = load_basic_motions(split="train", return_X_y=True)
X_test, y_test = load_basic_motions(split="test", return_X_y=True)
print(X_train.shape)
print(X_test.shape)
X_train.head()
[ ]:
# The class labels
np.unique(y_train)

Train a deep neural network classifier#

Here we choose to use the InceptionTime classifier. Other classifiers provided by sktime-dl include MLP, ResNet, MCDCNN (Multi Channel Deep Convolutional Neural Network)

[ ]:
network = InceptionTimeClassifier(n_epochs=75, verbose=False)
network.fit(X_train, y_train)
network.score(X_test, y_test)

Generated using nbsphinx. The Jupyter notebook can be found here.