Introduction
Time series clustering—the process of grouping sequences of data points based on structural similarities—is a critical component in domains ranging from medical diagnostics (ECG analysis) to industrial maintenance. Despite its importance, researchers often face a difficult choice between three suboptimal approaches: raw-based methods that struggle with noise, feature-based methods that discard temporal context, and deep learning models that offer high accuracy but lack interpretability.
Graphint is introduced as an interactive visualization tool designed to bridge this gap. By utilizing the $k$-Graph algorithm, Graphint transforms complex temporal data into navigable, interpretable graphs. This allows users to not only cluster data effectively but also to visualize the specific patterns, or subsequences, that define each group.
Methodology: The $k$-Graph Framework
The engine behind Graphint is the $k$-Graph algorithm, which processes time series data through a structured three-step pipeline:
- Graph Embedding: The system extracts subsequences of varying lengths (denoted as $\ell$) from the dataset. Using Principal Component Analysis (PCA), these subsequences are projected into a 2D space. Dense clusters within this space are identified as nodes (representing common patterns), while the transitions between these patterns are mapped as edges.
- Graph Clustering: Each individual time series is treated as a path through the generated graph. The system records the frequency with which a series traverses specific nodes and edges, creating a feature matrix. This matrix is then partitioned using $k$-Means clustering.
- Consensus Clustering: To capture patterns at different scales, the system generates multiple graphs for various subsequence lengths. It then constructs a Consensus Matrix and applies spectral clustering to identify the most stable and consistent groupings across all resolutions.
Interpretability through "Graphoids"
A standout feature of Graphint is its focus on Explainable AI (XAI). The tool identifies Graphoids—subgraphs that serve as visual signatures for a cluster. A Graphoid is defined by two primary metrics:
- Representativity ($\lambda$): How frequently the pattern appears within the series of a specific cluster.
- Exclusivity ($\gamma$): How unique the pattern is to that cluster compared to others.
By adjusting these thresholds, users can isolate the exact "signature" subsequences that characterize a cluster, transforming a mathematical grouping into a human-understandable pattern.
Interactive Visual Analytics
Graphint is implemented as a Python-based Streamlit application, providing a suite of interactive frames for data exploration:
- Visual Discovery: Users can interactively filter nodes and edges to explore the relationship between different time series patterns.
- Benchmarking Frame: The tool allows for real-time performance comparison. The $k$-Graph algorithm can be benchmarked against 14 baseline methods using metrics such as the Adjusted Rand Index (ARI) across various dataset types (e.g., ECG, Sensor, and Simulated data).
- Interpretability Test: To validate the effectiveness of the visualization, the tool includes a built-in quiz. Users attempt to assign time series to clusters based solely on the graph representation. High user accuracy in these tests serves as empirical evidence that the graph-based mapping is intuitive and meaningful.
Discussion and Future Work
While Graphint offers a powerful new way to interact with time series data, it is not without challenges. The computational cost of generating multiple graphs for multi-resolution analysis can be significant for high-frequency, large-scale datasets. Additionally, while the tool is interactive, selecting the optimal thresholds for Graphoid discovery still requires a degree of domain expertise.
Currently, Graphint focuses on univariate time series. Future development aims to extend this graph-based metaphor to multivariate data, where multiple sensors or data streams must be analyzed simultaneously. By treating time series as a journey through a state-space graph, Graphint provides a robust framework for making complex temporal clustering both accurate and transparent.
Summary updated