Abstract
Time series clustering is a critical task for discovering patterns in temporal data, yet existing methods often struggle to balance predictive performance with human-readability. We introduce $k$-Graph, a novel unsupervised algorithm that prioritizes interpretability without sacrificing accuracy. By representing time series as paths through a graph of subsequences, $k$-Graph identifies the specific patterns that define each cluster. Our evaluation on 113 datasets from the UCR-Archive demonstrates that $k$-Graph outperforms state-of-the-art baselines in accuracy and noise robustness while providing actionable explanations.
Introduction
Time series clustering is fundamental to data science, with applications ranging from financial market analysis to medical diagnostics. However, traditional approaches like $k$-Shape often produce uninformative cluster "centroids"—blurry averages that fail to capture the nuances of shifted or stretched data. Conversely, deep learning methods, while accurate, often function as black boxes, making it difficult for practitioners to understand the underlying logic of a cluster assignment. $k$-Graph addresses this gap by explicitly identifying the subsequences that drive clustering decisions.
The $k$-Graph Framework
The $k$-Graph algorithm utilizes a four-step pipeline to transform raw time series into interpretable clusters:
- Graph Embedding: To avoid the pitfalls of pre-defining a single subsequence length, $k$-Graph extracts subsequences using $M$ different random lengths. For each length, it constructs a directed graph where nodes represent common patterns (identified via PCA and density estimation) and edges represent temporal transitions.
- Graph Clustering: Features are extracted for each time series based on its traversal of nodes and edges within the $M$ graphs. Standard $k$-Means clustering is then applied to these graph-based features.
- Consensus Clustering: To reconcile the $M$ different clustering results, $k$-Graph builds a consensus matrix tracking the co-occurrence of time series across all graphs. Spectral clustering is applied to this matrix to produce final, robust labels.
- Interpretability Computation: The algorithm identifies the most relevant graph and extracts Graphoids—specific nodes (subsequences) that characterize a cluster based on their "representativity" (presence in the cluster) and "exclusivity" (absence outside the cluster).
Experimental Evaluation
$k$-Graph was evaluated against 15 state-of-the-art baselines on 113 datasets from the UCR-Archive. The results indicate that $k$-Graph achieves the best average rank across standard metrics such as the Adjusted Rand Index (ARI) and Adjusted Mutual Information (AMI). Notably, its performance advantage increases in high-noise environments, where it outperformed traditional baselines in 68% of cases. Despite its multi-graph approach, $k$-Graph maintains competitive execution times, averaging roughly 150 seconds per dataset.
Interpretability and Qualitative Analysis
A key strength of $k$-Graph is its ability to provide actionable explanations. Unlike centroid-based methods, $k$-Graph highlights the exact temporal patterns that distinguish one cluster from another.
As shown in the figure above, $k$-Graph successfully maps specific spikes and plateaus in the time series (a, b) to distinct paths and nodes in the generated graph (c, d). This allows users to see exactly which "Graphoids" are responsible for the grouping, providing a level of transparency that is often missing in automated clustering tasks.
Conclusion
$k$-Graph represents a significant step forward in making time series analysis both accurate and interpretable. By leveraging ensemble graph embeddings, it bypasses the need for manual parameter tuning and provides robust results even in noisy datasets. Future work will focus on extending the framework to multivariate time series and integrating Graph Neural Networks (GNNs) to further enhance representation learning.
Summary updated