Machine learning models for predicting mortgage payment difficulties in Peru (#105)
Read ArticleDate of Conference
December 1-3, 2025
Published In
"Entrepreneurship with Purpose: Social and Technological Innovation in the Age of AI"
Location of Conference
Cartagena
Authors
Geraldo-Campos, Luis Alberto
Carreño-Flores, Oscar David
Soria-Quijaite, Juan Jesús
Abstract
The objective of this study was to analyze which machine learning models best predict mortgage payment difficulties in Peru. A quantitative method was used with longitudinal data from 2018 to 2022 from the National Household Survey (ENAHO), where a total of 5,716 households with mortgage loans were examined. The input variables considered were geographical area, type of housing, use of credit, and source of financing, with difficulty in meeting the payment schedule as the output variable. The analyses were performed in Google Colab, reporting frequency statistics and exploratory and class balancing analyses to evaluate machine learning models such as Logistic Regression, Random Forest (RF), and Support Vector Machine (SVM) with SMOTE. In the training phase of the classification models, the Scikit-learn, XGBoost, and Keras models were trained and compared. The results showed that, of all the models evaluated, Random Forest without adjustments showed the best performance (F1-score = 0.67; recall = 0.71), although combined Stacking (RF + XGBoost) showed a better balance between classes, but its overall performance was lower. In addition, models such as SVM without adjustments show problems in situations of unbalanced classes, highlighting the need to use techniques such as SMOTE. It is concluded that the Random Forest model is more effective in detecting payment difficulties in mortgage loans.