Maternal mortality rate is still high in the most critical aspect affecting the quality of life of mothers and newborns. Very significant urgency considering the importance of proper medical in childbirth procedures. Kendal Islamic Hospital provides more complex data on maternal medical records of childbirth. Many optimization algorithms in classification have been proposed. Many swarm optimizations have been developed, particle swarm optimization is a superior optimization method. Comparison of K-Nearst Neighbors and Random Forest methods is often applied without optimization. This study compares the performance of the K-Nearest Neighbors (KNN) and Random Forest (RF) algorithms in classifying medical procedures for childbirth using medical records of maternity patients at RSI Kendal. The multivariable dataset includes age, weight, height, and more complete childbirth conditions. The preprocessing method involves imputation of empty values ??with KNN imputer, data normalization, and class oversampling using Synthetic Minority Over-sampling Technique (SMOTE). KNN and RF are optimized using Particle Swarm Optimization (PSO) to improve model accuracy. The results show that RF with an accuracy of 99.72% outperforms KNN with an accuracy of 97.03%. In the minority class, RF shows superiority with precision, recall, and F1-score reaching 100%, while KNN is more prone to errors in the minority class. This study confirms RF in handling complex multivariate data and highlights the importance of model optimization to improve accuracy in the classification of medical labor actions. These findings are expected to contribute to the development of machine learning-based decision support systems in the health sector.
                        
                        
                        
                        
                            
                                Copyrights © 2025