Pembuatan Model Machine Learning untuk Klasifikasi Risiko Pinjaman Perbankan Menggunakan Random Forest dan XGboost - Zacki Ferdinansyah; Rahmat Budiarsa (Institut Teknologi dan Bisnis (ITB) Semarang, 2026)
Credit risk is one of the major challenges in managing loan portfolios in the banking sector, highlighting the need for approaches capable of identifying loan risk patterns and factors associated with problematic loans based on historical data. This study aims to develop and compare the performance of Random Forest and Extreme Gradient Boosting (XGBoost) algorithms in classifying loan risk patterns and to identify the features that contribute to the classification results. The study uses a historical loan dataset processed through exploratory data analysis, categorical data transformation, an 80:20 training and testing data split, and class imbalance handling using Random Under Sampling and SMOTE. Model optimization was performed through hyperparameter tuning using GridSearchCV, while model performance was evaluated based on accuracy, precision, recall, and F1-score. Model interpretation was conducted using Feature Importance, SHAP (SHapley Additive Explanations), and decision tree visualization. The results show that XGBoost with preprocessing and the second hyperparameter tuning achieved the best performance, with an accuracy of 98%, precision of 97%, recall of 85%, and F1-score of 90%, outperforming Random Forest on the dataset used. Interpretability analysis indicates that recoveries, total_rec_prncp, out_prncp, last_pymnt_amnt, and funded_amnt are among the features that contribute substantially to the classification results. These findings indicate that preprocessing, class imbalance handling, and parameter optimization can improve classification performance while providing insights into the factors contributing to loan risk patterns based on historical data.