Patient visit data at community health centers are still managed manually, making it difficult for healthcare workers to identify visit patterns and make informed decisions. This study applies the K-Means Clustering algorithm to group patient visit data at Puskesmas Kupang based on insurance type, visit category, clinic or ward, and patient age group. The dataset consists of thousands of patient visit records, with six key features selected through three feature engineering experiments. Preprocessing involved data cleaning and Label Encoding, while the clustering process was configured using PyCaret with normalization, two-component PCA dimensionality reduction to address inter-feature correlation and enable visual cluster representation and outlier removal. The optimal number of clusters was set to four using the Elbow Method. The best-performing model achieved a Silhouette Score of 0.6558, indicating good clustering quality. The four resulting clusters represent patient segments with distinct profiles: adult BPJS users accessing the general clinic, young productive-age patients utilizing Maternal and Child Health services, patients with unplanned service needs, and elderly patients with routine visit patterns. The findings confirm that K-Means is effective as a patient classification tool at community health centers, supporting data-driven decision-making for healthcare personnel.
Copyrights © 2026