Time series classification is the machine learning task of assigning a discrete class label to a whole sequence of time-ordered observations. In artificial intelligence, it sits beside forecasting in the time series family: instead of predicting the next value, a classifier decides what kind of sequence it is, for example a normal or abnormal heartbeat, a walking or running motion, or a healthy or failing bearing.
The defining difficulty is that order and shape carry the information. Two sequences can share the same mean and variance yet belong to different classes because a peak appears earlier, a pattern repeats faster, or a local motif occurs only once. Good methods therefore capture temporal structure, not just summary statistics.
How time series classification works
Time series classification works by mapping each input sequence, often of length tens to tens of thousands of points, to a representation in which classes become separable, and then applying a decision rule. The input may be univariate, with one channel such as temperature, or multivariate, with several synchronized channels such as the three axes of an accelerometer.
A typical pipeline has four stages: preprocessing (resampling, z-normalization, handling missing values), representation (raw values, distances, extracted features or learned embeddings), classification (a nearest-neighbor rule, a linear model, a tree ensemble or a neural network) and evaluation on held-out sequences. The table below lists the main configuration choices and what they affect.
| Choice | Typical options | What it affects |
|---|---|---|
| Normalization | Per-series z-score, none | Sensitivity to offset and scale |
| Sequence length | Fixed, padded, variable | Model compatibility and cost |
| Channel handling | Independent, joint | Ability to use cross-channel patterns |
| Window or segment size | Whole series, sliding windows | Granularity of the label |
| Evaluation split | By recording, by subject | Realism of the accuracy estimate |
Main families of classification methods
Methods for time series classification fall into several families that differ in how they extract discriminative structure. Benchmark studies on the UCR and UEA archives, which contain more than one hundred univariate and about thirty multivariate datasets, have shaped the field and the standard comparisons.
| Family | Core idea | Representative methods |
|---|---|---|
| Distance-based | Compare whole series with an elastic distance | 1-NN with dynamic time warping |
| Interval-based | Summarize random time intervals | Time Series Forest, DrCIF |
| Shapelet-based | Find short subsequences that mark a class | Shapelet Transform |
| Dictionary-based | Count symbolic words in sliding windows | BOSS, WEASEL |
| Convolutional kernels | Apply many random kernels, then a linear model | ROCKET, MiniRocket |
| Deep learning | Learn features end to end | InceptionTime, ResNet, transformers |
| Ensembles | Combine several families | HIVE-COTE 2 |
The long-standing baseline is one-nearest-neighbor with dynamic time warping, which aligns sequences that are similar in shape but shifted or stretched in time. Its main drawback is quadratic cost per comparison, which becomes prohibitive for long series and large training sets.
Since about 2020, ROCKET and its successors have changed practice. They transform each series with thousands of random convolutional kernels and train a ridge classifier, reaching accuracy close to the best ensembles at a small fraction of the training time.
How it differs from forecasting and anomaly detection
Time series classification differs from neighboring tasks mainly in what the output describes. Forecasting predicts future values, anomaly detection flags unusual points or periods, and classification labels a complete sequence. The same sensor data can feed all three, but labels, loss functions and evaluation metrics differ.
| Task | Output | Typical metric |
|---|---|---|
| Time series classification | One label per sequence | Accuracy, F1, AUC |
| Time series forecasting | Future values | MASE, sMAPE |
| Anomaly detection | Score per point or window | Precision at recall |
| Segmentation | Change points or labeled spans | Boundary error |
| Time series regression | One numeric value per sequence | RMSE, MAE |
A frequent source of confusion is windowed classification of streams. When a long recording is cut into windows and each window receives a label, the problem is still classification, but overlapping windows from the same recording must stay in the same data split to avoid leakage.
Choosing a method in practice
Choosing a method depends mostly on dataset size, series length and the need for interpretability. Practitioners usually start with a fast, strong baseline and move to heavier models only when the gain justifies the cost. Libraries such as sktime, aeon and tsai provide these methods behind a common interface.
| Situation | Recommended approach | Reason |
|---|---|---|
| Few hundred short series | 1-NN DTW or MiniRocket | Strong accuracy with little data |
| Thousands of long series | MiniRocket or MultiRocket | Linear time and fast training |
| Need for explanations | Shapelets or interval features | Patterns map to visible segments |
| Very large labeled corpus | InceptionTime or transformer | Deep models scale with data |
| Maximum benchmark accuracy | HIVE-COTE 2 | Ensembles are hard to beat |
Limitations and common mistakes
The most damaging mistake is data leakage through the split. Windows from one patient, machine or session placed in both training and test sets inflate accuracy, sometimes by twenty points or more, because the model learns the individual rather than the class.
- Class imbalance: rare failure classes need stratified splits and balanced metrics, not plain accuracy.
- Normalization artifacts: per-series z-scoring removes absolute level, which is harmful when amplitude itself is informative.
- Unequal lengths: padding with zeros can create false patterns; resampling or length-aware models are safer.
- Benchmark overfitting: results on archive datasets do not always transfer to noisy industrial signals.
Finally, accuracy alone hides early classification needs. In monitoring, a correct label after the full sequence may arrive too late, so some systems use early classification methods that trade a little accuracy for a much faster decision.
In everyday language
Many devices record numbers over time. A smartwatch records your pulse. A factory sensor records vibration. Time series classification sorts each recording into a category.
Imagine listening to short clips of birdsong and naming the bird. You do not predict the next note. You recognize the whole tune by its rhythm and shape. A classifier does the same with numbers, learning from many labeled examples which shapes belong to which group.
Seen in the real world
A hospital cardiology team wants to screen single-lead electrocardiogram recordings from wearable patches for atrial fibrillation. Each recording lasts 30 seconds at 250 samples per second, giving 7,500 points per series, and cardiologists have labeled 20,000 recordings as normal rhythm, atrial fibrillation, other rhythm or too noisy.
The data scientists split the data by patient, not by recording, so no person appears in both training and test sets. A MiniRocket baseline trains in minutes and reaches a macro F1 score near 0.80, and a deeper InceptionTime model adds a few points after hours of GPU training.
The team deploys the faster model as a first-pass triage filter. Recordings it flags as atrial fibrillation go to a cardiologist for confirmation, which reduces the manual review workload while keeping a clinician responsible for every diagnosis.