Optimal Cluster Determination in K-Means Using Gap Statistic Analysis Across Diverse Datasets

Clustering is a fundamental technique in unsupervised machine learning, where selecting the optimal number of clusters (ONC) remains a critical challenge, particularly for datasets with diverse characteristics. The Gap Statistic is a widely adopted method for determining ONC in K-means clustering, yet its performance is influenced by dataset size, feature complexity, and computational efficiency. This study systematically evaluates the accuracy, execution time, and coefficient of determination (R²) of the Gap Statistic across four distinct datasets sourced from GitHub: Well Log, Time Series, Iris, and Hitters. These datasets vary in size, structure, and domain, providing a comprehensive assessment of the method’s robustness. The Iris dataset exhibited the highest accuracy (87.25%) with an R² of 0.95, demonstrating the Gap Statistic’s superior clustering capability in well-structured datasets. The Time Series dataset followed closely, achieving 68.47% accuracy and R² = 0.88, reflecting moderate reliability. Conversely, the Well Log dataset attained only 57.98% accuracy (R² = 0.66), while the Hitters dataset performed the worst, with 48.41% accuracy and R² = 0.53, indicating poor clustering effectiveness. Notably, datasets with higher ONC values (8 clusters in Well Log and Hitters) exhibited prolonged execution times (2.45 sec and 2.41 sec, respectively), highlighting computational inefficiencies.

Authors

Institutions

Publication Details

Journal
European Journal of Statistics
Published
2025-05-05
DOI
https://doi.org/10.28924/ada/stat.5.8
Citations
1
Primary Topic
Advanced Clustering Algorithms Research
Type
article
Field-Weighted Citation Impact
2.48
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Optimal Cluster Determination in K-Means Using Gap Statistic Analysis Across Diverse Datasets

Mudasar Zafar, Rajalingam Sokkalingam, Hanita Daud, Iliyas Karim Khan et al.
1 citations
European Journal of Statistics
Advanced Clustering Algorithms Research
2.48
article

Optimal Cluster Determination in K-Means Using Gap Statistic Analysis Across Diverse Datasets

Mudasar Zafar, Rajalingam Sokkalingam, Hanita Daud, Iliyas Karim Khan, Soofia Iftikhar, Atta Ullah, Agha Inayat, Nooraini Binti Zainuddin, Abdul Museeb
article en
1 citations

Abstract

Clustering is a fundamental technique in unsupervised machine learning, where selecting the optimal number of clusters (ONC) remains a critical challenge, particularly for datasets with diverse characteristics. The Gap Statistic is a widely adopted method for determining ONC in K-means clustering, yet its performance is influenced by dataset size, feature complexity, and computational efficiency. This study systematically evaluates the accuracy, execution time, and coefficient of determination (R²) of the Gap Statistic across four distinct datasets sourced from GitHub: Well Log, Time Series, Iris, and Hitters. These datasets vary in size, structure, and domain, providing a comprehensive assessment of the method’s robustness. The Iris dataset exhibited the highest accuracy (87.25%) with an R² of 0.95, demonstrating the Gap Statistic’s superior clustering capability in well-structured datasets. The Time Series dataset followed closely, achieving 68.47% accuracy and R² = 0.88, reflecting moderate reliability. Conversely, the Well Log dataset attained only 57.98% accuracy (R² = 0.66), while the Hitters dataset performed the worst, with 48.41% accuracy and R² = 0.53, indicating poor clustering effectiveness. Notably, datasets with higher ONC values (8 clusters in Well Log and Hitters) exhibited prolonged execution times (2.45 sec and 2.41 sec, respectively), highlighting computational inefficiencies.

European Journal of StatisticsVol. 5
Shaheed Benazir Bhutto Women University Peshawar (PK), Asia Pacific University of Technology & Innovation (MY), Universiti Teknologi Petronas (MY), University of Malakand (PK)
Openalex Percentile: Top 11%
Advanced Clustering Algorithms Research
2.48
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.