Comparison of Random Forest and K-Nearest Neighbor Algorithms for Prediction of Customer Credit Risk Based on Transaction History and Income - Kecitaan Harefa (Inspiration: Jurnal Teknologi Informasi dan Komunikasi, 2025)
The increase in the number of credit applications requires financial institutions to have an accurate risk assessment system in order to minimize the potential for bad loans. The main problem that often arises is the difficulty in objectively assessing the level of customer risk based on varied transaction history and income data. To overcome this, this study compared two classification algorithms in machine learning, namely Random Forest and K-Nearest Neighbor (KNN), to predict customer credit risk. The goal is to determine the algorithm that provides the best level of prediction accuracy and stability. The research method includes data collection from the credit risk dataset, the pre-processing stage (data cleaning, encoding, and normalization), the separation of the data into training and testing sets, then model training using both algorithms. Evaluations were conducted based on accuracy, precision, recall, F1-score, and ROC-AUC metrics. The test results showed that the Random Forest algorithm provided superior performance to KNN, with an accuracy rate of around 90%, while KNN only reached around 84%. This shows that Random Forest is more effective at handling data with complex and non-linear variables. In conclusion, the use of the Random Forest method can be the optimal solution for financial institutions in identifying customers' credit risks more accurately and efficiently.