# Classification of sequential data

I'm currently trying to classify discrete sequential data into five classes with machine learning.

The setup is the following: The actual object is filled with various properties, but to separate the objects and assign them to a class, it's necessary to look at the pattern of occurrence over a year. Therefore, I convert the objects to an array of 0- and 1's with a fixed length of 366.

Example: If the objects occur on the 1st and 3rd of January, the first elements of the sequence will look like this: [1, 0, 1, ... ]

So the data for each object would be a sequence of the fixed length of 366 and could look like this:

1 2 3 5 6 ... 365 366 Label
0 1 1 0 1 ... 0 1 A
1 1 1 0 0 ... 0 1 A
1 1 1 0 1 ... 0 1 B
0 1 0 0 0 ... 0 1 C
0 0 0 0 1 ... 0 1 A

So the goal would be to enter the sequences into a model to classify its class.

First question: I tried this pattern classification with a CNN and achieved an accuracy of up to 80%. But are there any other approaches to tackle this problem? It seems like a simple problem, so I'd expect a simple solution.

Second question: Let's say I wanted only to identify one of those classes. What should the setup look like? Just input data of that class?

• Are all features sequential with a length of 366 or do you have other features? Jan 30, 2023 at 9:39
• IMHO, your question is poorly written; please spend more time improving it. I am fond of time series analysis, but I have difficulties understanding your issue. Jan 30, 2023 at 17:36
• @Eduard I improved the question a bit, I hope it's clear now. If not, please let me know. Jan 31, 2023 at 14:09

A simple, yet effective, solution to your problem and the one that I have noted is the following.$$^\dagger$$ You can use $$k$$-Nearest Neighbour equipped with a many-to-one alignment similarity measure, such as Dynamic Time Warping (DTW), to classify a new timeseries object exploiting such metric. The classifier is very simple to understand: there is no training time needed, the new instance is classified by looking at your training data for the $$k$$ most similar timeseries, and the class is a majority vote between the $$k$$ classes of the found objects (by the DTW algorithm).
$$^\dagger$$ I assume that you have basic understanding of $$k$$-Nearest Neighbour.