Customer retention probability prediction method and device, storage medium, and computer device
Patent Information
- Application Number
- CN202610969894.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-30
- Publication Date
- 2026-09-18
AI Technical Summary
[0004]有鉴于此,本发明提供一种客户留存概率预测方法及装置、存储介质、计算机设备,主要目的在于现有方法基于静态数据进行预测,且模型更新周期长,导致客户留存预测准确性低的问题
本发明提供了一种客户留存概率预测方法及装置、存储介质、计算机设备,首先构建初始留存概率预测模型,并基于包含交叉熵损失项和自适应损失项的联合损失函数训练所述初始留存概率预测模型,得到完成训练的留存概率预测模型;响应于客户的留存概率预测指令,获取所述客户的客户属性数据和预设历史时段内的客户行为时序序列;对所述客户属性数据和所述客户行为时序序列分别进行特征工程处理,得到静态属性特征和时序特征序列;通过所述完成训练的留存概率预测模型,对所述时序特征序列依次进行时序特征提取和注意力权重学习,得到加权时序特征,并依据所述加权时序特征和所述静态属性特征的特征拼接结果预测所述客户的留存概率。与现有技术相比,本发明实施例通过基于包含交叉熵损失项和自适应损失项的联合损失函数训练留存概率预测模型,使模型在训练过程中自适应调节不同批次样本的损失贡献,缓解了数据特征分布不均或数据规律差异带来的偏差问题;同时,在推理阶段通过对客户静态属性与动态的时序行为序列分别进行特征工程处理,再经过时序特征提取和注意力权重学习,实现了动态与静态信息的深度融合,使模型能够自适应新的数据集,在针对不同客户的行为数据时,能够自适应聚焦于其最具预警价值的关键行为时段,从而提高客户留存预测准确性。
Smart Images

Figure CN122779907A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data analysis technology and can be applied to insurance and financial business scenarios. In particular, it relates to a method and device for predicting customer retention probability, a storage medium, and a computer device. Background Technology
[0002] Customer retention probability prediction refers to calculating the likelihood that a customer will continue to use products or services, renew their subscription, or remain active in the future, based on their historical data and through statistical analysis or machine learning models. This prediction task is one of the core issues in the field of customer relationship management (CRM) and is widely used in scenarios such as insurance renewal prediction, telecommunications churn warning, and financial product retention analysis. By quantifying customer retention tendencies, enterprises can take targeted intervention measures in advance before high-risk customers churn, thereby optimizing the allocation of operational resources, increasing customer lifetime value, reducing customer acquisition costs, and achieving a business transformation from passive response to proactive maintenance.
[0003] Currently, existing customer retention probability prediction methods primarily rely on logistic regression, decision trees, or simple random forest models. These models use historical policy data, customer profile data, and aggregated low-frequency behavioral data to predict customer retention potential. However, these methods utilize static data, lacking real-time updates. This results in features extracted from this data exhibiting time lags. Furthermore, these models can only capture historical patterns and cannot adapt to the characteristics exhibited by new data. They lack robustness to data with novel features during the inference phase, thus failing to adapt to sudden changes in customer behavior and leading to reduced accuracy in customer retention predictions. Summary of the Invention
[0004] In view of this, the present invention provides a customer retention probability prediction method and apparatus, storage medium and computer equipment. The main purpose is to address the problem that existing methods are based on static data for prediction and have long model update cycles, resulting in low accuracy in customer retention prediction.
[0005] According to one aspect of the present invention, a method for predicting customer retention probability is provided, comprising: An initial retention probability prediction model is constructed, and the initial retention probability prediction model is trained based on a joint loss function that includes a cross-entropy loss term and an adaptive loss term, to obtain a fully trained retention probability prediction model. In response to a customer retention probability prediction command, the system acquires the customer attribute data and a time sequence of customer behavior within a preset historical period. The customer attribute data and the customer behavior time series are respectively subjected to feature engineering processing to obtain static attribute features and time series feature sequences; The retention probability prediction model, once trained, is used to extract time-series features and learn attention weights sequentially from the time-series feature sequence to obtain weighted time-series features. The retention probability of the customer is then predicted based on the feature concatenation result of the weighted time-series features and the static attribute features.
[0006] According to another aspect of the present invention, a customer retention probability prediction device is provided, comprising: The model training module is used to construct an initial retention probability prediction model and train the initial retention probability prediction model based on a joint loss function that includes a cross-entropy loss term and an adaptive loss term, so as to obtain a fully trained retention probability prediction model. The acquisition module is used to acquire customer attribute data and customer behavior time sequence within a preset historical period in response to a customer retention probability prediction command. The feature processing module is used to perform feature engineering processing on the customer attribute data and the customer behavior time series to obtain static attribute features and time series feature sequences, respectively. The prediction module is used to extract time-series features and learn attention weights sequentially from the time-series feature sequence using the trained retention probability prediction model to obtain weighted time-series features, and predict the customer's retention probability based on the feature concatenation result of the weighted time-series features and the static attribute features.
[0007] According to another aspect of the present invention, a storage medium is provided, wherein at least one executable instruction is stored therein, the executable instruction causing a processor to perform an operation corresponding to the customer retention probability prediction method described above.
[0008] According to another aspect of the present invention, a computer device is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the above customer retention probability prediction method.
[0009] By employing the above-described technical solutions, the technical solutions provided by the embodiments of the present invention have at least the following advantages: This invention provides a customer retention probability prediction method, apparatus, storage medium, and computer equipment. First, an initial retention probability prediction model is constructed, and then trained based on a joint loss function including a cross-entropy loss term and an adaptive loss term to obtain a fully trained retention probability prediction model. In response to a customer's retention probability prediction command, customer attribute data and a time-series sequence of customer behavior within a preset historical period are acquired. Feature engineering processing is performed on the customer attribute data and the time-series sequence of customer behavior to obtain static attribute features and a time-series feature sequence. Using the fully trained retention probability prediction model, time-series feature extraction and attention weight learning are sequentially performed on the time-series feature sequence to obtain weighted time-series features. The customer's retention probability is then predicted based on the feature concatenation result of the weighted time-series features and the static attribute features. Compared with existing technologies, the embodiments of the present invention train a retention probability prediction model based on a joint loss function that includes a cross-entropy loss term and an adaptive loss term. This enables the model to adaptively adjust the loss contribution of different batches of samples during training, mitigating the bias problem caused by uneven distribution of data features or differences in data patterns. At the same time, in the inference stage, feature engineering is performed on the static attributes of customers and the dynamic time-series behavior sequences, and then time-series feature extraction and attention weight learning are carried out to achieve deep integration of dynamic and static information. This allows the model to adapt to new datasets and, when dealing with different customer behavior data, to adaptively focus on the key behavior periods with the most warning value, thereby improving the accuracy of customer retention prediction.
[0010] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0011] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 This invention provides a flowchart of a customer retention probability prediction method according to an embodiment of the present invention. Figure 2 A flowchart illustrating a training method for a retention probability prediction model provided in an embodiment of the present invention is shown. Figure 3 This diagram illustrates a structural block diagram of a retention probability prediction model provided by an embodiment of the present invention. Figure 4This diagram illustrates a multi-system collaboration scenario in an insurance business context, as provided by an embodiment of the present invention. Figure 5 This diagram illustrates a block diagram of a customer retention probability prediction device provided in an embodiment of the present invention. Figure 6 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention is shown. Detailed Implementation
[0012] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0013] This invention provides a method for predicting customer retention probability. The executing entity of this method can be a server of a user interaction system or a user maintenance system, or an independent server that communicates with both systems. The server type can be a local server or a cloud server; this invention does not impose specific limitations. The executing entity is equipped with a virtual device for executing the above method. When probability prediction is required, it retrieves customer attribute data and customer behavior data of the customer being predicted from the user interaction system, predicts the customer retention probability based on this data, and sends this retention probability to the business subsystem performing customer maintenance or retention operations as the basis for generating subsequent customer maintenance or retention strategies.
[0014] like Figure 1 As shown, the method includes steps 101-104: 101. Construct an initial retention probability prediction model, and train the initial retention probability prediction model based on a joint loss function that includes a cross-entropy loss term and an adaptive loss term, to obtain a fully trained retention probability prediction model.
[0015] In this embodiment of the invention, in order to predict customer retention probability, an initial retention probability prediction model built based on prediction requirements is pre-trained, so that subsequent customer retention probability prediction tasks can be performed based on the trained retention probability prediction model. The model structure of the trained retention probability prediction model is the same as that of the initial retention probability prediction model.
[0016] The loss function used for model training is a joint loss function, which includes at least a cross-entropy loss term and an adaptive loss term. The cross-entropy loss term calculates the model's prediction loss for training samples based on historical data, while the adaptive loss term calculates the model's prediction loss for training samples based on recent data. Historical data refers to data generated a considerable amount of time ago, while recent data refers to data generated more recently. By adding an adaptive loss term to the original cross-entropy loss term, the model can better reflect the changing trends of recent data, allowing it to adapt quickly. Furthermore, during the periodic fine-tuning training phase after the model goes live, other terms in the joint loss function can be locked, and the model can be fine-tuned only based on the adaptive loss term. This fine-tuning method improves the model's adaptability while reducing the time and resource costs of fine-tuning training, making short-cycle update training possible.
[0017] In one embodiment of the present invention, for further illustration and limitation, such as Figure 2 As shown, the training process of the initial retention probability prediction model includes: 201. Construct a training sample set based on the historical behavior data of customers with different attributes, and divide the training sample set into multiple batches of training sample subsets according to customer attributes. Divide each batch of training sample subsets into a historical data subset and a recent data subset.
[0018] 202. Based on the joint loss function, the initial retention probability prediction model is iteratively trained batch by batch using multiple batches of training sample subsets until the model converges, thus obtaining the completed retention probability prediction model.
[0019] The training process for any batch of training sample subsets includes: For the aforementioned historical data subset, the initial retention probability prediction model is used to predict each historical data sample in the historical data subset. The adaptive term in the joint loss function is frozen, and the first loss between the predicted output of the historical data sample and the true label of the corresponding sample is calculated based on the frozen joint loss function. For the recent data subset, the initial retention probability prediction model is used to predict each recent data sample in the recent data subset, the cross-entropy loss term in the joint loss function is frozen, and the second loss between the predicted output of the recent data sample and the true label of the corresponding sample is calculated based on the frozen joint loss function. The joint loss of the training sample subset is calculated based on the first loss and the second loss, and the model parameters of the initial retention probability prediction model are updated by backpropagation based on the joint loss.
[0020] In this embodiment of the invention, the initially constructed training sample set includes customers with different attributes. After constructing the training sample set, it is further divided into multiple batches according to customer attributes, with each batch corresponding to customer behavior data of one attribute. For example, multiple batches can be divided according to the customer's age, with each five-year period as a range. Each batch is further divided into historical data subsets, such as behavior from one year ago, and recent data subsets, such as behavior from the last 30 days. That is, the recent data subset corresponds to the end of the historical time window, and the historical data subset corresponds to the time period within the historical time window excluding the end of the historical time window. During training, when training the initial retention probability prediction model, a batch-by-batch iterative update strategy is adopted: one batch of training samples is input in each round, and the gradient is calculated based on a joint loss function, and the model parameters are adjusted through backpropagation. After training all batches sequentially, if the joint loss value on the entire dataset no longer decreases significantly or reaches a preset number of rounds, the model is considered to have converged, and a retention probability prediction model that can integrate long-term and recent customer behavior and has stronger generalization ability is finally output. Among them, the cross-entropy loss term is used to measure the true label. (Whether a customer renews their policy, 1 indicates renewal, 0 indicates churn) and predicted probability The difference. Cross-entropy loss term. Represented as: .
[0021] Adaptive loss term Represented as: ;in, This indicates the most recent time window, such as a subset of new data from the past 7 days.
[0022] By optimizing the model parameters using the aforementioned joint loss function, a balance can be struck between long-term prediction error on historical subsets and short-term fitting accuracy on recent subsets. Furthermore, by dividing the training sample set according to customer attributes, the model can learn to adaptively adjust the weight of different customer attributes' behavioral habits in retention prediction. For example, based on the activity and stability of each batch of customer groups, the model can automatically learn and dynamically adjust the contribution weights of historical and recent data to retention prediction, thereby improving the model's adaptive ability to predict different customer attributes and ensuring the accuracy of retention probability prediction.
[0023] In one embodiment of the present invention, for further explanation and limitation, the joint loss of the training sample subset is calculated based on the first loss and the second loss, including: During the training process based on the training sample subset, the model weight matrix of the initial retention probability prediction model is extracted, and the model weight matrix is regularized to obtain the regularization term of the model weight matrix. Extract the attention weight vector of the training sample subset and calculate the similarity between the attention weight vector and the attention weight vector of the historical training batch to obtain the attention consistency loss; The first loss, the regularization term, the attention consistency loss, and the second loss are weighted and summed to obtain the joint loss of the training sample subset.
[0024] In this embodiment of the invention, the joint loss function includes, in addition to the cross-entropy loss term and the adaptive loss term, a regularization term, an attention consistency loss term, and the weights corresponding to each of the different loss terms. The classification loss weight parameters of the cross-entropy loss term... The weight λ, used to balance the importance of classification tasks, ranges from [0,1]. A default value of 0.7 indicates a greater emphasis on prediction accuracy. If the cost of false positives is high in the business scenario, this weight can be lowered to reduce false positives. The adaptive optimization weight λ of the adaptive loss term is used to dynamically adjust the model to adapt to new data, ranging from [0.01,0.1]. Its value is adjusted based on the online learning rate, with an optimal value of 0.02. The regularization weight β of the regularization term is used to control model complexity and prevent overfitting; its value ranges from [0.01,0.1]. Its value is determined through grid search, with an optimal value of 0.05. The attention loss weight γ of the attention consistency loss term is used to strengthen the temporal attention mechanism, ranging from [0.1,0.5]. A default value of 0.3 ensures the model focuses on key behavioral time points.
[0025] The joint loss function L can be expressed as: ; Where N represents the number of training samples, corresponding to the number of customers in the dataset. If there are 10,000 historical customer records, then N=10000. The regularization term is represented by the formula: Where W is the model weight matrix; The formula for the attention consistency loss term is: ;in, It is the attention weight vector of the i-th batch of data subset. These are reference weights, such as the average attention weight vector from historical training batches, used to improve attention stability. The joint loss function described above is optimized using gradient descent, preferably by minimizing L using the Adam optimizer.
[0026] The model weight matrix encompasses all trainable parameters in the model. The initial retention probability prediction model includes an input layer, a temporal feature extraction layer, an attention layer, a feature fusion layer, and an output layer. The input layer includes a static feature encoder, and the corresponding model weight matrix includes the weights of the static feature encoder, the projection weights of the attention layer, the weights of the temporal feature extraction layer, and the weights of the feature fusion layer. These weights are continuously adjusted during training based on the input of different customer batches with different attributes, enabling the model to adaptively change its dependence on long-term historical behavior and recent behavior for different groups such as customers with different habits and customers of different cooperative products, ultimately achieving more accurate retention prediction.
[0027] 102. In response to the customer retention probability prediction command, obtain the customer attribute data and the customer behavior time sequence within a preset historical period.
[0028] In this embodiment of the invention, upon receiving an instruction to predict the retention probability of a specific customer, the system first extracts two types of customer information from the database: one type is static attribute data, such as age, vehicle model, and policy type—fixed characteristics that do not change or change very slowly over time, constituting the customer's basic profile; the other type is dynamic time-series data, which is a record of various interactions the customer has had with the insurance company over a fixed period of time, such as the past 12 months. Examples include the number of customer service calls per week, the number of claims filed, and the frequency of app logins. This data is aggregated and organized weekly, such as 2 interactions in week 1, 1 interaction in week 2, and so on up to 0 interactions in week 52, forming a chronological sequence—the customer behavior time-series sequence. Combining these two types of data constitutes the complete input required for the model to make predictions. The customer retention probability prediction command can be triggered manually, according to a preset cycle, or based on a customer's churn risk behavior. For example, if a customer suddenly uninstalls the app, repeatedly calls customer service to complain, or fails to renew their policy within 30 days before its expiration, the latest data for that customer can be retrieved immediately to perform a retention probability prediction. The preset historical period can be six months or one year, and can be customized based on the application scenario requirements.
[0029] 103. Perform feature engineering processing on the customer attribute data and the customer behavior time series to obtain static attribute features and time series feature sequences.
[0030] In this embodiment of the invention, to improve the quality of the model input data, feature engineering is performed on customer attribute data and customer behavior time series before predictive processing based on the model. This extracts static features that characterize the inherent customer profile and time series feature sequences that highlight dynamic signals such as behavioral trends, periodicity, and abnormal fluctuations. For example, in the auto insurance scenario, original static attributes such as age, vehicle model, and policy type can be standardized, one-hot encoded, or embedded and mapped to transform them into standardized static attribute features, eliminating differences in units and semantic differences in category data. Simultaneously, for the customer behavior time series over the past 12 months, time series data such as weekly aggregated customer service call counts, claim counts, and APP login frequency are processed with missing value imputation (if interaction records are missing, they are filled with the average of customers of the same type), smoothing and denoising, sliding window statistics, or difference transformation to form a regular time series feature sequence with higher information gain. Through the above feature engineering processing, a clearer and more discriminative information foundation is provided for subsequent time series extraction and attention weighting, thereby significantly improving the accuracy and stability of the retention probability prediction model.
[0031] In one embodiment of the present invention, for further explanation and limitation, feature engineering processing is performed on the customer attribute data and the customer behavior time series to obtain static attribute features and time series feature sequences, including: Keyword extraction is performed on the customer attribute data from the dimensions of related products and customer characteristics to obtain static attribute features; The customer behavior time sequence is divided according to a preset time window, and the customer behavior features in each time window are extracted. By taking each window as a time point, the customer behavior characteristics corresponding to each time point are arranged in the order of occurrence to obtain the time-series feature sequence.
[0032] In this embodiment of the invention, for static attribute features, keywords are extracted and encoded from two perspectives: related product dimension (e.g., which types of insurance the customer has purchased, whether additional services have been added, and what type of vehicle is insured), and customer characteristic dimension (e.g., age, gender, and place of origin). Fields with the most informational value for retention prediction are selected. For temporal features, continuous behavior logs from past historical periods are divided into multiple time periods according to a preset time window, such as a week. Customer behavior features, including interaction frequency and operation type distribution, are extracted within each window. Then, using each window as a time point, the behavior features of these windows are arranged sequentially from oldest to most recent, forming a complete temporal feature sequence for subsequent models to capture the evolution of behavior over time.
[0033] Specifically, static attribute features include at least one of the following: customer age, gender, place of residence, associated product type, and product service recipient. Customer age reflects the customer's life cycle stage, and insurance needs and renewal intentions typically differ across age groups; gender can serve as an auxiliary dimension for judging risk preferences and consumption habits; place of residence implies regional economic levels and claim rates, which helps the model to make regional adjustments; associated product type refers to the specific combination of insurance products currently insured by the customer, such as comprehensive insurance, third-party insurance, or supplementary insurance, reflecting the customer's protection depth and consumption level; product service recipient distinguishes the service recipient of the product. For example, the insured object of the policy can be a vehicle or a person. If it is a vehicle, then transport vehicles, family cars, family SUVs, etc. are the service recipients; if it is a person, then the relationship between the insured and the policyholder is the service recipient, such as parents, children, or spouse.
[0034] Customer behavior characteristics include at least one of the following: interactive behavior characteristics, browsing behavior characteristics, and business operation behavior characteristics. Interactive behavior characteristics include the number of customer service calls and the frequency of online inquiries, reflecting customers' willingness to communicate proactively and their needs. Browsing behavior characteristics cover page browsing history on the APP or official website, the number of times product details are viewed, etc., reflecting customers' interests and price comparison tendencies. Business operation behavior characteristics involve actions such as policy changes, clicking on renewal reminders, and uploading documents, directly reflecting the depth of customer participation in the business process.
[0035] 104. Using the completed retention probability prediction model, extract time-series features and learn attention weights sequentially from the time-series feature sequence to obtain weighted time-series features, and predict the customer's retention probability based on the feature concatenation result of the weighted time-series features and the static attribute features.
[0036] In this embodiment of the invention, a retention probability prediction model extracts temporal features sequentially from a time-series feature sequence to capture the evolutionary trend of customer behavior over time. Then, an attention mechanism automatically learns the importance weights of each time step, highlighting the key behavioral periods most predictive of retention, thereby generating weighted temporal features. This weighted sequence is then concatenated and fused with static attribute features, allowing the model to simultaneously consider both fixed customer profile information and dynamic behavioral patterns, ultimately outputting the customer's retention probability. This process enables the model to adaptively focus on the most distinctive behavioral signals and time points with high churn risk for different customers, effectively improving the accuracy and interpretability of the prediction.
[0037] In one embodiment of the present invention, for further explanation and limitation, the temporal feature sequence is subjected to temporal feature extraction and attention weight learning sequentially to obtain weighted temporal features, including: The temporal feature sequence is extracted by the temporal feature extraction layer to obtain a hidden state sequence that encodes the historical behavior evolution pattern of the customer; The attention layer calculates the energy value of each hidden state in the hidden state sequence, and determines the attention weight of the feature corresponding to different time points based on the energy value. The behavioral features at corresponding time points in the hidden state sequence are weighted according to the attention weights to obtain weighted temporal features; Predicting the customer retention probability based on the feature fusion result of the weighted time-series features and the static attribute features includes: The weighted time-series features and the static attribute features are concatenated through the feature fusion layer to obtain a fused feature for each time point that includes both customer-inherent attributes and weighted behavioral features. The retention probability of the customer is obtained by classifying and predicting the fused features through the output layer.
[0038] In embodiments of the present invention, such as Figure 3 As shown, the completed retention probability prediction model includes an input layer, a temporal feature extraction layer, an attention layer, a feature fusion layer, and an output layer. Static attribute features and temporal feature sequences are input through the input layer. The temporal feature sequence is then processed by the temporal feature extraction layer to extract hidden state sequences. The attention layer then assigns weights to the features at different time points and performs weighted fusion (e.g., weighted averaging or weighted summation) to obtain weighted temporal features. Static attribute features are directly input into the feature fusion layer and concatenated with the weighted temporal features. The final concatenated fused features are used by the output layer to calculate the renewal probability, where the renewal probability for customer i is... Represented as: ; Where σ is the sigmoid function, These are the output layer weights. It's a bias. It is a feature of fusion.
[0039] In the above process, the temporal feature extraction layer encodes the customer's temporal feature sequence point by point, transforming the original behavioral features into a hidden state sequence containing evolutionary patterns. Subsequently, the attention layer calculates an energy value for each time point. The magnitude of the energy value is positively correlated with the criticality of the behavioral feature at that time point in retention assessment, quantifying the importance of the behavior at that moment for retention prediction. The attention weight for each time point is obtained by normalizing the energy value; that is, the magnitude of the attention weight is positively correlated with the criticality of the behavioral feature at that time point in retention assessment. A larger attention weight indicates that the corresponding time point is more critical to retention assessment. Finally, these weights are used to weight the features at corresponding times in the hidden state sequence, giving higher attention to key behavioral periods and effectively suppressing the influence of non-critical periods. This generates weighted temporal features focused on core risk signals, providing a more discriminative dynamic representation for subsequent fusion prediction.
[0040] Specifically, the input layer integrates an embedding layer to map discrete categorical features, such as vehicle model and policy type, into dense vectors, which are then concatenated with continuous features before being fed into the subsequent network. The temporal feature extraction layer uses a long short-term memory network or a gated recurrent unit to capture long-term dependencies in customer behavior sequences. The attention layer, based on an attention mechanism, focuses on key behavioral periods by calculating the weights at each time step. The feature fusion layer uses a fully connected layer to perform nonlinear transformations and interactions on the concatenated static and dynamic features. The output layer is a fully connected layer with a sigmoid activation function, which maps the fused features to retention probabilities between 0 and 1. For example, customer A's 52-week interaction sequence is first processed step-by-step by a Long Short-Term Memory network to output the hidden state of each week. Then, the attention layer calculates the energy value of each time step and finds that the energy value of the last 4 weeks increases significantly, with the corresponding attention weight reaching the highest of 0.35, which is determined to be a critical period of deterioration in behavior. The model splices and fuses the attention-weighted temporal features with the customer's static attribute features (35 years old, SUV, full insurance), and finally outputs a retention probability of only 0.25, that is, the possibility of renewal is low. Based on this, a warning explanation is given, indicating that the customer's interaction frequency dropped from 2 times per week to 0 times in the last 4 weeks, which is a high-risk churn signal. It is recommended to contact the customer immediately and provide exclusive offers to actively intervene and retain the customer.
[0041] In one embodiment of the present invention, for further explanation and limitation, determining the attention weights of features corresponding to different time points based on the energy value includes: The static attribute features are encoded by the static feature encoder to obtain a bias vector that reflects customer behavior preferences. The bias values corresponding to each time point in the bias vector are superimposed onto the energy values of the corresponding hidden states, and the attention weights at each time point in the hidden state sequence are obtained after normalization.
[0042] In this embodiment of the invention, in the model input layer, in addition to conventionally encoding static attribute features to generate static feature vectors, a dedicated static feature encoder is set up to map the customer's inherent attributes such as age, vehicle model, and policy type into a bias vector reflecting the customer's behavioral preferences. This bias vector is aligned with the length dimension of the time series, with each time point corresponding to a bias value. This value quantifies the intensity or sensitivity of the customer's natural behavioral tendency based on their inherent attributes within a specific time period. During the attention mechanism calculation process, the model first obtains the original energy value by linearly transforming the hidden states of each time point output by the Long Short-Term Memory network. Then, the bias value of the corresponding time point in the bias vector is superimposed on the energy value of that time point, which is equivalent to personalizing the original energy with the customer's static profile. For example, the bias value of a full-coverage customer may give them a higher attention weight under the same behavioral intensity, while the opposite is true for low-activity customers. After this bias superposition, the adjusted energy values of all time points are then subjected to Softmax normalization to finally obtain the attention weight of each time point. The above process enables the allocation of attention weights to no longer rely solely on the dynamic characteristics of the behavioral sequence itself, but also incorporates the prior bias brought about by the inherent attributes of customers, allowing the model to more accurately identify the key behavioral periods that are truly of warning significance for different types of customers.
[0043] In one embodiment of the present invention, for further explanation and limitation, the method further includes: In response to the model update command, new user behavior data within the latest historical time period is obtained, and new training samples are constructed using the new user behavior data; Based on the prediction error of the retention probability prediction model that has been trained, the adaptive loss term of the joint loss function is updated to obtain the updated joint loss function. The trained retention probability prediction model is fine-tuned based on the updated joint loss function, so as to perform subsequent retention probability prediction tasks based on the fine-tuned retention probability prediction model.
[0044] In this embodiment of the invention, upon receiving a model update instruction, the system first acquires the newly added user behavior data accumulated within the latest historical time period and processes it in the same way as the initial training samples to construct new training samples. Then, based on the already trained retention probability prediction model, the prediction error of the model on these new samples is calculated. The adaptive loss term in the joint loss function is dynamically adjusted according to the error magnitude. When the distribution of new data differs significantly from historical data, the weight of this term is automatically increased to drive the model to adapt quickly; otherwise, it remains stable to avoid overfitting. Finally, the original model is lightly fine-tuned based on the updated joint loss function. During training, other terms in the joint loss function are frozen, rather than being retrained from scratch. Through this process, the model can continuously track the dynamic evolution of customer behavior patterns while efficiently iterating while maintaining existing knowledge. This significantly improves the model's timeliness and prediction accuracy in long-term deployment, maintaining accurate judgment of the current customer retention status without frequent large-scale retraining.
[0045] like Figure 4 As shown, in the actual business scenarios of insurance companies, the business system server records and stores all customer behavior data in real time, such as customer service call records, APP login logs, claims application records, etc., as well as static attribute data such as customer age, policy type, and vehicle model. When it is necessary to assess the retention risk of a customer, the customer operation and maintenance subsystem server sends a retention probability prediction instruction to the server where the execution entity is located according to a preset cycle or triggered by churn risk behavior. The server where the execution entity is located then retrieves the latest data of the customer from the business system server, and after feature engineering and model inference, returns the generated retention probability prediction result to the customer operation and maintenance subsystem server. The customer operation and maintenance subsystem server automatically filters the list of customers with high churn risk based on the prediction score, and generates corresponding early warning prompts and retention suggestions for customer service personnel or the operations team to take proactive intervention actions, forming a complete business closed loop from data collection to prediction to action response.
[0046] Furthermore, as a response to the above Figure 1 The implementation of the method shown in this invention provides a customer retention probability prediction device, such as... Figure 5 As shown, the device includes: The model training module 31 is used to construct an initial retention probability prediction model and train the initial retention probability prediction model based on a joint loss function that includes a cross-entropy loss term and an adaptive loss term, so as to obtain a completed retention probability prediction model. The acquisition module 32 is used to acquire customer attribute data and customer behavior time sequence within a preset historical period in response to the customer retention probability prediction instruction. Feature processing module 33 is used to perform feature engineering processing on the customer attribute data and the customer behavior time series to obtain static attribute features and time series feature sequences respectively; The prediction module 34 is used to extract time-series features and learn attention weights sequentially from the time-series feature sequence through the trained retention probability prediction model to obtain weighted time-series features, and predict the customer's retention probability based on the feature concatenation result of the weighted time-series features and the static attribute features.
[0047] Further, the initial retention probability prediction model includes an input layer, a temporal feature extraction layer, an attention layer, a feature fusion layer, and an output layer, wherein the input layer includes a static feature encoder; the model training module 31 includes: The sample partitioning unit is used to construct a training sample set based on the historical behavior data of customers with different attributes, and to divide the training sample set into multiple batches of training sample subsets based on customer attributes. Each batch of training sample subset is further divided into a historical data subset and a recent data subset. The recent data subset corresponds to the last period of the historical time window, and the historical data subset corresponds to the period within the historical time window excluding the last period. The training unit is used to iteratively train the initial retention probability prediction model batch by batch using multiple batches of training sample subsets based on the joint loss function until the model converges, thus obtaining a fully trained retention probability prediction model. The joint loss function includes a cross-entropy loss term and an adaptive term. The training process for any batch of training sample subsets includes: for the historical data subset, using the initial retention probability prediction model to predict each historical data sample in the historical data subset, freezing the adaptive term in the joint loss function, and calculating a first loss between the predicted output of the historical data sample and the true label of the corresponding sample based on the frozen joint loss function; for the recent data subset, using the initial retention probability prediction model to predict each recent data sample in the recent data subset, freezing the cross-entropy loss term in the joint loss function, and calculating a second loss between the predicted output of the recent data sample and the true label of the corresponding sample based on the frozen joint loss function; calculating the joint loss of the training sample subset based on the first loss and the second loss, and updating the model parameters of the initial retention probability prediction model based on backpropagation of the joint loss.
[0048] Further, the training unit is specifically used to extract the model weight matrix of the initial retention probability prediction model during the training process based on the training sample subset, and to perform regularization calculation on the model weight matrix to obtain the regularization term of the model weight matrix, wherein the model weight matrix includes static feature encoder weights, attention layer projection weights, temporal feature extraction layer weights, and feature fusion layer weights. Extract the attention weight vector of the training sample subset and calculate the similarity between the attention weight vector and the attention weight vector of the historical training batch to obtain the attention consistency loss; The first loss, the regularization term, the attention consistency loss, and the second loss are weighted and summed to obtain the joint loss of the training sample subset.
[0049] Furthermore, the device also includes: The sample update module is used to respond to the model update command, obtain the new user behavior data in the latest historical time period, and construct new training samples through the new user behavior data; The loss function update module is used to update the adaptive loss term of the joint loss function based on the prediction error of the retention probability prediction model that has been trained for the newly added training samples, so as to obtain the updated joint loss function. The training module is updated to fine-tune the trained retention probability prediction model based on the updated joint loss function, so as to perform subsequent retention probability prediction tasks based on the fine-tuned retention probability prediction model.
[0050] Furthermore, the completed retention probability prediction model includes an input layer, a temporal feature extraction layer, an attention layer, a feature fusion layer, and an output layer; The prediction module 34 includes: The feature extraction unit is used to extract temporal features from the temporal feature sequence through the temporal feature extraction layer to obtain a hidden state sequence that encodes the historical behavior evolution pattern of the customer. The weight allocation unit is used to calculate the energy value of each hidden state in the hidden state sequence through the attention layer, and determine the attention weight of the feature corresponding to different time points based on the energy value, wherein the magnitude of the attention weight is positively correlated with the criticality of the behavioral feature at the corresponding time point to the retention judgment; The weighting unit is used to weight the behavioral features at corresponding time points in the hidden state sequence according to the attention weights to obtain weighted temporal features; The feature fusion unit concatenates the weighted temporal features and the static attribute features through the feature fusion layer to obtain fused features at each time point, including customer-inherent attributes and weighted behavioral features; The prediction unit is used to classify and predict the fused features through the output layer to obtain the customer's retention probability.
[0051] Furthermore, the weighted slicing unit is specifically used to encode the static attribute features through the static feature encoder to obtain a bias vector that reflects customer behavioral preferences; The bias values corresponding to each time point in the bias vector are superimposed on the energy values of the corresponding hidden states. After normalization, the attention weights of each time point in the hidden state sequence are obtained. The magnitude of the energy value is positively correlated with the criticality of the behavioral features at the corresponding time point in the retention judgment.
[0052] Furthermore, the feature processing module 33 includes: The keyword extraction unit is used to extract keywords from the customer attribute data from the dimensions of related products and customer characteristics to obtain static attribute features, wherein the static attribute features include at least one of customer age, gender, place of origin, related product type, and product service object; A window segmentation unit is used to segment the customer behavior time sequence according to a preset time window and extract customer behavior features in each time window, wherein the customer behavior features include at least one of interaction behavior features, browsing behavior features, and business operation behavior features. The sequence construction unit is used to arrange the customer behavior features corresponding to each time point in the order of occurrence, with each window as a time point, to obtain a time-series feature sequence.
[0053] According to one embodiment of the present invention, a storage medium is provided, the storage medium storing at least one executable instruction, the computer-executable instruction being able to execute the customer retention probability prediction method in any of the above method embodiments.
[0054] Figure 6 The diagram illustrates a structural schematic of a computer device according to an embodiment of the present invention. The specific embodiments of the present invention do not limit the specific implementation of the computer device.
[0055] like Figure 6 As shown, the computer device may include: a processor 402, a communications interface 404, a memory 406, and a communications bus 408.
[0056] The processor 402, communication interface 404, and memory 406 communicate with each other via communication bus 408.
[0057] Communication interface 404 is used to communicate with other network elements such as clients or other servers.
[0058] The processor 402 is used to execute program 410, which can specifically execute the relevant steps in the above-described customer retention probability prediction method embodiment.
[0059] Specifically, program 410 may include program code that includes computer operation instructions.
[0060] Processor 402 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The computer device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0061] Memory 406 is used to store program 410. Memory 406 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0062] Specifically, program 410 can be used to cause processor 402 to perform the following operations: An initial retention probability prediction model is constructed, and the initial retention probability prediction model is trained based on a joint loss function that includes a cross-entropy loss term and an adaptive loss term, to obtain a fully trained retention probability prediction model. In response to a customer retention probability prediction command, the system acquires the customer attribute data and a time sequence of customer behavior within a preset historical period. The customer attribute data and the customer behavior time series are respectively subjected to feature engineering processing to obtain static attribute features and time series feature sequences; The retention probability prediction model, once trained, is used to extract time-series features and learn attention weights sequentially from the time-series feature sequence to obtain weighted time-series features. The retention probability of the customer is then predicted based on the feature concatenation result of the weighted time-series features and the static attribute features.
[0063] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0064] It should be noted that any AI models, software tools, or components not belonging to this company appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application has been authorized (with the knowledge and consent) by the relevant parties or has been fully authorized by all parties, and the executing entity may obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.
[0065] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for predicting customer retention probability, characterized in that, include: An initial retention probability prediction model is constructed, and the initial retention probability prediction model is trained based on a joint loss function that includes a cross-entropy loss term and an adaptive loss term, to obtain a fully trained retention probability prediction model. In response to a customer retention probability prediction command, the system acquires the customer attribute data and a time sequence of customer behavior within a preset historical period. The customer attribute data and the customer behavior time series are respectively subjected to feature engineering processing to obtain static attribute features and time series feature sequences; The retention probability prediction model, once trained, is used to extract time-series features and learn attention weights sequentially from the time-series feature sequence to obtain weighted time-series features. The retention probability of the customer is then predicted based on the feature concatenation result of the weighted time-series features and the static attribute features.
2. The method according to claim 1, characterized in that, The initial retention probability prediction model includes an input layer, a temporal feature extraction layer, an attention layer, a feature fusion layer, and an output layer. The input layer includes a static feature encoder. The training process of the initial retention probability prediction model includes: A training sample set is constructed based on the historical behavior data of customers with different attributes, and the training sample set is divided into multiple batches of training sample subsets according to customer attributes. Each batch of training sample subset is divided into a historical data subset and a recent data subset. The recent data subset corresponds to the last period of the historical time window, and the historical data subset corresponds to the period within the historical time window excluding the last period. Based on the joint loss function, the initial retention probability prediction model is iteratively trained batch by batch using multiple batches of training sample subsets until the model converges, resulting in a fully trained retention probability prediction model. The joint loss function includes a cross-entropy loss term and an adaptive term. The training process for any batch of training sample subsets includes: For the aforementioned historical data subset, the initial retention probability prediction model is used to predict each historical data sample in the historical data subset. The adaptive term in the joint loss function is frozen, and the first loss between the predicted output of the historical data sample and the true label of the corresponding sample is calculated based on the frozen joint loss function. For the recent data subset, the initial retention probability prediction model is used to predict each recent data sample in the recent data subset, the cross-entropy loss term in the joint loss function is frozen, and the second loss between the predicted output of the recent data sample and the true label of the corresponding sample is calculated based on the frozen joint loss function. The joint loss of the training sample subset is calculated based on the first loss and the second loss, and the model parameters of the initial retention probability prediction model are updated by backpropagation based on the joint loss.
3. The method according to claim 2, characterized in that, Calculating the joint loss of the training sample subset based on the first loss and the second loss includes: During the training process based on the training sample subset, the model weight matrix of the initial retention probability prediction model is extracted, and the model weight matrix is regularized to obtain the regularization term of the model weight matrix. The model weight matrix includes the static feature encoder weight, the attention layer projection weight, the temporal feature extraction layer weight, and the feature fusion layer weight. Extract the attention weight vector of the training sample subset and calculate the similarity between the attention weight vector and the attention weight vector of the historical training batch to obtain the attention consistency loss; The first loss, the regularization term, the attention consistency loss, and the second loss are weighted and summed to obtain the joint loss of the training sample subset.
4. The method according to claim 3, characterized in that, The method further includes: In response to the model update command, new user behavior data within the latest historical time period is obtained, and new training samples are constructed using the new user behavior data; Based on the prediction error of the retention probability prediction model that has been trained, the adaptive loss term of the joint loss function is updated to obtain the updated joint loss function. The trained retention probability prediction model is fine-tuned based on the updated joint loss function, so as to perform subsequent retention probability prediction tasks based on the fine-tuned retention probability prediction model.
5. The method according to claim 1, characterized in that, The retention probability prediction model that has been trained includes an input layer, a temporal feature extraction layer, an attention layer, a feature fusion layer, and an output layer. The temporal feature sequence is sequentially subjected to temporal feature extraction and attention weight learning to obtain weighted temporal features, including: The temporal feature sequence is extracted by the temporal feature extraction layer to obtain a hidden state sequence that encodes the historical behavior evolution pattern of the customer; The attention layer calculates the energy value of each hidden state in the hidden state sequence and determines the attention weight of the feature corresponding to different time points based on the energy value. The magnitude of the attention weight is positively correlated with the criticality of the behavioral feature at the corresponding time point to the retention judgment. The behavioral features at corresponding time points in the hidden state sequence are weighted according to the attention weights to obtain weighted temporal features; Predicting the customer retention probability based on the feature fusion result of the weighted time-series features and the static attribute features includes: The weighted time-series features and the static attribute features are concatenated through the feature fusion layer to obtain a fused feature for each time point that includes both customer-inherent attributes and weighted behavioral features. The retention probability of the customer is obtained by classifying and predicting the fused features through the output layer.
6. The method according to claim 5, characterized in that, The retention probability prediction model that has been trained includes a static feature encoder in its input layer. Based on the energy value, the attention weights of the features corresponding to different time points are determined, including: The static attribute features are encoded by the static feature encoder to obtain a bias vector that reflects customer behavior preferences. The bias values corresponding to each time point in the bias vector are superimposed on the energy values of the corresponding hidden states. After normalization, the attention weights of each time point in the hidden state sequence are obtained. The magnitude of the energy value is positively correlated with the criticality of the behavioral features at the corresponding time point in the retention judgment.
7. The method according to any one of claims 1-6, characterized in that, Feature engineering is performed on the customer attribute data and the customer behavior time series to obtain static attribute features and time series feature sequences, including: Keyword extraction is performed on the customer attribute data from the dimensions of related products and customer characteristics to obtain static attribute features, wherein the static attribute features include at least one of customer age, gender, place of origin, related product type, and product service target; The customer behavior time sequence is divided according to a preset time window, and the customer behavior features in each time window are extracted. The customer behavior features include at least one of the following: interaction behavior features, browsing behavior features, and business operation behavior features. By taking each window as a time point, the customer behavior characteristics corresponding to each time point are arranged in the order of occurrence to obtain the time-series feature sequence.
8. A customer retention probability prediction device, characterized in that, include: The model training module is used to construct an initial retention probability prediction model and train the initial retention probability prediction model based on a joint loss function that includes a cross-entropy loss term and an adaptive loss term, so as to obtain a fully trained retention probability prediction model. The acquisition module is used to acquire customer attribute data and customer behavior time sequence within a preset historical period in response to a customer retention probability prediction command. The feature processing module is used to perform feature engineering processing on the customer attribute data and the customer behavior time series to obtain static attribute features and time series feature sequences, respectively. The prediction module is used to extract time-series features and learn attention weights sequentially from the time-series feature sequence using the trained retention probability prediction model to obtain weighted time-series features, and predict the customer's retention probability based on the feature concatenation result of the weighted time-series features and the static attribute features.
9. A storage medium, characterized in that, The storage medium stores at least one executable instruction that causes the processor to perform the operation corresponding to the customer retention probability prediction method as described in any one of claims 1-7.
10. A computer device, characterized in that, include: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction that causes the processor to perform the operation corresponding to the customer retention probability prediction method as described in any one of claims 1-7.