I want to use the sktime package for time series classification on a multivariet time series. My time series looks like this:
It is a continious time series dissected into non-overlapping intervals (interval_label) on different sensor node positions (Sensor_ID) each containing different measurements (CO2 etc.).
I've converted my time series to the format expected by sktime and shown in the docs of sktime (https://github.com/sktime/sktime/blob/main/examples/AA_datatypes_and_datasets.ipynb), see "Hierarchical time series - the "pd_multiindex_hier" mtype".
However, I´m still getting the following error when applying the data to a model like this:
# Build model
clf = RocketClassifier(num_kernels=500)
clf.fit(X_train, y_train)
Out:
TypeError: X is not of a supported input data type.X must be in a supported mtype format for Panel, found <class 'pandas.core.frame.DataFrame'>Use datatypes.check_is_mtype to check conformance with specifications.
I wasn´t sure if i did something wrong in my data structure and tried the example dataset from the sktime website:
# define dataset
test_df = get_examples(mtype="pd_multiindex_hier", as_scitype="Hierarchical")[0]
# Derive X_train, y_train
X_train = test_df[['var_1']].copy()
y_train = np.array(test_df.var_0)
When I check for the correct mtype, I get the expected output:
from sktime.datatypes import check_is_mtype
check_is_mtype(X_train, mtype="pd_multiindex_hier", return_metadata=True)
Out:
(True,
None,
{'is_univariate': True,
'is_empty': False,
'has_nans': False,
'n_instances': 6,
'is_one_series': False,
'is_equal_length': True,
'is_equally_spaced': True,
'n_panels': 2,
'is_one_panel': False,
'mtype': 'pd_multiindex_hier',
'scitype': 'Hierarchical'})
But even with the example data from sktime, I still get the mentioned error when fitting the model. Does anyone have an idea what could be the problem here?