Implementation of a machine learning model to predict bank customer profiles

Implementation of a machine learning model to predict bank customer profiles

Implementación de un modelo de aprendizaje automático para predecir perfiles de clientes bancarios ES

Angélica Urrutia 1
Carolina Nicolas 2
1 Universidad Finis Terrae. Facultad de Ingeniería. Santiago, Chile
2 Universidad de Santiago de Chile. Facultad de Administración y Economía. Santiago, Chile
Received: 17/04/2025 | Accepted: 14/09/2026 | Published: 14/09/2026
Abstract EN

This research presents a recurring problem in banking entities, where it is sought to determine whether a customer will experience payment problems or default; as a result, this study proposes developing a Machine Learning (ML) predictive model to classify these customers. An exploratory analysis was carried out to refine the data; then decision trees were used, followed by boosting algorithms (XGBoost). Training was carried out with a hyperparameter grid to find the optimal parameter combination and select the best classification model based on the chosen metrics. This development process follows the stages of the KDD (Knowledge Discovery in Databases) process. The ML predictive model was implemented in a web application, achieving an approximate 95% success on the set test. The developed application can correctly classify bank customers based on the implemented model and displays information on the bank profile samples. The research provides a practical methodology to identifying different customer profiles in the banking sector and the likelihood of payment problems or defaulting.

Keywords
Machine learning decision trees extreme gradient boost bank customers.
Resumen ES

Esta investigación presenta un problema recurrente en las entidades bancarias, donde se busca determinar si un cliente presenta problemas de pago o morosidad. Como resultado de esta situación, se propone el desarrollo de un modelo predictivo de Aprendizaje Automático/Machine Learning (ML) que clasifica a dichos clientes. Se realiza un análisis exploratorio para refinar los datos, posteriormente se utilizaron Árboles de Decisión y Algoritmos de Impulso (XGBoost). En este último caso, se realizó un entrenamiento con una cuadrícula de hiperparámetros buscando la combinación óptima de datos para finalmente seleccionar el mejor modelo de clasificación basado en sus métricas. Este proceso de desarrollo siguiendo las etapas del proceso KDD (Descubrimiento de Conocimiento en Bases de Datos). El modelo predictivo de ML se implementó en una aplicación web, donde se obtuvo una tasa de éxito de aproximadamente el 95% con respecto a la prueba establecida. La aplicación desarrollada puede clasificar correctamente a los clientes bancarios con una probabilidad de éxito según el modelo implementado y muestra información sobre las muestras de perfiles bancarios. La investigación proporciona una metodología amigable para identificar diferentes perfiles de clientes del sector bancario con probabilidad de presentar problemas de pago o morosidad.

Palabras clave
Machine learning arból de desición gradiante extremo boost clientes bancarios.

INTRODUCTION

Nowadays, banks provide large amounts of money to customers as a credit to generate earnings through interest on their bank loans. However, some customers delay or refuse to pay the credit granted, which is why banks have begun to implement a rigorous analysis of people who are granted a credit or loan. In some entities, when a customer appears to request a bank loan, the executives ask him for specific information, either by way of interrogation (Questions and Answers) or by filling out a form with specific questions, and behind this whole process, the bank itself is in charge of investigating to obtain certain important information from the customer who is requesting the credit. This process can take a long time because of the customer's request and the demand for a bank credit at the time.

As Data Science and Machine Learning have become state-of-the-art across several domains, they have produced exciting solutions to complex problems, including multi-label classification of reviews [1], customer service optimization [2], imbalanced data analysis [3], and other information-related topics. The financial and banking sector is also included, where models have been proposed to predict the credit risk of commercial bank customers. [4] used a Radical Basis Function (RBF) Multilayer Neural Network (MNN) with feedforward learning and compared it with a Logistic Regression Model (LRM). Their dataset contained 492 test cases collected from Jordan Commercial Bank. The Logistic Regression Model (LRM) was the most accurate at correctly classifying accepted customers requesting credit.

The Multilayer Neural Network (MNN) has the advantage of classifying the rejected ones. [5] also compared these two models similarly. The authors used the chi-square (Χ²) test to assess the risk of bad creditors. The dataset included 1.000 cases, and LRM outperformed MNN. Furthermore, Support Vector Machine (SVM) is also an exciting and popular method in the field of automated Machine Learning (AML) [6] - [10]. In [11], a New Fuzzy Support Vector Machine (NFSVM) is used to evaluate credit risk on three different datasets. The NFSVM has greater generalization ability to discriminate between good and bad creditors. The authors compared their SVM model with a logistic regression model, a linear regression model, a neural network model, and other SVM models. NFSVM performs best in terms of sample classification accuracy, but it has enormous computational costs.

Therefore, previous related work provides evidence that bank credit risk assessment is essential, and the financial sector still offers opportunities to develop new concepts and applications of data science and machine learning methods. These papers suggest that an adequate feature selection procedure is required to develop a good model, or that a dimension-reduction procedure is essential, depending on the dataset used. Also, using different metrics is vital for evaluating a learning model’s performance. Parameter tuning, noise management, and correction of unbalanced datasets are essential to solving complex problems in financial credit risk assessment.

While most existing studies focus on improving classification accuracy through specific algorithms such as neural networks, SVMs, or clustering techniques, they typically do not address the full operational pipeline required for real-world deployment. In contrast, the present study integrates the complete Knowledge Discovery in Databases (KDD) process with an optimized XGBoost model and a functional web-based decision support system, bridging the gap between analytical modeling and practical banking applications.Currently, the bank loan approval process in the financial sector could be faster. From the bank's point of view, a costumer’s credit requested must generate profits. However, lending money often creates uncertainty about how likely customers are to repay. A certain percentage of customers will not pay, and profits will be generated even with some customers failing to fulfil the payments. It is essential to calculate these indicators and keep them within a limited range based on their severity, given that they can cause incidents and harm banking operations.

Currently, many people have debts [12] and have been defaulting for long periods due to several factors; the study's main objective was to identify which daily-life variables ordinary defaulters must manage. The customers who meet these variables can be classified as good or bad payers. This bank loan process takes a long time. Thus, by applying machine learning (ML) techniques that leverage a company's historical customer data, in this case, a bank's, it is possible to optimize time management and risk assessment. The challenge lies in identifying reliable payers. Why might a customer with profile X not pay or not be a good payer? What is the profile of a customer who will not pay? Therefore, based on the data, it is possible to run various machine learning (ML) analyses that are not apparent at first glance. The primary objective is to extract indicators, insights, and key findings from the data to help banks make informed decisions, such as on loan requests.The ML predictive model proposed in this article aims to 1) optimize the approval process of a bank loan and, in turn, deliver a reliable and comprehensive result with the information obtained from the customer, 2) create an ML predictive model of classification capable of determining through the profile of a customer if this will be a good payer or not. This research mainly analyzes the data to determine which variables are decisive in evaluating a customer as a good debt payer, then develops and tests the efficiency of a binary classification model. Finally, it implements the best model on a web application to support the decision-making process, it uses machine learning, business intelligence, and programming to build the model. This ML predictive model is capable of classifying bank customer profiles.

METHODOLOGY

This article uses the Knowledge Discovery in Databases (KDD) methodology. It is an automated process that combines discovery and analysis. The process consists of extracting patterns in the form of rules [13] or functions from the data for the user to analyze [14]. KDD can be applied in different domains, i.e., 1) to determine profiles of fraudulent customers (tax evasion), 2) to discover existing implicit relationships between symptoms and diseases, between technical characteristics and diagnosis of the state of equipment and machines, 3) to determine profiles of students “academically successful” in terms of their socioeconomic background, and 4) to determine purchasing patterns of customers in their market baskets [15]. The KDD process is summarized in the following stages. a) Selection, b) Preprocessing and cleaning, c) Transformation and reduction, d) Data mining, and e) Interpretation and evaluation.

Confusion matrix

Based on this matrix, 5 metrics were determined to measure the model’s performance, Table 1.

Table 1: Metrics, Formula and interpretation.
Metrics Formula Interpretation
Precision T P T P + F P How accurate are positive predictions?
Accuracy T P + T N T P + T N + F P + F N Overall model performance
Recall T P T P + F N Proportion of positive samples that can be identified
Specificity T N T N + F P Proportion of negative samples that can be identified
F1-Score 2 T P 2 T P + F P + F N Combined percentage of recall and precision

This matrix has 2 axes: the real class and the predicted class (+, -). Within the matrix, it is divided into four boxes: true positives (values corresponding to class 1 that the model correctly predicted), true negatives (values corresponding to class 0 that the model correctly predicted), and false positives (values predicted as class 1 but that actually belonged to class 0). However, they actually correspond to class 0, representing a type 1 error (in the form of a hypothesis). Finally, the false negatives, which are predicted as class 0 when they actually belonged to class 1, resulting in a type 2 error [9], Figure 1.

Figure 1: Confusion matrix.
Figure 1: Confusion matrix.

Novelty and contribution

The research makes several contributions. First, it focuses on improving the banking industry's customer experience. Second, it identifies a set of strategic variables in the bank's decision-making process, enabling better prediction of customers who may default in the future. This research contributes more than a predictive model. Unlike previous studies that focus mainly on algorithmic performance or customer segmentation, this work provides an end-to-end framework that combines data preparation, model optimization, explainability, fairness auditing, and real-time deployment through a web application.

This integration makes the proposed system suitable for operational use in banking environments, where transparency, accountability, and usability are as important as predictive accuracy.

MATERIALS AND METHODS

This section describes the process for constructing the Machine Learning (ML) predictive model and the Webpage Application. The ML predictive model is deployed to present customer information in a more user-friendly manner, supporting decision-making and providing precise, reliable data.

Database debugging: The dataset contains data from customers who apply for a bank loan. The set has 32.466 records and 26 attributes that store the following information:

BD_(ID_CREDIT, CUSTOMER_NAME, CUSTOMER_LASTNAME, CUSTOMER_ID, CUSTOMER_GENDER, CUSTOMER_AGE, CUSTOMER_SALARY, CUSTOMER_PROPERTY_STATE, HAS_VEHICLE, CUSTOMER_VEHICLE_AGE, NUMBER_CHILDREN, DEJA_CELULAR, DEJA_EMAIL, CUSTOMER_EDUCATION_LEVEL, CUSTOMER_FAMILY_SITUATION, COMPANION_CUSTOMER, CUSTOMER_YEARS_WORKING, CUSTOMER_PROFESSION, CUSTOMER_AMOUNT, CREDIT_APPLICATION_DAY, CREDIT_HISTORICAL_DURATION, CREDIT_GRADE, CREDIT_INTENT, INCOME_PERCENTUAL_CREDIT, CREDIT_INTEREST_RATE, CREDIT_HISTORICAL_STATE).

Additionally,

TARGET: Objective Variable. (1: Customer with potential problems paying, 0: Good payer)

Data selection

In the data selection stage, the KDD process begins with selecting the variables that will be the input of the following stages. An exploratory data analysis is carried out to visualize the categories or distributions of the variables, and the relationship or correlation with the objective variable (1: Customer with potential problems paying, 0: Good payer). (The document provides an example of how each data of the database was analyzed, including data debugging, and an initial requirement to apply the stages of the KDD process).

Data preprocessing and data cleaning

In data preprocessing and data cleaning stage, also known as “scrubbing”, the main task involved checking for variables with null data and filling of missing values with null data, smoothing or removing noisy data and outliers, and resolving inconsistencies. The exploratory data analysis found many categorical and continuous variables, as shown in Figure 2.

Figure 2: Variables with null data.
Figure 2: Variables with null data.

The variable CUSTOMER_YEARS_WORKING has 893 null data. The variable CREDIT_INTEREST_RATE has 3.102 null data. These are continuous variables. The null data can be eliminated; another option is to use an identifying value or incorporate the average as a value. Since they are continuous variables, a filling can be done depending on their nearby records. Finally, this last option is used since it is more convenient to eliminate approximately 3.000 records considering that there are customers of both classes (class 0 and class 1). Objective variable (1: Customer with potential problems paying, 0: Good payer).

Moreover, it is not practical to use an identifying value and the average as variable values when the statistical distribution is non-normal. For this reason, increasing the number of records is unfavorable to the study.

The variable CUSTOMER_VEHICLE_ AGE is not considered an input in the Machine Learning (ML) predictive model because it has a Boolean variable that measures whether or not the customer owns a vehicle; the age of the vehicle is irrelevant, also considering that there is a correlation between the data that does not own a car and the age of the vehicle that ends up taking the value of 0.

The ML predictive model does not use ID_CREDIT as an input because it is simply the credit identifier of each bank loan. After training and testing the model, the ID_CREDIT can be added.

The variables CUSTOMER_ID, CUSTOMER_NAME, and CUSTOMER _LASTNAME are not considered inputs to the ML predictive model because they are simply part of a specific customer’s identifier. Those variables do not cause any discrimination or determine an objective variable.

All the remaining data are used as input for the selected ML models.

Data transformation and data reduction

In the data transformation and data reduction stage, it is necessary to reduce the dimensions and transform the variables, mainly because machine learning models do not take inputs with categories (words). They must be transformed into values or matrices; behind all these ML techniques are mathematical and statistical algorithms. The data transformation and data reduction stage begins by separating variables into categorical and continuous ones since each has a different transformation (Figure 3).

Since there are null values in two of them, a simple imputation is made for the continuous variables. This simple imputation allows filling in the null values.

For categorical variables, the transformation will have two parts: first, impute the most frequent category, to avoid nulls in case future data have null categorical variables. Finally, the category coding is generated in a matrix without relevance to any particular category.

Table 3: Descriptive table of continuous and categorical variables.
Table 3: Descriptive table of continuous and categorical variables.

The Encoder considers a variable that, for example, has three categories (x, y, z), each with a specific meaning in the records; however, it cannot be treated as text in the input; it must be encoded. Suppose that continuous values are given to each variable, for example, x = 1, y = 2, and z = 3; the algorithm can predict that 2x = y or that x + y = z. In this case, not this one, each category is indifferent to the others and does not represent a hierarchy.

The study encoder encodes as follows: x = 1, y = 1, and z = 1, where if the record contains the category x, then x will take the value of 1, and therefore the categories 'y' and 'z' will take the value of 0.

A pipeline is used to store and generate a flow where the relevant variables are entered, and the output includes the transformation performed.

Data mining

Following the data transformation stage, the machine learning model training process commenced. Subse-quently, supervised learning was utilized to identify the optimal model by validating performance on a train-ing set and a 33% test set.

The TARGET variable presents a natural class imbalance since the number of good payers (class 0) is significantly larger than the number of customers with payment problems (class 1). This situation is typical in credit risk datasets and may bias machine learning models toward the majority class.

The proposed framework incorporates resampling strategies such as SMOTE (Synthetic Minority Oversampling Technique) and random Undersampling to address this issue. These techniques can be applied during the training phase of the pipeline in order to improve the model’s sensitivity to the minority class and enhance the detection of potential defaulters.

These strategies are evaluated using recall and F1-Score metrics for class 1, which are more appropriate than overall accuracy in imbalanced classification problems.

First, it trains an ML model using decision trees by default. Using statistics, this algorithm branches the variables. It obtains the probabilities of each class, in this case, two classes, determining whether a customer does not present problems with credit payment or will not pay. This model is described as a decision tree model.

A boosting algorithm (XGBoost) based on Decision Trees increases the prediction percentage in both classes [16]. First, the XGBoost model is applied in default mode to see if whether it can increase the classification percentage. If this is achieved, the model is improved by tuning its parameters. This model is described as model XGBoost.

In the second iteration, a hyperparameter grid search (GridSearch) is performed on the XGBoost algorithm. The model initially tested was trained with its default hyperparameters. However, these default values are not always optimal for our dataset. Therefore, this study aims to identify the optimal hyperparameters to address this issue.

The grid used for this purpose has the number of estimators needed (n_estimators), the depth of the trees (max_depth), and the learning rate (learning_rate), as shown in Figure 4.

Figure 4: Parameter grid used.
Figure 4: Parameter grid used.

This parameter grid and GridSearch produced over 1.000 XGBoost models, and cross-validation is applied to average the performance of the iterations. The study ran 5.000 training sessions with various parameter combinations to find the best arrangement that fits the data and consequently increases the level of projection of the Machine Learning (ML) predictive model.

At the end of the execution of the grid, it is possible to obtain the best combination of parameters for this data, as shown in Table 2.

Table 2: Parameter application result.
Parameter name Value
n_estimators 700
Max_depth 4
Learning_rate 0,09

This final model is referred to as the XGBoost enhanced model. The models are then evaluated and compared based on their performance metrics to determine which one best suits the proposed objective.

Model interpretability layer

Beyond predictive performance, the proposed system incorporates a post-hoc model interpretability layer based on explainable artificial intelligence (XAI) techniques. In particular, SHAP (SHapley Additive exPlanations) and LIME (Local Interpretable Model-agnostic Explanations) decompose each XGBoost prediction into marginal contributions of the input variables.

This allows the system to identify which customer attributes, such as income, property status, credit interest rate, historical credit duration or education level, drive the probability of default for each individual prediction. In this way, the model shifts from a black-box classifier to a transparent decision-support tool that banking analysts and regulators can audit and interpret.

Data interpretation and data evaluation

Decision tree model: The calibration curve predicts 0,839, that is, 84% effectiveness. However, it deviates considerably in the cases corresponding to class 1 (customers with potential problems paying). The calibration curve needs to be adjusted linearly to achieve a perfect prediction of 100%. It moves away from the cases corresponding to class 1, reaching approximately 70%, as shown in Figure 5.

As shown in Table 3, the confusion matrix for each class separately and an ROC curve adjust to 84%. In the Good Payers class, the ML model correctly predicts 7.708 cases, failing only 671. In the Possible Bad Payers class, the ML model predicts 1.731 correctly, with 604 incorrect predictions.

Figure 5: Decision tree model: Calibration, ROC curve, prediction test set (by default).
Figure 5: Decision tree model: Calibration, ROC curve, prediction test set (by default).
Table 3: Decision tree model: metrics results (by default).
Class Precision Recall F1-Score
Good Payers 0,927 0,92 0,924
Possible Bad Payers 0,721 0,741 0,731

In Table 3 shows that class 0 (Good Payers) is predicted with over 90% accuracy, and class 1 (Possible Bad Payers, i.e., customers with payment problems) is predicted with over 70%, with a significant improvement percentage.

XGBoost model: achieves 92% prediction accuracy. The ML model increases by 8% compared to the decision tree model. The calibration curve better fits the model's percentage predictions, as shown in Figure 6.

The ROC curve shows the XGBoost model’s classification performance. This model could be a better prediction, and it strays right at the 0,5 cut point of the data. Therefore, it produces slightly lower predictions when customers have a probability close to 50% of presenting problems. The confusion matrix shows that XGBoost model has than 100 false negatives in the Good Payers class; for the Possible Bad Payers class, XGBoost model correctly predicts 1,709 out of a total of 2,335 cases.

Figure 6: XGBoost model: calibration, ROC curve, prediction test set.
Figure 6: XGBoost model: calibration, ROC curve, prediction test set.

In the XGBoost model, class 0 metrics increased to over 90%, and class 1 metrics increased compared with the decision tree model, especially Precision and F1-Score metric, but the data could be more balanced. Therefore, a considerable increase in this metric shows an increase in the effectiveness of the predictions considering the initial problem, as shown in Table 4.

Table 4: XGBoost model: metrics result.
Class Precision Recall F1-Score
Good Payers 0,930 0,989 0,958
Possible Bad Payers 0,949 0,732 0,826

XGBoost enhanced model: The XGBoost model training with optimal parameters as an input obtains 94,82% correct predictions. The model adjusts the prediction line better, as shown in Figure 7.

The ROC curve (Figure 7) shows the overall prediction performance and 94,82% correct predictions. The model has optimal parameters and achieves better predictions. In the confusion matrix, Good Payers class (class 0) fail in only in 92 cases. The class of Possible Bad Payers (class 1) shows that the well-classified cases increased to 18.301.830, as shown in Table 5.

Figure 7: XGBoost enhanced model: Calibration, ROC curve, prediction test set.
Figure 7: XGBoost enhanced model: Calibration, ROC curve, prediction test set.
Table 5: XGBoost enhanced model: metrics result.
Class Precision Recall F1-Score
Good Payers 0,942 0,989 0,965
Possible Bad Payers 0,952 0,783 0,859

In Table 5 shows a considerable increase in the Possible Bad payers’ class, with 95% accuracy but 78% completeness. The training set is quite unbalanced; therefore, it is also essential to consider the F1-Score, which is higher than in the previous two models.

Although the training set is unbalanced, F1-score and recall for class 1 allows an appropriate evaluation of the model’s ability to detect risky customers. Furthermore, the proposed framework supports resampling strategies, such as SMOTE, to further increase the sensitivity of the XGBoost enhanced model to minority-class instances when the operational context requires it.

Bias and fairness analysis

Additionally, to improve predictive performance, the system was designed to support algorithmic fairness and bias analysis. Because several input variables correspond to sensitive or socio-demographic attributes, such as gender, age, education level, and property status, the framework allows evaluation of classification outcomes across subgroups.

For each subgroup, the system can compute false positive and false negative rates, helping identify potential indirect discrimination. This auditing process is essential in credit scoring systems, where unequal error rates across protected groups may lead to unfair exclusion from financial services.

Comparing models

Comparing the models verifies the exact variations in each metric (Precision, Recall, and F1-Score). The comparison of each metric across the three ML models is shown below.

As illustrated, Figure 8 shows the Precision metric of the decision tree model, XGBoost model, and XGBoost enhanced model. The comparison shows that the models made with XGBoost enhanced model exceed 90% in both classes (1: Customer with potential problems paying, 0: Good Payer).

Figure 8: Precision metric.
Figure 8: Precision metric.

As illustrated, Figure 9 shows the Recall metric of the decision tree model, XGBoost model, and XGBoost enhanced model. The comparison shows that XGBoost enhanced model is superior. Also, class 1 (Customers with potential problems paying) in the decision tree model slightly outperforms the XGBoost algorithm. However, there is a vast difference in class 0 (Good Payer).

Figure 9: Recall metric.
Figure 9: Recall metric.

As illustrated, Figure 10 shows the F1-Score metric of the decision tree model, XGBoost model, and XGBoost enhanced model. The comparison shows that the F1-Score metric matters because it emphasizes precision and completeness. The Precision and Recall metrics combined into one (F1-Score) shows that the models built with the XGBoost algorithm stand out, with a slight increase is seen in the XGBoost enhanced model.

Figure 10: F1-Score metric.
Figure 10: F1-Score metric.

As illustrated, Figure 11 shows the ROC curve metric of the decision tree model, XGBoost model, and XGBoost enhanced model. Comparing the ROC curves shows that the XGBoost enhanced model can be implemented in a web application.

Figure 11: ROC Curve Metric.
Figure 11: ROC Curve Metric.

Webpage implementation

The XGBoost enhanced model is implement on a webpage application using Flask, a micro web framework written in Python that allows building websites using HTML and CSS. The following section describes the system's architecture, including information flow, active or running components, and the system’s purpose.

Figure 12: Representation of three levels of application architecture.
Figure 12: Representation of three levels of application architecture.

Figure 12, on the left, shows the system, composed of a Three-Level architecture, subdivided into the presentation level, business level, and data level, defined as a web app. The interaction with the different users and the execution of all services. The XGBoost enhanced model is stored here with a data manager.

Figure 12, on the right, shows a descriptive graph of the interaction between the system’s components. The Web App. or Frontend, has a direct connection to the Backend, providing the services to be used throughout the interaction with the application; that is, the backend processes each query made to the database. It generates a “request” to the database.

Furthermore, the machine learning model is integrated into the application and runs on request. The backend maintains a direct connection to the model, and trigger procedures connect to the database in re-sponse to client requests, primarily to store new client predictions.

The architecture also integrates an explainability service connected to the machine learning model. When a prediction is generated, the SHAP/LIME module computes a ranked list of feature contributions and returns it to the front-end with the default probability. This allows the Web Application to display not only the predicted risk but also the main variables that influenced the decision, supporting transparency and regulatory compliance.

System operation and API layer

The web application exposes a set of RESTful endpoints that coordinate interactions among users, the database, and the machine learning model. typical endpoints include: i) authentication and user management, ii) credit data upload, iii) prediction request, and iv) retrieval of prediction results and explanatory variables.

The backend validates all incoming requests, controls access permissions, and logs prediction events, allowing traceability of each decision. This architecture enables secure deployment in institutional environments, where auditability and accountability are mandatory.

RESULTS

The research developed a predictive XGBoost enhanced model capable of predicting customer profiles with 95% accuracy, based on its ROC curve. The Boost enhanced model was successfully implemented on a user-friendly Webpage Application. At the same time, it clearly displayed each profile’s information, making the model criteria intuitive and differentiating the significant variables for each profile.

Beyond predictive accuracy, integrating the interpretability layer allows each prediction to be explained in terms of customer variables that exert the greatest influence. This enables bank analysts to understand why a given client is classified as a potential defaulter, building trust, human validation, and ensuring accountability in credit decisions.

The results obtained allow considering the option of implementing predictive models when solving this type of problem, allowing for optimized response times, in this case, when determining customer default. However, it is necessary to mention that the predictive ML model uses a specific dataset that increases the number of inputs, and new training must be carried out. The XGBoost enhanced model needs constant calibration. Over time, it is likely to lose a certain percentage of its performance, making the predictions less reliable. This point is a limitation because it does not account for external variables; this aligns with current MLOps methodology, which ensures ML models can be deployed repeatedly and continuously monitored.

The system's proposal is relatively simple; its functionality can address and support client service requests, and it can be scaled based on the functionalities the Three-Level architecture currently provides.

The exploratory analysis of variables such as gender, age, and property status also provides a basis for fairness auditing. For example, although male and female customers exhibit similar default rates in the dataset, the model allows verification that prediction errors remain balanced across these groups, preventing discriminatory outcomes.

OTHER INFORMATION TO CONSIDER

Data preparation

The machine learning model must be saved in a file. Ready to use when new predictions are generated. For this, Joblib (a set of tools to provide pipelining in Python) is used to save the trained model in a file with the extension “.joblib”. It makes the ML model available to requests on the front end by having the backend generate the call of the service that used the ML model.

BBDD: MySQL is used for the database that contains a dataset of 32.466 records and 27 attributes. The database contains two tables. The first table stores the customers who can access the webpage application. The attributes are a Count ID, a User ID, a Password, and a Username. The second table stores all the information of the bank credit samples, mainly the TARGET field, initialized NULL, and then stores the TARGET field after the prediction.

The bank credits will be added sequentially with the TARGET field If its value is NULL, the customer has yet to make a prediction. It allows the system to identify the customers that still need to make a prediction, which the system will prioritize when downloading samples from this table. When the predictions are made, the TARGET field will be updated. A stored procedure will do this.

Exploratory data analysis

An example of exploratory data analyzes follows below. It was performed with the dataset corresponding to data from customers who apply for the acquisition of a bank loan. The dataset has 32.466 records and 27 attributes.

CUSTOMER_GENDER: A categorical variable with two options: Male and female. Figure 13 left shows. In the Male category, 19.482 of 32.466 records (60,00% of the dataset). And in the Female category, 12.984 of 32.466 records (39,99% of the dataset). Figure 11 right shows (1: Customer with potential problems paying, 0: Good payer). In the Male category, 4.253 customers present payment problems of 19.482 records (21,83%). And in the Female category, 2.840 customers present payment problems of 12.984 records (21,87%). Men and women have an almost similar relationship. Thus, 22% of men or women customers may present possible payment problems in the future.

Figure 13: Chart variable CUSTOMER_GENDER and variable CUSTOMER_GENDER vs. TARGET.
Figure 13: Chart variable CUSTOMER_GENDER and variable CUSTOMER_GENDER vs. TARGET.

CUSTOMER_AGE: A continuous variable. Figure 14 shows that the age of the customers is between the range of 20 to 65 years. Having more presence in 20 and 30 years adds almost 22.000 records.

Figure 14: Chart variable CUSTOMER_AGE.
Figure 14: Chart variable CUSTOMER_AGE.

CUSTOMER_SALARY: A continuous variable. Figure 15 shows that the customers' salaries are between the range of 200.000 Chilean pesos up to 20.000.000 Chilean pesos.

Figure 15: Chart variable CUSTOMER_SALARY.
Figure 15: Chart variable CUSTOMER_SALARY.

CUSTOMER_PROPERTY_STATE: A Categorical variable with four options: Rent, Mortgage, Own, and Other. Figure 16 left shows. The Rent category, 16.400 of 32.466 records (50,51% of the dataset). In the Mortgage category, 13.382 of 32.466 records (41,21% of the dataset). In the Own category, 2.579 of 32.466 records (7,94% of the dataset). And finally, in the other category, 105 of 32,466 records (0,32% of the dataset). Figure 14 right shows (1: Customer with potential problems paying, 0: Good payer). In the Rent category, 5.185 of 16.400 records (31,6% of customers present payment problems). In the Mortgage category, 1.683 of 13.382 records (12,5% of customers present payment problems). In the Own category, 192 of 2.579 records (0,74% of customers present payment problems). And finally, in the other category, 33 of 105 records (31,4% of customers present payment problems).

Figure 16: Chart variable CUSTOMER_PROPERTY_STATE and variable CUSTOMER_PROPERTY_STATE vs. TARGET.
Figure 16: Chart variable CUSTOMER_PROPERTY_STATE and variable CUSTOMER_PROPERTY_STATE vs. TARGET.

CONCLUSION

This research aims to implement an XGBoost enhanced model to classify bank customer profiles. For this, customers bank data were selected to carry out the KDD process.

This KDD process was applied in three classification models (decision tree model, XGBoost model, and XGBoost enhanced model), using different algorithms and adjusting the internal parameters. Each model was then evaluated using its metrics to select the model that best classified bank customers as good or bad payers. The best predictive ML model obtained a 95% performance according to its ROC curve.

This predictive XGBoost enhanced model was implemented in a bank customer profile classification system, making it easier for anyone to use, particularly, customers could download data samples, predict using the model, and visualize the results.

In essence, the proposed objectives are achieved by meeting the expectations of the bank customer profile classification system, and the project can be scaled as needed.

Future versions of the system may further exploit class rebalancing techniques to adapt the model to different institutional risk preferences. For instance, a conservative bank may prioritize higher recall for class 1 by increasing oversampling, while a growth-oriented bank may tolerate a higher false positive rate.

From an ethical and regulatory perspective, the proposed system supports responsible artificial intelligence by enabling bias monitoring across socio-demographic groups. This is particularly relevant in financial contexts, where automated credit decisions must comply with non-discrimination principles and consumer protection regulations.

In real banking environments, automated credit decisions must be transparent, auditable and subject to human oversight. The proposed three-layer architecture supports these requirements by separating data management, model execution, and presentation. It also integrates explainability and bias analysis to support compliance with financial regulations and ethical standards.

FUNDING

No funding is declared for this work.

Author notes

* Autor correspondiente / Correspondence: [email protected]

References

[1] E. Deniz, H. Erbay, and M. Coşar, “Multi-label classification of E-Commerce customer reviews via machine learning,” Axioms, vol. 11, no. 9, Art. no. 436, 2022, doi: 10.3390/axioms11090436
[2] M. Díaz and G. Carrasco, “Fuzzy logic and decision making applied to customer service optimization,” Axioms, vol. 12, no. 5, Art. no. 448, 2023, doi: 10.3390/axioms12050448
[3] M. Zheng, F. Wang, X. Hu, Y. Miao, H. Cao, and M. Tang, “Method for analyzing the performance impact of imbalanced binary data on machine learning models,” Axioms, vol. 11, no. 11, Art. no. 607, 2022, doi: 10.3390/axioms11110607
[4] B. Hussain and E. Shorouq, “Credit risk assessment model for Jordanian commercial banks: Neural scoring approach,” Review of Development Finance, vol. 4, no. 1, pp. 20–28, 2014, doi: 10.1016/j.rdf.2014.03.002
[5] G. Attigeri, M. Pai, and R. Pai, “Credit risk assessment using machine learning algorithms,” Advanced Science Letters, vol. 23, no. 4, 2017, pp. 3649-3653, doi:10.1166/asl.2017.9018
[6] Q. Ross, C4.5: Programs for Machine Learning, USA: Elsevier, 2014.
[7] D. Wolpert and W. Macready “No free lunch theorems for optimization,” IEEE Transactions on Evolutionary Computation, vol. 1, no. 1, pp. 67–82, 1997, doi: 10.1109/4235.585893
[8] F. Pedregosa et al., “Scikit-learn: Machine Learning in Python,” Journal of Machine Learning Research (JMLR), vol. 12, pp. 2825–2830, 2011.
[9] A. Amidi and S. Amidi, “VIP Cheasheet: Machine Learning tips,” github.com. [Online]. Available: https://github.com/afshinea/stanford-cs-229-machine-learning/blob/master/en/cheatsheet-machine-learning-tips-and-tricks.pdf
[10] A. Burkov, “The hundred-page machine learning book,” Journal of Information Technology Case and Application Research, vol. 22, no. 2, 2020, doi: 10.1080/15228053.2020.1766224
[11] Y. Wang, S. Wang, and K. K. Lai, “A new fuzzy support vector machine to evaluate credit risk,” IEEE Transactions on Fuzzy Systems, vol. 13, no. 6, pp. 820–831, 2005, doi: 10.1109/TFUZZ.2005.859320
[12] SERNAC, “55% de los consumidores admite que tiene dificultades para pagar sus deudas por la pandemia”, sernac.cl. [En línea]. Disponible: https://www.sernac.cl/portal/604/w3-article-59226.html
[13] C. Bishop, Pattern Recognition and Machine Learning, Singapur: Springer, 2006.
[14] C. F. Tsai, Y. C. Lin, and C. P. Chen, “A new fast algorithms for mining association rules in large databases,” IEEE International Conference on Systems, Man and Cybernetics, vol. 10, 2022, doi: 10.1109/ICSMC.2002.1175703
[15] C. Ming-Syan, H. Jiawei, and Y. Philip, “Data mining: an overview from a database perspective,” IEEE Transactions on Knowledge and data Engineering, vol. 8, no. 6, pp. 866-883, 1996, doi: 10.1109/69.553155
[16] Y. Freund and R. E. Schapire, “A decision-theoretic generalization of on-line learning and an application to boosting,” Journal of Computer and System Sciences, vol. 55, no. 1, pp. 119-139, 1997, doi:10.1006/jcss.1997.1504