Penerapan Algoritma K-Nearest Neighbors (KNN) dalam Menentukan Jenis KB Menggunakan Google Colab - Hadi, Abdul; Ryansyah, Decky; Brotosaputro, Goenawan Radzi (LPPM, 2025)
This study aims to apply the K-Nearest Neighbors (KNN) algorithm to determine the appropriate contraceptive method (KB) based on demographic data and user characteristics. The main problem faced is the lack of an effective decision support system to assist potential KB users in selecting the most suitable contraceptive method according to individual conditions. Additionally, the selection of contraceptive methods is often done manually by healthcare professionals without the support of predictive technology that could enhance recommendation accuracy. This research was conducted using Google Collab as a data processing platform, utilizing Python libraries such as Pandas, NumPy, and Scikit-learn. The dataset used includes information about KB users, including age, number of children, health history, and personal preferences. The data was pre processed to handle missing values and normalized to suit the analysis. The KNN model was tested with variations of the k value to find the optimal parameter that yields the highest accuracy. The results showed that the KNN algorithm was able to recommend contraceptive methods with an accuracy of 76% at k = 5. The main finding of this study is that the KNN model can be used as a decision support tool to determine the most appropriate contraceptive method for individuals. This research is expected to support efforts to improve reproductive health services through the utilization of machine learning technology.