angus924 / minirocket

MINIROCKET: A Very Fast (Almost) Deterministic Transform for Time Series Classification

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Datatype Error

Haoxiang-Sun-BioEng opened this issue · comments

When I tried to run MiniRocket on my data in Python, I got the following datatype error: "TypeError: X must be in an sktime compatible format, of scitype Series, Panel or Hierarchical, for instance a pandas.DataFrame with sktime compatible time indices, or with MultiIndex and last(-1) level an sktime compatible time index. Allowed compatible mtype format specifications are: ['pd.Series', 'pd.DataFrame', 'np.ndarray', 'nested_univ', 'numpy3D', 'pd-multiindex', 'df-list', 'pd_multiindex_hier'] See the data format tutorial examples/AA_datatypes_and_datasets.ipynb, If you think the data is already in an sktime supported input format, run sktime.datatypes.check_raise(data, mtype) to diagnose the error, where mtype is the string of the type specification you want."

I checked my datatype and it is in the form "pandas.core.frame.DataFrame". What is the difference between this datatype and pd.DataFrame (I searched online and cannot find anything denoting the difference between those 2 datatypes), and how can I convert my data into a sktime compatible format or make MiniRocket work for my datatype?

Hi @Haoxiang-Sun-BioEng, sktime uses it's own data format, which is out of my control, and unfortunately the relevant documentation is hard to follow to the point of being almost unintelligible. What I would suggest is loading one of their inbuilt datasets using, e.g., load_italy_power_demand(), and have a look at how the data is formatted.

Having said that, as far as I can tell, sktime will accept data in the format of a 3d numpy array, with dimensions [examples, channels, timepoints]. For example, if you had a univariate (i.e., 1 channel) dataset with 10 examples, each of length 100, you can format your data as a numpy array with shape [10, 1, 100] and it should work.

Alternatively, if you're having trouble, you can download the code in this archive and use it directly.