October 26, 2026
Repurchase prediction and churn analysis in marketplaces: a survival analysis-based approach
Rafael Rodrigues de Siqueira; Edilson José Rodrigues
DOI: 10.22167/2675-6528-202603377
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
Customer churn represents a significant challenge for e-commerce platforms, particularly in environments with high turnover and low purchase recurrence. This work analyzed the repurchase behavior of customers from the Olist marketplace, with the objective of understanding the temporal dynamics of churn and evaluating the adequacy of analytical approaches for its modeling. Public data from the Olist marketplace were used to build an analytical dataset of 44,034 customers, with a fixed cutoff date to ensure temporal consistency. Repurchase was defined as a temporal event and treated with right censoring. Exploratory survival analysis was performed via the Kaplan-Meier estimator and Cox Proportional Hazards modeling, incorporating behavioral variables such as number of purchases, recency, and customer lifetime. Complementarily, binary classification by Decision Tree was explored to evaluate its limitations. The results indicated that 98.44% of customers did not make an observable repurchase, characterizing churn as a temporal and highly censored phenomenon. The probability of repurchase became residual after 230-240 days from the last purchase, establishing a threshold for definitive inactivity. The Cox Proportional Hazards model confirmed that the number of purchases, recency, and customer lifetime were statistically relevant behavioral variables. The complementary analysis by binary classification highlighted the limitations of this approach in temporal and censored contexts, losing relevant information. It was concluded that survival analysis constitutes a methodologically more adequate approach for the study of churn in e-commerce environments with low recurrence, providing consistent subsidies for understanding customer behavior and for management decisions based on time and risk.
Keywords: Survival analysis; Customer churn; E-commerce; Temporal modeling; Repurchase.
1. Introduction
Direct marketing has established itself as a relevant strategy for personalized communication between companies and consumers, especially in digital environments. Unlike traditional mass communication approaches, direct marketing seeks more targeted interactions, based on the characteristics, behaviors, and preferences of the target audience, with the aim of increasing the effectiveness of actions and strengthening customer relationships (KOTLER; KELLER, 2016). With the advancement of digital technologies, its application has become common in channels such as email marketing, social networks, e-commerce platforms, and Customer Relationship Management (CRM) systems.
In this context, customer segmentation plays a central role, as it allows grouping consumers with similar characteristics and enabling more personalized marketing actions. Personalization, which was previously seen as a competitive advantage, has become a market requirement, especially given the increase in competition and the excess of information to which consumers are exposed (KOTLER; KARTAJAYA; SETIAWAN, 2017). Nevertheless, direct marketing faces relevant challenges, such as the increase in customer acquisition costs, the saturation of digital channels, and the reduction in response rates, which reinforces the need for more efficient and data-driven strategies (WEDEL; KANNAN, 2016).
The wide availability of data from digital interactions, commercial transactions, and corporate systems has driven the use of Data Science in marketing. The use of these bases to understand and manage customer relationships has become a central element of data-driven marketing strategies and Customer Relationship Management (CRM) (BLATTBERG; KIM; NESLIN, 2008). The analysis of this data allows for the identification of consumer behavior patterns and supports more informed decisions, reducing reliance on purely intuitive approaches (DAVENPORT; HARRIS, 2007). In this scenario, machine learning techniques have come to be employed as tools to model future customer behaviors, including the probability of repurchase and churn.
Among the various problems addressed by data-driven marketing, customer retention stands out as one of the most critical, as maintaining long-term relationships is directly associated with value generation for the company throughout the customer lifecycle (KUMAR; REINARTZ, 2016). Churn, understood as the interruption of the customer relationship with the company, represents a significant loss of value, especially in highly competitive environments, such as digital marketplaces. However, churn is inherently a temporal phenomenon, as it is directly associated with the time elapsed since the customer’s last interaction or purchase.
Recent studies indicate that approaches that treat churn in a purely binary manner tend to oversimplify this phenomenon, especially in contexts characterized by high censoring and low purchase recurrence (MATUSZELAŃSKI; KOPCZEWSKA, 2022; SHAHABIKARGAR et al., 2025). In these scenarios, methods capable of explicitly incorporating the temporal dimension prove more suitable for understanding the dynamics of repurchase and abandonment, allowing for the analysis of not only whether churn occurs, but when it tends to occur. Survival analysis models thus present themselves as a consistent methodological alternative for dealing with temporal phenomena associated with customer behavior, by allowing the simultaneous incorporation of time until the event and the presence of censoring in the data. This approach enables the identification of relevant temporal patterns and provides more informative subsidies for the formulation of customer retention and reactivation strategies.
Additionally, binary classification models, widely used in the context of churn due to their simplicity and interpretability — such as Decision Trees — can be explored complementarily for comparative and illustrative purposes (QUINLAN, 1986; LEE et al., 2019). Although these techniques facilitate the understanding of factors associated with abandonment, the literature emphasizes that their application to strongly temporal phenomena should be interpreted with caution, as the binarization of the event may imply a loss of relevant information about customer behavior dynamics (PENG et al., 2023).
Given this context, the present work seeks to answer the following research question: how can the time to repurchase be modeled in a digital marketplace characterized by high censorship, and what are the limitations of binary approaches in churn analysis? To this end, a public e-commerce database is used, applying survival analysis techniques as the central axis of the investigation, with the incorporation of classification models only as a complementary analysis. The objective is to contribute to the understanding of repurchase behavior in digital environments and to support managerial decisions related to customer retention, combining analytical rigor, interpretability, and practical relevance.
2. Material and Methods
This research was characterized as applied, quantitative in nature, with a case study design. The central objective was to analyze repurchase behavior and customer churn in a digital marketplace, focusing on the temporal dimension of the phenomenon. For this purpose, a methodological approach was used that combined survival analysis and classification techniques.
The data used in this study were extracted from the Olist Brazilian E-commerce Dataset, a public dataset made available on the Kaggle platform. This dataset contains anonymized information about orders, customers, and transactions made on the Olist platform, which allowed for the reconstruction of customer purchase history over time for the proposed analysis.
The unit of analysis defined for the study was the customer, identified by a unique identifier persistent across multiple purchases. All relevant behavioral metrics were aggregated at this level, ensuring that the analysis reflected the individual customer’s behavior on the platform. The final analytical base was composed of 44,034 unique customers.
The construction of the analytical base involved the integration of customer and order tables, with rigorous attention to the temporal consistency of the records. A fixed cut-off date was established on January 1, 2018. This measure ensured that all explanatory variables were constructed exclusively from information prior to this date, preventing future information leakage (data leakage).
Post-cutoff events were used solely for repurchase observation. From the customers’ pre-cutoff history, basic behavioral variables were constructed, including the number of purchases made, the recency of the last purchase, and the customer’s lifetime since the first purchase. These variables represented different dimensions of the customer relationship with the platform.
The event of interest, repurchase, was defined as the occurrence of a new purchase after the cutoff date. Customers who did not make a new purchase by the end of the observation period were considered right-censored. This approach preserved the available partial information, avoiding the arbitrary definition of churn and treating it as a temporal phenomenon.
Exploratory survival analysis was conducted using the non-parametric Kaplan-Meier estimator (KAPLAN; MEIER, 1958). The observed time was the interval between the cutoff date and the occurrence of repurchase or censoring. This step allowed for the identification of the aggregate behavior of the non-repurchase probability over time and provided subsidies for the identification of a temporal threshold of definitive inactivity.
For the modeling of repurchase risk over time, the Cox Proportional Hazards model (COX, 1972) was used. This model evaluated the effect of behavioral variables on the time until the event. Two specifications were tested: Model 1, with number of purchases and recency, and Model 2, which added the customer’s lifetime. Model 2 was adopted as the final specification, based on criteria of numerical stability, statistical significance, and goodness of fit.
As a complementary analysis, the application of a Decision Tree model for binary churn classification was explored. The operational definition of churn for this stage was based on the temporal threshold identified in the survival analysis. The objective was to evaluate the practical limits of classification approaches facing a temporal and highly censored phenomenon (QUINLAN, 1986; LEE et al., 2019; WANG et al., 2023). The decision tree was employed for exploratory and interpretive purposes, without constituting the central axis of the modeling.
Regarding ethical considerations, the study was conducted based on public and anonymized secondary data, made available on the Kaggle platform. There was no direct collection of information from participants, nor the use of personally identifiable data. Therefore, the research is in compliance with good practices for data usage in academic studies and did not require submission to the Research Ethics Committee.
3. Results and Discussion
This section details the results obtained from the analysis of customer repurchase behavior in the Olist marketplace, using public platform data. The main focus of this stage was to deepen the understanding of churn’s temporal dynamics, validate the adopted methodological decisions, and evaluate the adequacy of the analytical approaches employed, especially survival analysis, compared to binary classification methods. The findings provide a comprehensive view of the nature of churn in e-commerce environments with low recurrence, highlighting the importance of the temporal dimension for an accurate interpretation of the phenomenon.
Construction of the analytical base and unit of analysis
The central unit of analysis for this study was the customer, uniquely identified by the variable `customer_unique_id`, which allowed for the tracking of their purchasing behavior over time. The analytical base was carefully constructed from the aggregation of order history by customer, using exclusively information available up to the cutoff date of 01/01/2018. This temporal delimitation was crucial to avoid leakage of future information, ensuring that the explanatory variables were based solely on data prior to the event of interest.
The choice of the cutoff date of 01/01/2018 was strategic, seeking a balance between the need to preserve a representative volume of customers with purchase history and the availability of an adequate time window for observing repurchases. Additionally, this date was selected to mitigate possible seasonal effects, often concentrated at the end of the year, which contributes to greater stability in the analysis of time until repurchase. Purchases made before this date were used to build the explanatory variables, while purchases made after this date served only to observe the repurchase event, ensuring the methodological rigor of the research.
Quantitative characterization of the customer base
The final analytical base comprised a total of 44,034 unique customers. The descriptive analysis revealed that the average number of purchases per customer was 1.03, with a median of 1, indicating a strong concentration of customers who made only a single purchase. The maximum number of purchases observed for a customer was 10, with a standard deviation of 0.20, which reinforces the low variability in the purchase distribution, despite the presence of some customers with more transactions.
Regarding temporal aspects, the average recency of the last purchase was 139.6 days, with a median of 124 days. The average customer lifetime, since the first purchase, was 140.9 days, reaching a maximum of 483 days. These quantitative data corroborate the observation that the majority of customers in the Olist marketplace fit the profile of “long tail of one-time buyers”, a phenomenon widely recognized in e-commerce literature, where purchase recurrence is low and the customer base is dominated by one-time buyers.
The distribution of the number of purchases per customer showed that 97.13% of customers (42,770 individuals) made only one purchase. A significantly smaller portion, 2.64% (1,164 customers), made two purchases. Customers with three purchases represented 0.18% (80 individuals), and the proportions decreased drastically for four, five, six, and ten purchases, which were 0.03%, 0.01%, 0.00%, and 0.00%, respectively. This concentration of customers with a single purchase is a determining factor for churn dynamics in this context.
Definition of the repurchase event and censorship
The event of interest for the analysis was defined as the occurrence of at least one repurchase by the customer after the established cutoff date. Customers who did not make any new purchases by the end of the observation period were classified as right-censored. This approach allows for the preservation of partial information available on customer lifetime, avoiding an arbitrary and premature definition of churn, which could distort the analysis in a context of low recurrence.
Of the total 44,034 customers analyzed, only 687 (equivalent to 1.56%) made an observable repurchase within the defined time window. In contrast, 43,347 customers (corresponding to 98.44% of the base) were classified as censored, meaning they did not make a new purchase by the end of the observation period. This high level of censoring is a crucial finding, as it demonstrates that churn, in this specific context, cannot be adequately modeled as a simple binary variable.
The predominance of censored customers and the low repurchase rate observed indicate that, in the Olist marketplace, repurchase is not the predominant behavior. Single purchases are established as the norm for the vast majority of customers. This pattern is consistent with the structure of generalist marketplaces, where many consumers make one-off purchases without necessarily developing a recurring relationship with the platform. This characteristic of customer behavior reinforces the need for analytical approaches that consider the temporal dimension and data censoring.
Survival Analysis – Kaplan-Meier Estimator
Survival analysis was initiated with the non-parametric Kaplan-Meier estimator, a robust tool for handling censored data (KAPLAN; MEIER, 1958). The observed time was defined as the interval between the cutoff date and the repurchase event or censoring. The resulting survival curve revealed that most repurchases occur within the first 30 to 60 days after the customer’s last purchase, indicating a critical period for retention.
After this initial period, the repurchase rate showed a progressive reduction. The probability curve of non-repurchase, which initially presented a sharp drop, became practically flat from approximately 230 to 240 days since the last purchase. This stabilization of the curve suggests that the probability of repurchase after this time interval becomes residual, approaching zero. This finding is fundamental, as it provides empirical evidence for the identification of a temporal threshold that can be associated with the definitive inactivity of the customer, characterizing churn.
Survival curves by customer profile
To deepen the understanding of repurchase dynamics, survival curves were estimated based on customer purchase history. The analysis differentiated between customers who made only one purchase and those who made two or more purchases. It was observed that customers with a single purchase showed a faster decline in the survival curve, indicating a lower propensity for repurchase over time.
In contrast, customers with two or more purchases maintained a significantly higher repurchase probability for a more extended period. Despite this initial difference in dynamics, both survival curves, for both one-purchase customers and those with multiple purchases, tended to stabilize within the same time frame, approximately 230 days. This convergence reinforces the existence of a common temporal limit for definitive churn, regardless of the customer’s initial purchase history.
Proportional Hazards Cox Modeling
In the modeling stage, the risk of repurchase over time was analyzed using the Cox Proportional Hazards model (COX, 1972). The basic behavioral variables incorporated into the model were the number of purchases (`n_compras`), the recency of the last purchase (`recencia`), and the customer’s lifetime (`tempo_vida`). The modeling results indicated that all these variables showed statistical significance, with p-values below 0.005, confirming their relevance in explaining the repurchase risk.
For the `n_compras` variable, the estimated coefficient was approximately 0.54, resulting in a Hazard Ratio of approximately 1.72. This means that each additional purchase increases the instantaneous risk of repurchase by about 72%. The `recencia` variable showed a coefficient of approximately -0.01 and a Hazard Ratio of approximately 0.99, indicating that the longer the time elapsed since the last purchase, the lower the probability of repurchase. In turn, the `tempo_vida` variable had a coefficient of approximately 0.01 and a Hazard Ratio of approximately 1.01, suggesting that customers with a longer history on the platform show a greater propensity for repurchase.
The Cox Proportional Hazards model presented a concordance index (C-index) of approximately 0.55. This value is considered compatible with empirical churn studies in highly censored databases, especially when the censoring rate exceeds 95%. In these scenarios, the model’s discriminative capacity is naturally limited by the scarcity of observed events, which directs the interpretation of the results towards the significance and direction of the estimated coefficients, rather than the individual predictive power of the model (MATUSZELAŃSKI; KOPCZEWSKA, 2022).
It is important to emphasize that, in this context, the main objective of the model was not to maximize individual predictive capacity, but rather to understand the structure of factors associated with the time until repurchase. The relevance of the Cox model, therefore, lies in the interpretation of the effects of behavioral variables and in the identification of aggregated temporal patterns, providing insights into customer relationship dynamics, rather than focusing on individual customer classification as churn or non-churn.
Feature engineering tests and parsimonious model
Additional feature engineering tests were performed, incorporating derived variables such as purchase frequency and recency-based engagement metrics. However, these tests did not result in statistically significant gains or an improvement in the overall model fit. It was found that these additional variables exhibited high collinearity with the basic behavioral variables already included, rendering them redundant in terms of information.
Given these results, a parsimonious final model was chosen, keeping only the variables `n_purchases`, `recency`, and `lifetime_value`. This choice prioritized the model’s interpretability and robustness, avoiding the introduction of unnecessary complexity that did not add significant predictive or explanatory value. Model 2, with these three variables, demonstrated the minimum level of complexity required for a stable, interpretable, and statistically adequate modeling of the analyzed phenomenon.
These findings are in line with the literature, which suggests that simple and temporally consistent behavioral variables are often sufficient to capture the main signal associated with repurchase. The indiscriminate inclusion of new variables can introduce redundancy and instability in the models (HAN; KAMBER; PEI, 2011; SHAHABIKARGAR et al., 2025). Thus, survival analysis is consolidated as the central axis of this work, showing that understanding the moment when churn occurs is more informative than merely identifying its occurrence, especially in contexts of censored data and short consumption trajectories.
Final model diagnosis
Diagnostic tests were conducted to assess the adequacy of the Cox Proportional Hazards model. The results indicated that the proportional hazards assumption was met for all variables included in the final model, with no statistically significant violations observed. This verification is crucial for the validity of the inferences drawn from the model, ensuring that the effects of covariates on the repurchase risk remain constant over time.
Furthermore, Martingale and Deviance residuals were analyzed to assess the model’s goodness of fit. The Martingale residuals did not reveal systematic patterns that could indicate a clear inadequacy in the functional form of the covariates, although some outlier occurrences were noted. Similarly, the Deviance residuals pointed to the presence of isolated observations with greater deviation from the expected fit, but without configuring a generalized pattern of model inadequacy, reinforcing the model robustness.
Complementary analysis by binary classification
As a complementary analysis, the application of a Decision Tree model for binary churn classification was explored. This approach used the operational definition of churn established from the temporal threshold identified in the survival analysis. Supervised classification models are commonly employed in churn prediction problems in various business contexts, using tree-based algorithms and ensemble methods to identify patterns associated with customer attrition (WANG et al., 2023).
Although the Decision Tree offers interpretative advantages, the results showed significant limitations, mainly due to the high class imbalance and the loss of the temporal dimension inherent to the phenomenon. The model’s overall accuracy was 0.8748, a value that, although seemingly high, should be interpreted with caution due to the strong class imbalance, where the majority of customers did not churn. In these scenarios, accuracy tends to overestimate the model’s actual performance.
The specific metrics for the minority class (churn = 1) indicated good performance in terms of precision (0.9865) and recall (0.885), resulting in an F1-score of 0.933. However, the AUC-ROC value of 0.5736 revealed a low global discriminative capacity, suggesting that the model has limitations in adequately ranking customers by churn risk. The tree depth was 4, with 8 leaves, and the validation strategy used was stratified holdout (70/30).
These results reinforce that, although binary modeling allows for the operationalization of prediction, it loses the temporal dimension of the phenomenon, reducing its analytical capacity compared to the survival analysis approach. While the latter allows estimating risk over time and explicitly incorporating censoring, the binary approach reduces the problem to a static distinction between churn and non-churn, potentially hiding relevant patterns related to the timing of abandonment. Thus, the comparison reinforces the methodological adequacy of temporal modeling as the central axis of this study.
In summary, the results obtained indicate that churn in the Olist marketplace is an essentially temporal phenomenon, characterized by high censorship and a strong concentration of customers with only one purchase. Survival analysis, through the Kaplan-Meier estimator, demonstrated that the probability of repurchase becomes residual after 230-240 days from the last purchase, providing an empirical threshold for definitive inactivity. The Cox Proportional Hazards model confirmed the statistical relevance of variables such as number of purchases, recency, and customer lifetime, while the complementary analysis by binary classification highlighted the limitations of static approaches in temporal and highly censored contexts, reinforcing the superiority of survival analysis for a more precise understanding of repurchase behavior.
4. Conclusion
This study investigated the modeling of time to repurchase in a digital marketplace characterized by high censoring, as well as the limitations of binary approaches in churn analysis. It was found that churn is essentially a temporal and highly censored phenomenon, with 98.44% of customers not making an observable repurchase. Survival analysis, using the Kaplan-Meier estimator, revealed that the probability of repurchase becomes residual after approximately 230 to 240 days from the last purchase, establishing an empirical threshold for definitive customer inactivity. The Cox Proportional Hazards modeling confirmed the statistical significance of behavioral variables such as the number of purchases, recency of the last purchase, and customer lifetime, indicating that each additional purchase increases the risk of repurchase, while greater recency decreases it, and a longer platform history increases the propensity to repurchase. Complementary binary classification analysis, using a Decision Tree, highlighted the limitations of this approach in temporal and censored contexts, mainly due to the loss of the temporal dimension and class imbalance, resulting in low global discriminative capacity.
The main contribution of this work lies in demonstrating that survival analysis constitutes a methodologically more adequate approach for studying churn in e-commerce environments with low recurrence. This methodology offers more consistent subsidies for understanding the temporal dynamics of customer behavior and for making time- and risk-based managerial decisions, allowing for the identification of a critical time interval for customer reactivation and the formulation of more effective retention strategies. However, the study has limitations, such as the use of a database from a specific marketplace, which may restrict the generalization of the findings. Furthermore, the modeling did not include more detailed behavioral variables, such as digital engagement metrics or customer satisfaction, and the model’s concordance index, although statistically consistent, showed moderate individual predictive capacity due to the high data censoring. For future studies, it is suggested to incorporate probabilistic customer behavior models, such as BG/NBD models, the use of time-dependent covariates, and comparison with proprietary databases containing richer interaction and engagement variables, aiming to broaden the analytical scope and deepen the understanding of the phenomenon.
Bibliographic References
BLATTBERG, R. C.; KIM, B. D.; NESLIN, S. A. Database marketing: analyzing and managing customers. New York: Springer, 2008.
COX, D. R. Regression models and life-tables. Journal of the Royal Statistical Society: Series B, v. 34, n. 2, p. 187–220, 1972.
DAVENPORT, T. H.; HARRIS, J. G. Competing on analytics: the new science of winning. Boston: Harvard Business School Press, 2007.
HAN, J.; KAMBER, M.; PEI, J. Data mining: concepts and techniques. 3. ed. Waltham, MA: Elsevier, 2011.
KAPLAN, E. L.; MEIER, P. Nonparametric estimation from incomplete observations. Journal of the American Statistical Association, v. 53, n. 282, p. 457–481, 1958.
KOTLER, P.; KARTAJAYA, H.; SETIAWAN, I. Marketing 4.0: do tradicional ao digital. Rio de Janeiro: Sextante, 2017.
KOTLER, P.; KELLER, K. L. Administração de marketing. São Paulo: Pearson Education, 2016.
KUMAR, V.; REINARTZ, W. Creating enduring customer value. Journal of Marketing, v. 80, n. 6, p. 36-68, 2016.
LEE, K. M.; NG, L. C.; ZAINOL, Z.; CHAN, J. C. Decision tree: customer churn analysis for a loyalty program using data mining algorithm. In: INTERNATIONAL CONFERENCE ON DATA SCIENCE AND BUSINESS ANALYTICS, 2019. Proceedings […], 2019.
MATUSZELAŃSKI, P.; KOPCZEWSKA, K. Customer churn in retail e-commerce business: spatial and machine learning approach. Journal of Theoretical and Applied Electronic Commerce Research, v. 17, n. 1, p. 1–24, 2022. DOI: 10.3390/jtaer17010009.
PENG, X.; ZHOU, T.; LIU, Y. Research on customer churn prediction and model interpretability analysis. PLOS ONE, v. 18, n. 7, p. e0289724, 2023. DOI: 10.1371/journal.pone.0289724.
QUINLAN, J. R. Induction of decision trees. Machine Learning, v. 1, n. 1, p. 81–106, 1986.
SHAHABIKARGAR, F. et al. A comprehensive survey on customer churn analysis studies. Journal of Decision Systems, v. 34, n. 1, p. 1–20, 2025. DOI: 10.1080/24751839.2025.2528440.
WANG, L.; LI, X.; ZHAO, J. Customer churn prediction based on the decision tree and random forest model. International Journal of Advanced Computer Science and Applications, v. 14, n. 2, p. 10–18, 2023.
WEDEL, M.; KANNAN, P. K. Marketing analytics for data-rich environments. Journal of Marketing, v. 80, n. 6, p. 97-121, 2016.
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