用Cython和Numba加速聚类倾向可视化,快50倍且结果不变
Fast-VAT: Accelerating Cluster Tendency Visualization using Cython and Numba
- 用Cython静态类型+Numba JIT编译优化,解决原算法O(n²)瓶颈
- 在Iris、Mall Customers等数据集上提速最高达50倍,输出一致
- 适合需要快速评估聚类结构的研究者和工程师
聚类倾向可视化(VAT)是一种广泛使用的无监督方法,用于评估未标记数据集中是否存在聚类结构。然而,其标准实现因时间复杂度为O(n²)且内存效率低下,存在显著性能瓶颈。本文提出Fast-VAT,是基于Python的VAT算法高性能重实现,结合Numba的即时编译(JIT)与Cython的静态类型及底层内存优化。该方法相比基线实现最快提升50倍,同时保持原始结果的一致性。我们在一组真实与合成数据集(包括Iris、Mall Customers、Spotify子集)上验证Fast-VAT,并通过霍普金斯统计量、PCA和t-SNE确认聚类倾向。此外,将VAT的结构洞察与DBSCAN和K-Means的聚类结果对比,证实其可靠性。
原文摘要 · Abstract (English)
Visual Assessment of Cluster Tendency (VAT) is a widely used unsupervised technique to assess the presence of cluster structure in unlabeled datasets. However, its standard implementation suffers from significant performance limitations due to its O(n^2) time complexity and inefficient memory usage. In this work, we present Fast-VAT, a high-performance reimplementation of the VAT algorithm in Python, augmented with Numba's Just-In-Time (JIT) compilation and Cython's static typing and low-level memory optimizations. Our approach achieves up to 50x speedup over the baseline implementation, while preserving the output fidelity of the original method. We validate Fast-VAT on a suite of real and synthetic datasets -- including Iris, Mall Customers, and Spotify subsets -- and verify cluster tendency using Hopkins statistics, PCA, and t-SNE. Additionally, we compare VAT's structural insights with clustering results from DBSCAN and K-Means to confirm its reliability.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。