Article

October 09, 2026

Predictive model of default risk in banking customers using machine learning techniques

Predictive Model of Default Risk in Banking Customers Using Machine Learning Techniques

Luis Alberto Valverde Fernández; Cleverson Henrique de Freitas

DOI: 10.22167/2675-6528-202603212

Article derived from a Course Conclusion Work (TCC), with content based on the student’s original work and adapted to the editorial format of the E&S Magazine with the support of the ResumeAI tool, an artificial intelligence solution developed by Instituto Pecege for textual synthesis and organization.

Summary

Financial exclusion and the prevalence of informal credit in Peru motivated the search for innovative solutions for risk assessment. The objective was to develop a predictive model of default using machine learning techniques to support more accurate credit decisions and expand access to the formal financial system. For this purpose, a historical database of 3,478 credit records from a Peruvian municipal savings and loan cooperative was used, containing 22 cadastral, economic, and behavioral variables. Logistic Regression, Random Forest, and XGBoost models were tested, with data balancing via SMOTE, and evaluated by metrics such as AUC-ROC, KS, and Recall, in addition to explainability with SHAP. The XGBoost model achieved the best performance, with an AUC of 0.966 and a Recall of 88.9%, correctly identifying most defaulters. The business existence duration variable proved to be the most relevant for risk prediction. A risk scorecard was developed for operationalizing decisions. It was concluded that the proposed model offers a robust tool for microfinance institutions, enabling safer and more efficient credit decisions, reducing critical classification errors, and promoting financial inclusion through data-driven policies, such as maturity thresholds and guarantor requirements.

Keywords: Default; Machine learning; Microfinance; Peru; Credit risk.

1. Introduction

Access to credit is a fundamental pillar for financial inclusion and economic development, especially in emerging economies. In the Latin American context, Peru still stands out for presenting one of the lowest banking rates. Recent data indicate that, between 2020 and 2022, the share of the Peruvian population with a bank account grew from 42% to 52% (BCRP, 2023; Garrido Allepuz, 2024). However, this expansion is not homogeneous, with significant regional inequalities persisting, with Lima Metropolitana reaching about 63% banking penetration, while the Sierra and Selva regions register less than 44%. In these rural areas, low income is a limiting factor that hinders access to the formal financial system, making financial digitalization a promising alternative to expand inclusion.

Low financial inclusion in Peru has favored the proliferation of informal credit, manifested in schemes such as “gota a gota”. Although these loans are disbursed quickly and do not require collateral, they impose extremely high interest rates. According to the Peruvian Economic Institute, 49% of informal credits charge rates exceeding 500% per year. This type of credit exposes borrowers to severe risks, including over-indebtedness, violence, and significant financial losses, primarily affecting small entrepreneurs and vulnerable populations. Traditional credit models, often based on linear logistic regression, prove insufficient to capture the complexity and fluctuation of informal income, contributing to financial exclusion.

Given this scenario, a market vacuum is identified for more sophisticated risk assessment approaches. Financial institutions that adopt non-linear algorithms have the opportunity to read hidden risk, allowing them to absorb good clients who are currently rejected by the rigidity of traditional banking models. Machine learning emerges as a powerful tool to overcome these limitations, offering techniques such as Logistic Regression, Random Forest, and XGBoost, capable of processing large volumes of data and identifying complex default patterns. Additionally, Explainable Artificial Intelligence (XAI), through tools like SHAP, can bring transparency to these models, making their decisions understandable and reliable.

The relevance of this study lies in the urgency to improve credit decisions to mitigate the risks associated with informal credit and, simultaneously, expand access to the formal financial system for marginalized populations. Thus, the present work seeks to develop a predictive model of nonpayment using machine learning techniques (Logistic Regression, Random Forest, and XGBoost) to support more accurate credit decisions and expand access to the formal financial system in Peru.

2. Material and Methods

This research was characterized as a study of a quantitative nature and applied approach, aiming at the development of a predictive model. The central objective was to build and evaluate a system capable of predicting default in credit operations, using machine learning techniques. The methodology employed sought to provide subsidies for more assertive credit decisions, aligning with the need to expand access to the formal financial system in Peru.

The unit of analysis consisted of a historical database of credits, from a municipal savings bank located in Lambayeque, Peru. The dataset comprised 3,478 records of credit operations, each detailed by 22 distinct variables. These variables covered customer registration information, economic data, and behavioral aspects related to credit history.

The study’s target variable was default/non-payment, categorized in a binary fashion: 1 for defaulting clients and 0 for non-defaulting ones. Before modeling, a rigorous data preprocessing step was performed. Initially, missing values were handled, ensuring the completeness and integrity of the dataset for subsequent analysis stages.

Additionally, variables that presented potential for *data leakage*, a phenomenon that could introduce future information into the model’s training, compromising its real predictive capacity, were removed. Categorical variables were encoded using *one-hot encoding*, binary, and ordinal techniques, according to the nature of each attribute. Numerical variables, in turn, were subjected to normalization processes.

To select the most relevant variables, the *Information Value* (IV) of each attribute in relation to the target variable was calculated. This procedure allowed the identification and prioritization of variables with greater discriminatory power, optimizing the performance of predictive models and reducing the dimensionality of the dataset, focusing on the most significant predictors.

The exploratory data analysis stage included investigating the distribution of the target variable, where the proportion of default/ non-payment in the dataset was observed. Univariate and bivariate analyses of the variables were performed to identify patterns, relationships, and important characteristics that could influence default/ non-payment, providing an initial understanding of the data.

For predictive modeling, the dataset was divided into two parts: 80% for model training and 20% for testing. This split ensured that the models were evaluated on data not seen during training, providing a more realistic estimate of their performance in future scenarios. Supervised machine learning models were trained.

The machine learning algorithms selected for the development of the predictive model were Logistic Regression, Random Forest, and XGBoost. Each of these models was trained with both the original dataset and the balanced dataset, using the SMOTE (Synthetic Minority Over-sampling Technique) technique, in order to mitigate the imbalance between the default and non-default classes.

The performance evaluation of the models was carried out through several metrics. The Area Under the ROC Curve (AUC-ROC), the Kolmogorov-Smirnov (KS) statistic, the Gini coefficient, Precision, Recall, and F1-score were used. These metrics allowed for a comprehensive analysis of the discriminatory capacity, accuracy, and robustness of each model in predicting default.

After individual training and evaluation, the models’ performance was compared to identify the one with the best predictive performance. Additionally, an *overfitting* analysis was performed, examining the difference between the models’ performance on the training and test sets, to ensure the generalization capability of the developed models.

For the interpretability of the model’s decisions, the SHAP (SHapley Additive exPlanations) technique was applied. This tool allowed us to understand the global importance of each variable and the individual impact of each attribute on the model’s predictions. Based on the results, a risk *scorecard* was developed, with scores from 0 to 100, to assist in classifying credit risk.

3. Results and Discussion

The analysis of historical credit data from a Peruvian municipal savings bank revealed an overall default rate of 20.8%, a value significantly higher than the average of 6.1% observed in the Peruvian financial system. This finding underscores the urgency of improving risk assessment methods, especially in the microfinance sector, where the vulnerability of borrowers is accentuated. The high default rate not only compromises the sustainability of financial institutions but also perpetuates the cycle of exclusion, hindering access to formal credit for small entrepreneurs and marginalized populations, who often resort to high-cost and high-risk informal alternatives.

The in-depth investigation of default patterns allowed the identification of crucial risk factors impacting the microcredit portfolio. Firstly, sectoral risk proved to be a significant component, with 52.5% of defaults concentrated in the Personal Services and Beauty sectors. These businesses are characterized by their high sensitivity to economic shocks and the absence of substantial fixed assets, making them more vulnerable to market fluctuations and unforeseen events. Understanding this sectoral vulnerability is essential for formulating more adapted and preventive credit policies.

Secondly, the presence of a guarantee, specifically the figure of a guarantor, emerged as a statistically vital risk mitigation factor. It was observed that the nonpayment rate for loans with a guarantor was 9.07%, a significant reduction compared to the 22.65% recorded in operations without this protection. This data highlights the importance of the moral pressure exerted by the guarantor, which acts as an additional incentive for the fulfillment of financial obligations. The inclusion of guarantors, therefore, is not just a security measure, but a mechanism that strengthens the borrower’s responsibility and commitment.

Business maturity risk constituted the third prominent factor, revealing a strong inverse correlation with non-payment. It was found that 83.9% of overdue cases were associated with businesses less than two years old. As the venture’s maturity increased, the default rate progressively decreased, reaching 0% for businesses with more than six years of continuous operation. This result suggests that stability and accumulated experience over time confer greater financial resilience to businesses, making them less prone to payment failures on their debts.

To address the complexity of these risk factors, different predictive models for nonpayment were tested, including Logistic Regression, Random Forest, and XGBoost, with the aim of identifying the most effective approach. Logistic Regression, although offering high interpretability, demonstrated lower accuracy when attempting to model complex non-linear relationships, achieving an AUC of 0.954, a KS of 0.758, and a Recall of 86.8%. The Random Forest model, in turn, presented good spatial segregation and a superior Recall of 90.3%, with an AUC of 0.954 and a KS of 0.805, but proved prone to a higher rate of false positives in contexts of unbalanced data.

The XGBoost model, without the application of SMOTE for balancing, stood out as the best performing, being considered the “absolute champion” among the tested algorithms. This model achieved an AUC of 0.966, a KS of 0.810, and a Recall of 88.9%. Its superiority lies in its ability to capture subtle patterns in the data without distorting the original information, presenting an ideal balance between the detection rate of defaulters and generalization stability. The robustness of XGBoost allows for more accurate and reliable prediction, fundamental for credit decision-making in a microfinance environment.

The performance of the XGBoost model was evaluated by rigorous metrics, confirming its world-class accuracy. The AUC value of 0.966 widely surpasses the market threshold of 0.80 for operational credit models, indicating an almost perfect ability to separate good and bad payers. The KS statistic of 0.810 demonstrates a discrimination capability significantly superior to the average of 0.70 operated in the Peruvian financial system. Furthermore, the Recall rate of 88.9% is particularly relevant, as the model correctly identified 128 out of 144 actual defaulters in the test set, directly protecting the institution’s capital against imminent financial losses.

The stability of the XGBoost model was confirmed through 5-fold stratified cross-validation, which resulted in an average AUC of 0.969 ± 0.007, with no signs of overfitting (Δ < 0.10). This validation ensures that the model not only performs well on the training data but also maintains its effectiveness on new data, guaranteeing its practical applicability and long-term reliability. Generalization capability is a critical attribute for predictive models in dynamic environments such as the microfinance market.

The model’s explainability, achieved using the SHAP (SHapley Additive exPlanations) tool, allowed for the identification of variables that truly define default risk. The five most important variables were: business existence time, number of income sources, presence of fixed assets, initial debt, and monthly installment. The SHAP analysis increased the transparency of the model’s decisions, making the weight of each factor in risk prediction understandable. This clarity is fundamental for the acceptance and implementation of the model by credit analysts and for building trust with clients.

Among the identified variables, the business’s time in existence stood out as the most relevant factor. More mature businesses, with longer operating times, were associated with a lower risk of nonpayment, while recent ventures showed a higher probability of failure. This observation reinforces the interpretation that a business’s financial stability and resilience increase with experience and market establishment. Business maturity, therefore, serves as a robust indicator of payment capacity and venture solidity.

A practical example of the model’s application illustrates how risk factors combine to determine the probability of default. For a client classified with a 99.9% probability of default, the factors that most contributed to the increased risk were: the business being recent (only 0.9 years of existence, with an impact of +7.37), a high initial debt requested (+1.69), and possessing only one source of income (+0.51). In contrast, the presence of fixed assets (-0.28) and homeownership (-0.26) were factors that marginally reduced the risk, but were not sufficient to offset the high-risk elements. This transparent analysis allows analysts to understand the logic behind each decision.

The importance of the “business age” variable was further highlighted when comparing the model’s performance with and without its inclusion. Model A, which incorporated the age, presented an AUC of 0.966 and only 16 false negatives, demonstrating superior performance. In contrast, Model B, without this variable, obtained an AUC of 0.862 and 44 false negatives, representing a 175% increase in undetected defaulters. This result underscores that business maturity is the most important variable in the model, significantly reducing critical classification errors and, consequently, costs for the financial institution.

The analysis of costs associated with classification errors revealed that false positives, i.e., good customers rejected, represented 6.6% of the total, corresponding to 46 customers. This is the customer cost, a loss of business opportunity. False negatives, i.e., undetected defaulters, totaled 2.3%, equivalent to 16 defaulters. This is the bank’s cost, representing a higher risk of loss. The inclusion of business maturity in the model not only improves predictive performance but also reduces these critical costs, resulting in safer and more efficient credit decisions.

Despite the high performance of the XGBoost model, the analysis of the 16 false negatives, termed “camouflaged defaulters”, revealed an inherent limitation of machine learning. While classic defaulters were characterized by incipient businesses (average of 1.9 years), centralized income (1.46 sources), and low collateral (only 38% with assets), the camouflaged ones presented apparently ideal profiles at the time of disbursement, with established businesses (average of 3.5 years), diversified income (1.88 sources), and high anchoring (81% with collateral fixed assets).

The diagnosis for these disguised defaulters indicated that the default invariably occurred due to drastic and unpredictable external shocks, not cataloged in the structural data of the survey. Examples include natural phenomena such as El Niño or severe family health emergencies. This finding suggests that the absolute limit of machine learning lies in its inability to predict random and unpredictable events that occur post-credit granting, highlighting the need to complement algorithmic analysis with an understanding of the clients’ context and reality.

To operationalize the algorithm and translate complex probabilities into immediate guidelines, a risk scorecard was developed. This scorecard categorizes clients into four risk levels based on their score: Low Risk (Score 80-100), Medium Risk (Score 60-79), High Risk (Score 40-59), and Very High Risk (Score 0-39). For each category, a specific operational action is recommended, from automatic approval for low risks to summary rejection for very high risks, allowing for standardized and efficient decision-making.

Based on the model’s findings, three new implementable credit guidelines were proposed, which complement the algorithmic decision and enhance the approval process. The first is the “4-Year Maturity Threshold”, which exempts from the co-signer requirement only documented businesses that prove more than four years of continuous operation. This policy aims to reward stability and experience, aligning with the most important variable identified by the model.

The second guideline is the “Personal Services Security Lock”, which establishes the mandatory and non-negotiable requirement of a guarantor for entrepreneurs in the Personal Services and Beauty sector. This measure aims to mitigate the identified high sectoral risk of 52.5%, protecting the credit portfolio in more vulnerable segments. The third policy, the “Human Intervention Point”, makes manual analysis and in-person interviews mandatory for applications classified in the “Orange Zone” (score between 40 and 60). This human intervention seeks to reduce unfair rejections of micro-entrepreneurs with recovery potential, recognizing the limits of the model and the importance of qualitative assessment.

In summary, the results demonstrate that the XGBoost-based default predictive model offers a robust and accurate tool for microfinance institutions in Peru, outperforming traditional models and the market average across several metrics. The identification of business age as the most relevant variable, along with the ability to detect most defaulters and the proposal of a risk scorecard and clear credit guidelines, significantly contributes to safer and more efficient credit decisions. Such advancements promote financial inclusion by enabling institutions to absorb good clients who would be rejected by rigid models, while simultaneously mitigating risks and optimizing portfolio management.

4. Conclusion

This study sought to develop a predictive model of default using machine learning techniques to support more accurate credit decisions and expand access to the formal financial system in Peru. A high rate of default was observed in the microcredit portfolio, at 20.8%, and it was identified that sector risk, the absence of a guarantor, and business maturity were crucial factors. Among the models tested, XGBoost achieved the best predictive performance, with an AUC of 0.966 and a Recall of 88.9%, significantly outperforming market standards. Explainability analysis with SHAP revealed that the business’s time in existence was the most relevant variable for risk prediction. The main contribution lies in the proposal of an operational risk scorecard and innovative credit guidelines, such as the 4-Year Maturity Threshold and the Personal Services Security Lock, which allow microfinance institutions to make safer and more efficient decisions, reducing critical classification errors and promoting financial inclusion.

However, the study acknowledged that machine learning has an inherent limitation in predicting random and unpredictable post-credit granting events, such as drastic external shocks that generate so-called “hidden defaulters”. Furthermore, the results are confined to a single agency and a specific period, which suggests the need to verify their external validity. For future studies, it is recommended to validate the model in other agencies or periods, as well as to incorporate post-granting behavioral variables, in order to further enhance the predictive capacity and robustness of credit decisions. Such advances can strengthen risk management and expand access to formal credit for vulnerable populations, contributing to economic and social development.

Bibliographic References

BCRP, 2023 [Full reference not found in the original document]

Garrido Allepuz, 2024 [Full reference not found in the original document]

Article originating from the Final Course Project of the Specialization in Data Science and Analytics of the MBA USP/Esalq

To learn more about the course, click here and access the MBX Academy platform

You may also like

Executive Mba In Leadership And Management

November 23, 2026

Improvements in the efficiency of a secondary biological sludge drying plant

The management of industrial solid waste, especially secondary biological sludge, represented an operational and strategic challenge for a company in the pulp and paper sector. A secondary biological sludge drying plant, installed to meet environmental requirements and reduce costs, operated with low efficiency and high unavailability. The objective of this study was to evaluate and propose a set of actions to increase the operational availability of the plant, ensure the integral processing of the generated sludge, and reduce treatment and transportation costs, in addition to mitigating environmental risks. To this end, an analysis of the root causes of low efficiency was carried out, using tools such as the cause-and-effect diagram (Ishikawa) and the “5 whys” analysis, and hypotheses were tested to identify the most impactful factors. Three main root causes were identified: addition of low-load effluent to the process, absence of a dedicated maintenance team, and lower consistency of dewatered sludge. The proposed countermeasures, which included stopping the addition of effluent, hiring a maintenance team, and testing polymers, had a monthly implementation cost of R$ 35,000.00. An annual reduction in operating expenses of up to R$ 1,800,000.00 and maintenance costs of R$ 600,000.00 was estimated, in addition to a 25% reduction in operational unavailability. It was concluded that the proposed measures are viable, quick to implement, and capable of ensuring the integral processing of secondary biological sludge, strengthening the company’s ESG strategy and ensuring environmental compliance.

Keywords: Operational costs; Operational efficiency; ESG; Biological sludge; Sludge drying.

Data Science And Analytics For Operations

November 19, 2026

Polyp-YOLO: an efficient, low-latency detector for polyps in colonoscopies

The early detection of colorectal polyps is crucial for the prevention of colorectal cancer, and real-time computer-aided detection (CADe) systems have shown gains in endoscopic practice. The objective was to develop and validate a lightweight colorectal polyp detector, based on the YOLO architecture, capable of operating on restricted hardware with high precision and low latency. The methodology used public datasets of endoscopic images, partitioning the Kvasir-SEG dataset for training and internal validation, and CVC-ClinicDB and ETIS-Larib Polyp DB for cross-dataset evaluation. Lightweight variants of the YOLOv8, YOLO11, and YOLO26 families with 640×640 pixel input were evaluated. A grid search tested 70 combinations of optimizers and activation functions, and identified AdaBelief and LeakyReLU as the configuration with the best generalization. The optimization pipeline applied unstructured pruning, knowledge distillation, and fine-tuning. The optimized YOLO11n-seg model outperformed the higher-capacity architecture (YOLO26m-seg) in mAP50 and showed similar performance in F1-Score, operating with approximately seven times fewer parameters. It achieved an mAP50 of 0.7929 and an F1-Score of 0.7514 on the ETIS-Larib dataset, and fast inference was demonstrated in different formats, with real-time latencies. The explainability of predictions was validated by Grad-CAM activation maps. The proposed solution demonstrated itself to be a promising experimental tool for diagnostic support, with technical feasibility for integration into environments with reduced computational power, although it requires future clinical validation.

Keywords: Computer-aided detection; Edge computing; Hyperparameter optimization; Endoscopic image segmentation; Medical computer vision.

Data Science And Analytics For Operations

November 19, 2026

Multi-touch Attribution in E-commerce: A Comparison between Markov Chains and Last-Click

The research investigated Multi-touch Attribution (MTA) Models in e-commerce, seeking to overcome the limitations of the Last-Click model, widely used in the market. The objective was to compare the performance of first-order Markov Chains with Last-Click and Position-Based approaches, identifying the value of assistance channels frequently ignored. To this end, Markov Chain algorithms were applied to a large volume of purchase journey data from the Google Merchandise Store, extracted via BigQuery. The study probabilistically mapped the purchase journey and calculated the Removal Effect to quantify channel relevance. The results demonstrated that data-driven models identified the strategic role of discovery (awareness) and assistance channels, which Last-Click neglected in 65% of complex journeys. Simulated financial analysis indicated an approximate 28% hidden efficiency in Cost Per Acquisition (CPA) for Paid Search, compared to the Last-Click model. It was concluded that Markov Chains allowed for a more accurate mapping of purchase journeys, validating the technical feasibility of the modeling and providing evidence for more efficient budget allocation in digital media, mitigating the risk of early divestment in crucial channels.

Keywords: Assistance channels; Data science; E-commerce; Digital marketing; Media optimization.

Project Management

November 19, 2026

Integrated Software for Operational Communication and Control: Practical Evidence in a Medium-Sized Company

The study analyzed the impacts of the lack of integration between commercial and operational modules of an integrated management software (ERP/CRM) in a medium-sized company in the mechanical engineering sector. The main objective was to evaluate practical evidence of communication and operational control optimization, identify bottlenecks, and formulate improvement proposals. A qualitative-quantitative approach was adopted through a single case study with documentary research, based on the extraction and filtering of historical task records from the Bitrix24 software and statistical correlation analysis between workload and allocated team. Based on the diagnosis, an action plan structured in the 5W2H tool was developed. The results revealed that 54.4% of the registered tasks consisted of duplicate, test, or practically useless records, generated by manual insertion during the scope transition between commercial CRM and engineering. It was also demonstrated that the increase in the commercial team linearly accompanied the growth of inefficient tasks, polluting the database and masking the organization’s real productive capacity. It was concluded that the automation of workflows and native integration between modules are essential to mitigate operational and financial risks, providing replicable guidelines for data governance in small and medium-sized enterprises.

Keywords: System Customization; Enterprise Resource Planning (ERP); Task Management; Management Software.

Project Management

November 19, 2026

Supervised learning in voltammetric quantification with electrochemical sensors

The application of supervised learning in the voltammetric quantification of paraquat in artificial urine was evaluated. The study aimed to quantitatively assess the predictive performance of supervised learning models compared to a univariate “baseline”, preserving independence between devices in the training and testing sets. The research was conducted as an applied case study, processing data from four physical devices, each evaluated under a blank condition and six paraquat concentration levels, totaling 28 square wave voltammetry (SWV) curves. A computational “pipeline” integrated automated file reading, organization of curves into current-potential matrices, generation of potential maps, and device-specific blank correction. Five approaches were considered: conventional univariate calibration, predictive univariate “baseline”, partial least squares (PLS) regression, support vector regression (SVR), and random forest (RF). Predictive evaluation was performed using device-grouped cross-validation. PLS showed the best predictive performance for curves from a device not used in training, with an R² of 0.7981. RF exhibited intermediate performance, while SVR and the predictive univariate “baseline” showed inferior and similar performance between themselves. It was concluded that a compact multivariate representation of the voltammetric profile was more favorable for inter-device prediction than increasing model flexibility under the studied conditions. Grouped validation preserved independence, but the limited number of devices restricts the generalization of results.

Keywords: Supervised learning; Paraquat; PLS; Electrochemical sensors; Square wave voltammetry.

Project Management

November 19, 2026

Improvement of Inventory Management via Lean Six Sigma: Study in the Paper Industry

Organizations seek methodologies to reduce waste, increase efficiency, and become more competitive, promoting sustainable improvements in their processes. In this context, the study aimed to apply the Lean Six Sigma methodology, through the DMAIC cycle, to improve inventory management in a company in the paper industry manufacturing pneumatic hoses, aiming to increase the accuracy between physical and systemic inventories and improve the visual management of parts storage. The research was developed from the collection and analysis of data extracted from the company’s ERP system. Tools such as SIPOC, Ishikawa Diagram, and 5 Whys were used to define and identify the root cause of the problem. As improvement proposals, a Digital Kanban system and an adaptation of the Two-Bin system, called the Three-Bin System, were implemented, in addition to the development of standardized operating procedures and the establishment of control mechanisms. The results demonstrated a significant improvement in inventory accuracy, raising the lowest identified index from 28% to 80%, and detected discrepancies between systemic and physical records equivalent to R$ 134,335.53. It was concluded that the application of Lean Six Sigma, combined with Project Management, represented an effective approach for conducting operational improvement projects, contributed to increased reliability of inventory information, to the improvement of material control processes, and to the strengthening of the organization’s operational management.

Keywords: Inventory accuracy; DMAIC; Visual management.

Data Science And Analytics For Operations

November 19, 2026

Predictive Analysis Methodology for Performance Optimization in E-commerce: Correlation between Public Data and Paid Media

A predictive analysis methodology was developed for e-commerce, integrating transactional data and public search trends. The objective was to develop and validate a predictive model, based on machine learning algorithms, capable of correlating organic search trends with sales performance and paid media costs in the Beauty and Health category of Brazilian e-commerce. The Brazilian E-Commerce Public Dataset by Olist and data from Google Trends were used, processed in Python with the Random Forest Regressor algorithm. A moderate inverse correlation (r = -0.43) with a seven-day lag was identified between organic search volume and purchase. Initial models, based solely on behavioral variables, presented insufficient metrics (R² = -0.47; MAE of R$ 2,120.54). The incorporation of microeconomic (average ticket and shipping) and macroeconomic (exchange rate and Ibovespa index) variables raised the R² of the final model to 0.29, with an MAE of R$ 1,489.63, representing a 24.7% reduction in error compared to the baseline. Temporal cross-validation showed that, in periods of mature operation (2018), the model achieved an R² of 0.42. It was concluded that isolated search volume explains the moment of consumer interest, but not the financial magnitude of sales, making the fusion with transactional and economic data mandatory for predictive viability.

Keywords: Beauty and Health; Consumer Behavior; Google Trends; Machine Learning; Time Series.