NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

A Scalable Feature Based Clustering Algorithm for Sequences with Many Distinct Items

Sangheum Hwang, Dohyun Kim

Abstract

Clustering sequence data is a fundamental task in market segmentation and bioinformatics. Traditional alignment-based methods, while accurate, face significant scalability challenges due to their quadratic computational complexity. Feature-based methods offer a faster alternative by representing sequences in a vector space; however, they often suffer from "similarity distortion" when only a subset of frequent patterns is used. This paper proposes a scalable clustering algorithm that utilizes the complete set of frequent sequential patterns as features. By leveraging the PrefixSpan algorithm for exhaustive pattern mining and transforming sequences into high-dimensional binary vectors, the method maintains linear scalability while achieving higher clustering quality than traditional and existing feature-based techniques.

1. Introduction

The analysis of sequence data—ordered lists of items—is crucial for understanding customer behavior in e-commerce and biological functions in genomics. A primary challenge in this domain is clustering large-scale sequence datasets efficiently. Alignment-based methods, which rely on pairwise comparisons, scale at $O(n^2)$, making them unsuitable for modern "Big Data" applications. Feature-based clustering addresses this by mapping sequences to a feature space. However, to manage dimensionality, these methods typically prune the set of frequent patterns, leading to similarity distortion where the vector-space distance fails to reflect the true sequence relationship.

2. Methodology

The proposed algorithm introduces a three-stage pipeline designed for efficiency and information retention.

2.1 Complete Pattern Mining

Unlike previous methods that select a "representative" subset of patterns, this approach mines the complete set of frequent sequential patterns using the PrefixSpan algorithm. This exhaustive mining ensures that no relevant relational information is lost.

2.2 Binary Vector Representation

Each sequence is converted into a binary vector where each dimension corresponds to a frequent pattern. A value of '1' indicates the presence of the pattern in the sequence, while '0' indicates its absence. This creates a sparse, high-dimensional representation that captures the structural characteristics of the data.

Figure 1: Transformation of sequence data into a binary feature matrix based on frequent patterns.

2.3 K-means Clustering

Clustering is performed using the K-means algorithm with cosine distance. The use of the complete pattern set eliminates the need for a computationally expensive "investigation process" typically required for pattern selection, resulting in a total complexity of $O(lKI)$, where $l$ is the number of sequences.

3. Experimental Evaluation

The algorithm was tested on two datasets:

  • Retail Market Dataset: Real-world e-commerce data containing 57,686 transactions from 5,001 customers across 305 items.
  • Synthetic Dataset (T10I4D100K): A standard benchmark consisting of 100,000 records with 1,000 distinct items.

The primary metric for evaluation was Weighted Average Similarity (WAS), which measures the internal cohesion of the generated clusters.

4. Results and Discussion

The proposed method consistently outperformed K-medoids, Hierarchical clustering (complete and average linkage), and Density Peak clustering across both datasets.

Figure 2: Weighted Average Similarity (WAS) results for the retail market dataset across different cluster counts (K).

The results indicate that using the complete set of patterns effectively mitigates similarity distortion. The performance advantage was most pronounced in the retail dataset, which contains a high number of distinct items, demonstrating the algorithm's robustness in complex real-world scenarios. Furthermore, the linear scalability of the approach ensures its applicability to very large datasets where traditional methods would fail.

5. Conclusion

By utilizing the complete set of frequent sequential patterns as features, the proposed algorithm solves the trade-off between scalability and clustering quality. It avoids the similarity distortion inherent in pruned feature-based methods while maintaining the linear complexity required for large-scale sequence analysis. Future work will focus on optimizing the minimum support threshold selection and integrating the mining and clustering phases into a single end-to-end process.

Summary updated

BibTeX
@article{hwang2018scalable,
  author = {Sangheum Hwang and Dohyun Kim},
  title = {{A Scalable Feature Based Clustering Algorithm for Sequences with Many Distinct Items}},
  journal = {Int. J. Fuzzy Log. Intell. Syst.},
  year = {2018},
  doi = {10.5391/ijfis.2018.18.4.316},
}
Figure