Customer type determination method and device, electronic equipment and storage medium
Through the improved support vector machine model and random sampling method, the problem of poor accuracy in customer churn prediction is solved, and the prediction accuracy and model interpretability of customer types are improved.
Patent Information
- Application Number
- CN202310993042.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-08
- Publication Date
- 2025-02-18
AI Technical Summary
The prior art has poor accuracy in churn prediction, especially in dealing with data imbalance, feature selection, and model interpretability.
By obtaining historical data sets, using preset sampling strategies for data sampling, filtering out the target data set, and using improved support vector machine models for training, combining random sampling method to process data imbalance to improve the accuracy of customer type prediction .
It improves the accuracy of customer type prediction, enhances the model's prediction ability for churn customers, improves data imbalance problem, and provides better model interpretability.
Smart Images

Figure CN119477390A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a method for determining a customer type, a device thereof, an electronic device and a storage medium. Background Art
[0002] Customer churn refers to the behavior of customers stopping using the services of a financial institution or transferring to other financial institutions, which has a significant impact on financial institutions. Customer churn may lead to business losses, a decrease in customers, and a decline in competitiveness. Therefore, financial institutions hope to accurately predict customer churn so that they can take appropriate measures to retain customers, improve service quality, and enhance core competitiveness.
[0003] In related technologies, statistical methods and machine learning methods are often used to predict customer churn. Although these methods can predict customer churn to varying degrees, they also have the following problems:
[0004] (1) Regarding statistical methods, related technologies often use Logistic regression (i.e., a linear regression analysis model) and decision trees for prediction. Logistic regression is a commonly used statistical method and is also used in customer churn prediction. However, Logistic regression assumes that there is a linear relationship between features and has poor prediction capabilities for complex nonlinear relationships. Decision tree models can capture nonlinear relationships between features, but are prone to overfitting and have poor processing effects on high-dimensional data and sparse data.
[0005] (2) For machine learning methods, related technologies often use random forests and deep learning models for prediction. Among them, random forest is an integrated learning method with good prediction performance and robustness. However, random forest has difficulty in providing the importance ranking of variables and the ability to explain the model prediction results; deep learning models, such as neural networks, have powerful learning and expression capabilities and can handle complex nonlinear relationships. However, deep learning models usually require a large amount of data and computing resources and lack interpretability.
[0006] In addition, the customer churn prediction methods in related technologies often have the following problems: (1) Data imbalance: Customer churn data is usually imbalanced, that is, there are fewer samples of churned customers, which can easily lead to insufficient understanding of the minority category samples during the training process, making the prediction results biased towards the majority category; (2) Inability to select and extract appropriate features: Selecting and extracting the most predictive features is crucial to the accuracy of the model. However, the customer churn prediction methods in related technologies are unable to select and extract the most appropriate features for model training; (3) Poor model interpretability: For financial institutions, model interpretability is crucial, while machine learning methods in related technologies (such as neural networks) are often black box models, which make it difficult to explain the reasons for model predictions and the basis for decision-making.
[0007] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0008] The embodiments of the present invention provide a method for determining a customer type and a device thereof, an electronic device, and a storage medium, so as to at least solve the technical problem of poor accuracy in predicting customer types in the related art.
[0009] According to one aspect of an embodiment of the present invention, a method for determining a customer type is provided, comprising: acquiring a historical data set, and sampling the historical data set using a preset sampling strategy to obtain an initial data set, wherein the historical data set includes: a first data set and a second data set, each first data in the first data set is annotated with a non-churn label, and each second data in the second data set is annotated with a churn label; screening the initial data set to obtain a target data set; using the target data set to train a preset classification model to obtain a training result; when the training result indicates that the training is complete, inputting the customer data of the target customer into the preset classification model, and outputting a classification result, wherein the classification result is used to indicate the customer type to which the target customer belongs, and the customer types include: churn type and non-churn type.
[0010] Optionally, the step of sampling the historical data set using a preset sampling strategy to obtain an initial data set includes: determining a data ratio between the first data set and the second data set based on the historical data set; determining a sampling ratio based on the data ratio; extracting a preset number of the first data from the first data set based on the sampling ratio to obtain a sampled data set, wherein the preset number is determined based on the sampling ratio and the number of the second data in the second data set; and merging the sampled data set and the second data set to obtain the initial data set.
[0011] Optionally, the initial data set includes: N initial data, each of the initial data includes: M feature data, the feature data includes: a feature primary key and a feature key value, N and M are positive integers respectively, and the step of screening the initial data set to obtain a target data set includes: determining the total number of null values of the feature key values corresponding to all the feature primary keys; when the total number is greater than a preset null value threshold, deleting the feature data indicated by the total number from each of the initial data to obtain a preset data set; based on the preset number of features, using a preset recursive algorithm to screen the preset data set to obtain the target data set, wherein the target data set includes: K target data, the total amount of feature data of each target data is the preset number of features, and K is equal to N.
[0012] Optionally, after screening the initial data set to obtain the target data set, it also includes: standardizing all the feature data in the target data to obtain the processed target data; constructing the processed target data set based on the processed target data; dividing the processed target data set into a training set and a test set.
[0013] Optionally, before using the target data set to train a preset classification model and obtaining a training result, it also includes: determining a preset function, and determining model parameters based on the preset function; and constructing the preset classification model based on the preset function and the model parameters.
[0014] Optionally, the step of using the target data set to train a preset classification model to obtain a training result includes: using a training set to train the preset classification model to obtain an initial classification model, wherein the parameter value of the model parameter in the initial classification model is an initial parameter value; based on the initial parameter value, using a test set to evaluate the initial classification model to obtain an evaluation index value; when the evaluation index value is less than a preset index threshold, continuing to use the training set to train the initial classification model until the evaluation index value of the initial classification model is greater than or equal to the preset index threshold, and recording the training result as training completion.
[0015] Optionally, after recording the training result as training completion, it also includes: inputting the target data set into the preset classification model that has completed training to obtain a weight value for each feature data; based on the weight value, sorting all the feature data to obtain a feature sorting result.
[0016] Optionally, after the customer data of the target customer is input into the preset classification model and the classification result is output, it also includes: when the classification result indicates that the target customer is the customer type of the churn type, analyzing the customer data according to the feature sorting result to obtain an analysis result; based on the analysis result, determining an adjustment strategy, wherein the adjustment strategy is used to adjust the service business provided to the target customer.
[0017] According to another aspect of an embodiment of the present invention, there is also provided a device for determining a customer type, comprising: a sampling unit, for acquiring a historical data set, and adopting a preset sampling strategy to sample the historical data set to obtain an initial data set, wherein the historical data set comprises: a first data set and a second data set, each first data in the first data set is marked with a non-churn label, and each second data in the second data set is marked with a churn label; a screening unit, for screening the initial data set to obtain a target data set; a training unit, for adopting the target data set to train a preset classification model to obtain a training result; an input unit, for inputting the customer data of a target customer into the preset classification model and outputting a classification result when the training result indicates that the training is completed, wherein the classification result is used to indicate the customer type to which the target customer belongs, and the customer types include: churn type and non-churn type.
[0018] Optionally, the sampling unit includes: a first determination module, used to determine the data ratio between the first data set and the second data set based on the historical data set; a second determination module, used to determine the sampling ratio based on the data ratio; a first extraction module, used to extract a preset number of the first data from the first data set based on the sampling ratio to obtain a sampled data set, wherein the preset number is determined based on the sampling ratio and the number of the second data in the second data set; a first merging module, used to merge the sampled data set and the second data set to obtain the initial data set.
[0019] Optionally, the initial data set includes: N initial data, each of the initial data includes: M feature data, the feature data includes: a feature primary key and a feature key value, N and M are positive integers respectively, and the screening unit includes: a third determination module, used to determine the total number of null values of the feature key values corresponding to all the feature primary keys; a first deletion module, used to delete the feature data indicated by the total number from each of the initial data when the total number is greater than a preset null value threshold, to obtain a preset data set; a first screening module, used to screen the preset data set based on a preset feature number and using a preset recursive algorithm to obtain the target data set, wherein the target data set includes: K target data, the total amount of feature data of each target data is the preset feature number, and K is equal to N.
[0020] Optionally, the determination device also includes: a first processing module, which is used to standardize all the feature data in the target data after screening the initial data set to obtain the target data set, so as to obtain the processed target data; a first construction module, which is used to construct the processed target data set based on the processed target data; and a first partitioning module, which is used to partition the processed target data set into a training set and a test set.
[0021] Optionally, the determination device also includes: a fourth determination module, used to determine a preset function and determine model parameters based on the preset function before using the target data set to train the preset classification model and obtain the training results; a second construction module, used to construct the preset classification model based on the preset function and the model parameters.
[0022] Optionally, the training unit includes: a first training module, used to train the preset classification model with a training set to obtain an initial classification model, wherein the parameter value of the model parameter in the initial classification model is the initial parameter value; a first evaluation module, used to evaluate the initial classification model with a test set based on the initial parameter value to obtain an evaluation index value; a second training module, used to continue to train the initial classification model with the training set when the evaluation index value is less than a preset index threshold, until the evaluation index value of the initial classification model is greater than or equal to the preset index threshold, and record the training result as training completion.
[0023] Optionally, the determination device also includes: a first input module, used to input the target data set into the preset classification model that has been trained after recording the training result as completed, to obtain the weight value of each feature data; a first sorting module, used to sort all the feature data based on the weight value to obtain a feature sorting result.
[0024] Optionally, the determination device also includes: a first analysis module, which is used to input the customer data of the target customer into the preset classification model and output the classification result, and when the classification result indicates that the target customer is the customer type of the churn type, analyze the customer data according to the feature sorting result to obtain an analysis result; and a fifth determination module, which is used to determine an adjustment strategy based on the analysis result, wherein the adjustment strategy is used to adjust the service business provided to the target customer.
[0025] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned methods for determining the customer type.
[0026] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the above-mentioned methods for determining a customer type.
[0027] In the present disclosure, a historical data set is obtained, and a preset sampling strategy is used to sample the historical data set to obtain an initial data set, the initial data set is screened to obtain a target data set, and the target data set is used to train a preset classification model to obtain a training result. When the training result indicates that the training is completed, the customer data of the target customer is input into the preset classification model to output a classification result. In the present disclosure, a preset sampling strategy can be used to sample the acquired historical data set to obtain an initial data set, and then the initial data set is feature screened to obtain a target data set, and then the target data set is used to train a preset classification model, and after the training is completed, the customer data of the target customer is input into the preset classification model to obtain a classification result, which can indicate whether the customer type to which the target customer belongs is a churn type. By sampling and screening the historical data set, the accuracy of predicting the customer type can be improved, thereby solving the technical problem of poor accuracy in predicting the customer type in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0029] Figure 1is a flow chart of an optional method for determining a customer type according to an embodiment of the present invention;
[0030] Figure 2 is a schematic diagram of an optional device for determining a customer type according to an embodiment of the present invention;
[0031] Figure 3 The figure is a hardware structure block diagram of an electronic device (or mobile device) for a method for determining a client type according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0035] The following embodiments of the present invention can be applied to various systems / applications / devices for determining customer types. The present invention adopts a support vector machine (SVM for short, which is a supervised learning algorithm that can be used for classification and regression tasks) model to predict customer churn in financial institutions. Since customer churn data usually presents an unbalanced characteristic, that is, there are fewer samples of lost customers, the present invention uses a random sampling method to improve the support vector machine model to cope with data imbalance. The present invention verifies the improvement effect of the random sampling method on the support vector machine model, as well as the accuracy and feasibility of the improved model in customer churn prediction, which can help financial institutions strengthen customer management, formulate personalized marketing strategies, improve service quality, and ultimately improve the competitiveness and business performance of financial institutions.
[0036] In the present invention, the support vector machine model is improved by adopting a random sampling method, thereby reducing the imbalance of data, increasing the number of samples of a minority category (i.e., lost customers), enhancing the model's prediction ability for lost customers, and solving the problem of data imbalance. In addition, in order to solve the problem that the statistical methods and classification methods in the related art perform poorly when processing data imbalance, resulting in low accuracy in customer churn prediction, the present invention improves the prediction accuracy by improving the support vector machine model, and by applying the random sampling method and the improved support vector machine model, it is possible to more accurately predict the loss of financial institution customers. In addition, the present invention can provide accurate customer churn prediction results for financial institutions, thereby helping financial institutions to strengthen customer management, formulate personalized marketing strategies and improve service quality, and accurate customer churn prediction can help financial institutions take timely measures to retain customers with potential churn risks, and improve the core competitiveness and business performance of financial institutions.
[0037] Therefore, the present invention can handle data imbalance problems, improve prediction accuracy, achieve more accurate and reliable predictions, and provide financial institutions with accurate customer churn prediction results by improving the support vector machine model, so as to help financial institutions strengthen customer management, formulate personalized marketing strategies and improve service quality.
[0038] The present invention is described in detail below in conjunction with various embodiments.
[0039] Embodiment 1
[0040] According to an embodiment of the present invention, an embodiment of a method for determining a customer type is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0041] Figure 1 is a flowchart of an optional method for determining a customer type according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0042] Step S101, obtain a historical data set, and use a preset sampling strategy to sample the historical data set to obtain an initial data set, wherein the historical data set includes: a first data set and a second data set, each first data in the first data set is marked with a non-loss label, and each second data in the second data set is marked with a loss label.
[0043] Step S102, screening the initial data set to obtain a target data set.
[0044] Step S103: Use the target data set to train the preset classification model to obtain a training result.
[0045] Step S104, when the training result indicates that the training is completed, the customer data of the target customer is input into a preset classification model, and a classification result is output, wherein the classification result is used to indicate the customer type to which the target customer belongs, and the customer type includes: churn type and non-churn type.
[0046] Through the above steps, a historical data set can be obtained, and a preset sampling strategy can be used to sample the historical data set to obtain an initial data set, the initial data set can be screened to obtain a target data set, and the target data set can be used to train a preset classification model to obtain a training result. When the training result indicates that the training is completed, the customer data of the target customer is input into the preset classification model to output the classification result. In an embodiment of the present invention, a preset sampling strategy can be used to sample the acquired historical data set to obtain an initial data set, and then the initial data set can be feature screened to obtain a target data set, and then the target data set can be used to train a preset classification model, and after the training is completed, the customer data of the target customer is input into the preset classification model to obtain a classification result, which can indicate whether the customer type to which the target customer belongs is a churn type. By sampling and screening the historical data set, the accuracy of predicting the customer type can be improved, thereby solving the technical problem of poor accuracy in predicting the customer type in the related art.
[0047] The embodiment of the present invention is described in detail below in combination with the above steps.
[0048] Step S101, obtain a historical data set, and use a preset sampling strategy to sample the historical data set to obtain an initial data set, wherein the historical data set includes: a first data set and a second data set, each first data in the first data set is marked with a non-loss label, and each second data in the second data set is marked with a loss label.
[0049] In an embodiment of the present invention, a historical data set of a financial institution may be obtained first, and the historical data set includes: a first data set (i.e., a non-loss sample data set) and a second data set (i.e., a loss sample data set), each first data in the first data set is marked with a non-loss label, and each second data in the second data set is marked with a loss label, and each data includes: basic attributes, financial attributes, behavioral attributes, and risk attributes. Then, a preset sampling strategy may be used to sample the historical data set to obtain an initial data set (i.e., a balanced data set, which refers to a data set composed of non-loss sample data and loss sample data according to a preset ratio).
[0050] Optionally, the step of sampling the historical data set using a preset sampling strategy to obtain an initial data set includes: determining the data ratio between the first data set and the second data set based on the historical data set; determining the sampling ratio based on the data ratio; extracting a preset number of first data from the first data set based on the sampling ratio to obtain a sampled data set, wherein the preset number is determined based on the sampling ratio and the number of second data in the second data set; and merging the sampled data set and the second data set to obtain the initial data set.
[0051] In the embodiment of the present invention, a random sampling method can be used to solve the sample imbalance problem. The random sampling method can adjust the distribution of the data set by randomly selecting samples, which can solve the problem of data imbalance. A certain number of samples can be randomly selected from the majority category (non-churned customers) so that the sample ratio of the majority category and the minority category (churned customers) is close to the preset ratio, thereby reducing the imbalance of the data.
[0052] In an embodiment of the present invention, the random sampling method can be applied to improve the support vector machine model to improve the prediction ability of the minority category (churned customers). Specifically, since it is necessary to balance the sample ratio between the majority category and the minority category to avoid information loss or overfitting problems caused by oversampling, it is necessary to determine an appropriate sampling ratio. The sampling ratio can be determined according to the imbalance degree and needs of the actual data, that is, how many samples are extracted from the majority category to maintain a balance with the minority category (that is, based on the historical data set, the data ratio between the first data set and the second data set is determined; based on the data ratio, the sampling ratio is determined), and then random sampling is performed. According to the sampling ratio, a corresponding number of samples are randomly selected from the majority category (for example, sampling can be implemented using a random sampling function) (that is, based on the sampling ratio, a preset number of first data are extracted from the first data set to obtain a sampled data set, and the preset number is determined based on the sampling ratio and the number of second data in the second data set), and then the sampled data set is combined, that is, the sampled majority category samples are merged with the original minority category samples to form a new balanced data set (that is, the sampled data set and the second data set are merged to obtain an initial data set), so as to use the improved balanced data set to train and test the support vector machine model.
[0053] In the embodiment of the present invention, by improving the data set through random sampling, the samples of the minority category (lost customers) can be better considered when training the support vector machine model, thereby improving the prediction ability of the model.
[0054] Step S102, screening the initial data set to obtain a target data set.
[0055] Optionally, the initial data set includes: N initial data, each initial data includes: M feature data, the feature data includes: a feature primary key and a feature key value, N and M are positive integers respectively, and the step of screening the initial data set to obtain the target data set includes: determining the total number of null values of feature key values corresponding to all feature primary keys; when the total number is greater than a preset null value threshold, deleting the feature data indicated by the total number from each initial data to obtain a preset data set; based on the preset number of features, using a preset recursive algorithm to screen the preset data set to obtain the target data set, wherein the target data set includes: K target data, the total amount of feature data of each target data is the preset number of features, and K is equal to N.
[0056] In an embodiment of the present invention, an initial data set includes: N (positive integer) pieces of initial data, each piece of initial data includes: M (positive integer) pieces of feature data, the feature data includes: a feature primary key and a feature key value (that is, the data structure of the feature data is a key-value pair structure), and the initial data set can be feature screened, and unimportant feature data in the data set is deleted to obtain a target data set (that is, based on the data analysis and feature selection results, features that have an important impact on customer churn prediction are selected for extraction), specifically: the total number of null values corresponding to all feature primary keys can be determined first, and if the total number is greater than a preset null value threshold (for example, more than half of the feature primary keys correspond to null values), the feature data indicated by the total number is deleted from each piece of initial data to obtain a preset data set, and then according to a preset feature number (that is, a predetermined number of features to be retained), a preset recursive algorithm is used to screen the preset data set to obtain a target data set (that is, the preset recursive algorithm can delete unimportant features according to the importance of the features), and the target data set includes: K (equal to N) pieces of target data, and the total amount of feature data of each piece of target data is the preset feature number.
[0057] Optionally, after screening the initial data set to obtain the target data set, it also includes: standardizing all feature data in the target data to obtain processed target data; constructing a processed target data set based on the processed target data; and dividing the processed target data set into a training set and a test set.
[0058] In an embodiment of the present invention, after the target data set is screened, all feature data in the target data can be standardized (i.e., feature scaling, feature conversion, etc.) to unify the data format of the feature primary key and the feature key value in the feature data. Then, the processed target data set can be divided into a training set and a test set, for example, 70% of the data is used as a training set and 30% of the data is used as a test set.
[0059] Optionally, before using the target data set to train the preset classification model and obtaining the training results, it also includes: determining a preset function, and based on the preset function, determining model parameters; and constructing a preset classification model based on the preset function and the model parameters.
[0060] In an embodiment of the present invention, a suitable kernel function (i.e., a preset function, such as a linear kernel, a polynomial kernel, a Gaussian kernel, etc.) can be selected first, and then the hyperparameters (i.e., model parameters, such as penalty parameters and kernel function parameters, etc.) can be determined based on the selected preset function (i.e., the preset function is determined, and based on the preset function, the model parameters are determined), and then a preset classification model (i.e., a support vector machine model) is constructed based on the preset function and the model parameters.
[0061] Step S103: Use the target data set to train the preset classification model to obtain a training result.
[0062] Optionally, the step of using the target data set to train the preset classification model to obtain the training result includes: using the training set to train the preset classification model to obtain an initial classification model, wherein the parameter values of the model parameters in the initial classification model are the initial parameter values; based on the initial parameter values, using the test set to evaluate the initial classification model to obtain an evaluation index value; when the evaluation index value is less than a preset index threshold, continuing to train the initial classification model with the training set until the evaluation index value of the initial classification model is greater than or equal to the preset index threshold, and recording the training result as the completion of the training.
[0063] In an embodiment of the present invention, a balanced training data set can be used to train a support vector machine model, and then an optimal model parameter combination can be found through methods such as cross-validation or grid search to improve model performance and generalization ability. Specifically, a preset classification model can be first trained with a training set to obtain an initial classification model (the parameter values of the model parameters in the initial classification model are the initial parameter values), and then the initial classification model can be evaluated using a test data set, and prediction indicators (such as accuracy, recall, F value (i.e., the harmonic mean of accuracy and recall)) can be calculated to evaluate the performance and prediction ability of the model (for example, a ROC curve (Receiver Operating Characteristic Curve) can be drawn and an AUC value (i.e., the area under the ROC curve) can be calculated to evaluate the classification performance of the model) (i.e., based on the initial parameter values, the initial classification model is evaluated using a test set to obtain an evaluation index value). If the evaluation index value is less than a preset index threshold (which can be set according to actual conditions), the initial classification model is continuously trained using the training set until the evaluation index value of the initial classification model is greater than or equal to the preset index threshold, and the training result is recorded as training completion.
[0064] Optionally, after recording the training result as training completion, it also includes: inputting the target data set into the trained preset classification model to obtain the weight value of each feature data; based on the weight value, sorting all feature data to obtain feature sorting results.
[0065] In an embodiment of the present invention, during the training process, the support vector machine model can obtain the weight value of each feature data by analyzing the input feature data, and then output the feature importance ranking (that is, input the target data set into the trained preset classification model to obtain the weight value of each feature data, and sort all the feature data based on the weight value to obtain the feature ranking result), so as to provide a basis for subsequent analysis of the reasons for customer loss and improve the interpretability of the model.
[0066] Step S104, when the training result indicates that the training is completed, the customer data of the target customer is input into a preset classification model, and a classification result is output, wherein the classification result is used to indicate the customer type to which the target customer belongs, and the customer type includes: churn type and non-churn type.
[0067] In an embodiment of the present invention, a trained support vector machine model can be used to analyze the customer data of the target customer to predict whether the customer type of the target customer is a churn type and obtain a classification result (i.e., when the training result indicates that the training is completed, the customer data of the target customer is input into a preset classification model and a classification result is output, and the classification result is used to indicate whether the customer type of the target customer is a churn type or a non-churn type).
[0068] Optionally, after inputting the customer data of the target customer into a preset classification model and outputting the classification result, it also includes: when the classification result indicates that the target customer is a churn type of customer, analyzing the customer data based on the feature sorting result to obtain an analysis result; based on the analysis result, determining an adjustment strategy, wherein the adjustment strategy is used to adjust the service business provided to the target customer.
[0069] In an embodiment of the present invention, the classification results of the model can be interpreted according to the feature sorting results of the model, the factors affecting customer churn and important characteristics can be analyzed, adjustment decisions can be provided, and then personalized marketing strategies and customer retention measures for different customers can be formulated based on the adjustment decisions to improve customer satisfaction and retention rate.
[0070] In an embodiment of the present invention, if the classification result indicates that the target customer is a churn type, the customer data can be analyzed based on the feature sorting result to obtain an analysis result, and then an adjustment strategy can be determined based on the analysis result. The adjustment strategy is used to adjust the service business provided to the target customer to improve customer satisfaction.
[0071] Another optional specific implementation is described in detail below.
[0072] In the embodiment of the present invention, the data of a financial institution is used as sample data to complete the construction of the classification model. The specific process is as follows:
[0073] (1) Constructing a feature database: Extracting financial institution business system data and constructing a feature database that includes data such as customer basic attributes, customer financial attributes, customer behavior attributes, and risk attributes.
[0074] (2) Perform feature engineering processing: Features can be screened through algorithms such as feature standardization, normalization, correlation analysis, and recursive feature elimination.
[0075] (3) Use random sampling to solve the sample imbalance problem: randomly extract a preset proportion of non-loss samples from the non-loss data and merge them with the loss samples to balance the loss samples and non-loss samples and construct a balanced data set.
[0076] (4) Build a customer churn prediction model: 1) Create a support vector machine model object; 2) Divide the balanced data set into a training set and a test set; 3) Use the training set to train the model and use the test set to evaluate the model to tune the model and obtain a trained model.
[0077] Without sampling, the output results of the support vector machine model (e.g., linear SVM, radial basis SVM) and the logistic regression model are compared. The comparison results of customer churn recall rate and customer churn prediction accuracy are shown in Table 1:
[0078] Table 1
[0079] Model Customer churn recall rate Customer churn prediction accuracy Logistic Regression Model 10% 8% Linear SVM 12% 9% Radial Basis SVM 13% 8%
[0080] As can be seen from Table 1, these three models made incorrect predictions for all churned customers, resulting in both the customer churn recall rate and the customer churn prediction accuracy being less than 15%, indicating that the three models have poor prediction capabilities for churned customers in the case of unbalanced samples.
[0081] However, when the F value is used as the model selection criterion, after experiments with different sampling ratios, the optimal model F value is shown in Table 2:
[0082] Table 2
[0083] Model Optimal model F value Logistic Regression Model 15.09% Linear SVM 16.37% Radial Basis SVM 15.76%
[0084] As can be seen from Table 2, based on the comparison of the optimal model F value, it can be found that the linear SVM model has the best prediction effect, followed by the radial basis SVM model and the Logistic regression model. Therefore, the linear support vector machine method can be used as the customer churn prediction model for this data set. From the results, under the appropriate sampling ratio, the support vector machine model performs well in the customer churn prediction of financial institutions and can achieve good results.
[0085] In an embodiment of the present invention, a customer churn prediction method based on a support vector machine model is proposed, which has the following beneficial effects: (1) processing data imbalance: in customer churn prediction, since the number of customer churn samples is usually small, the data presents an unbalanced feature. Therefore, this embodiment uses a random sampling method to improve the support vector machine model, which can reduce the data imbalance by changing the distribution of the data set, thereby improving the prediction accuracy of the model; (2) considering the relationship between categories: the support vector machine model can classify according to the boundaries between categories in the classification problem, and the random sampling method can increase the number of samples of the minority category by changing the distribution of the data set, so that the model can better learn the characteristics and boundaries of the minority category; (3) improving the prediction accuracy: improving the support vector machine model by the random sampling method can reduce the data imbalance and increase the number of samples of the minority category, so that the model pays more attention to the minority category, thereby improving the prediction accuracy; (4) enhancing the stability of the model: the random sampling method can make the support vector machine model more stable by increasing the number of samples and redistributing samples.
[0086] In the embodiment of the present invention, accurate and complete customer churn data can be obtained, and the quality and accuracy of the data can be ensured by processing missing values, abnormal values, and duplicate values. In addition, in the feature selection process, the key features that affect customer churn prediction can be accurately determined, and appropriate feature engineering processing can be performed to improve the prediction ability of the model. In addition, for the problem of data imbalance, random sampling can be used to balance the samples to avoid the model being biased towards the majority category or failing to accurately predict the minority category.
[0087] In the embodiment of the present invention, the security and privacy of data can also be ensured, and the trained support vector machine model has stable performance and can provide explanations for the prediction results so that financial institutions can understand the decision basis and reasons of the model.
[0088] The following is a detailed description in conjunction with another embodiment.
[0089] Embodiment 2
[0090] A device for determining a customer type provided in this embodiment includes multiple implementation units, each of which corresponds to each implementation step in the above-mentioned embodiment 1.
[0091] Figure 2 is a schematic diagram of an optional client type determination device according to an embodiment of the present invention. Figure 2 As shown, the determination device may include: a sampling unit 20, a screening unit 21, a training unit 22, and an input unit 23, wherein:
[0092] The sampling unit 20 is used to obtain a historical data set, and sample the historical data set using a preset sampling strategy to obtain an initial data set, wherein the historical data set includes: a first data set and a second data set, each first data in the first data set is marked with a non-churn label, and each second data in the second data set is marked with a churn label;
[0093] A screening unit 21 is used to screen the initial data set to obtain a target data set;
[0094] A training unit 22, used to train a preset classification model using a target data set to obtain a training result;
[0095] The input unit 23 is used to input the customer data of the target customer into a preset classification model and output a classification result when the training result indicates that the training is completed, wherein the classification result is used to indicate the customer type to which the target customer belongs, and the customer type includes: churn type and non-churn type.
[0096] The above-mentioned determination device can obtain a historical data set through a sampling unit 20, and use a preset sampling strategy to sample the historical data set to obtain an initial data set, and use a screening unit 21 to screen the initial data set to obtain a target data set, and use a training unit 22 to train a preset classification model using the target data set to obtain a training result, and when the training result indicates that the training is completed, the customer data of the target customer is input into the preset classification model through the input unit 23, and the classification result is output. In an embodiment of the present invention, a preset sampling strategy can be used to sample the acquired historical data set to obtain an initial data set, and then the initial data set is feature screened to obtain a target data set, and then the target data set is used to train the preset classification model, and after the training is completed, the customer data of the target customer is input into the preset classification model to obtain a classification result, and the classification result can indicate whether the customer type to which the target customer belongs is a churn type. By sampling and screening the historical data set, the accuracy of predicting the customer type can be improved, thereby solving the technical problem of poor accuracy in predicting the customer type in the related art.
[0097] Optionally, the sampling unit includes: a first determination module, used to determine the data ratio between the first data set and the second data set based on the historical data set; a second determination module, used to determine the sampling ratio based on the data ratio; a first extraction module, used to extract a preset number of first data from the first data set based on the sampling ratio to obtain a sampled data set, wherein the preset number is determined based on the sampling ratio and the number of second data in the second data set; a first merging module, used to merge the sampled data set and the second data set to obtain an initial data set.
[0098] Optionally, the initial data set includes: N initial data, each initial data includes: M feature data, the feature data includes: a feature primary key and a feature key value, N and M are positive integers respectively, and the screening unit includes: a third determination module, used to determine the total number of feature key values corresponding to all feature primary keys that are null values; a first deletion module, used to delete the feature data indicated by the total number from each initial data when the total number is greater than a preset null value threshold, to obtain a preset data set; a first screening module, used to screen the preset data set based on a preset number of features and using a preset recursive algorithm to obtain a target data set, wherein the target data set includes: K target data, the total amount of feature data for each target data is the preset number of features, and K is equal to N.
[0099] Optionally, the determination device also includes: a first processing module, which is used to standardize all feature data in the target data after screening the initial data set to obtain the target data set, so as to obtain processed target data; a first construction module, which is used to construct a processed target data set based on the processed target data; and a first partitioning module, which is used to partition the processed target data set into a training set and a test set.
[0100] Optionally, the determination device also includes: a fourth determination module, used to determine a preset function and determine model parameters based on the preset function before using the target data set to train the preset classification model and obtain the training results; a second construction module, used to construct a preset classification model based on the preset function and model parameters.
[0101] Optionally, the training unit includes: a first training module, used to train a preset classification model with a training set to obtain an initial classification model, wherein the parameter values of the model parameters in the initial classification model are initial parameter values; a first evaluation module, used to evaluate the initial classification model with a test set based on the initial parameter values to obtain evaluation index values; a second training module, used to continue to train the initial classification model with the training set when the evaluation index value is less than a preset index threshold, until the evaluation index value of the initial classification model is greater than or equal to the preset index threshold, and record the training result as training completion.
[0102] Optionally, the determination device also includes: a first input module, which is used to input the target data set into the trained preset classification model after recording the training result as completed, to obtain the weight value of each feature data; a first sorting module, which is used to sort all feature data based on the weight value to obtain a feature sorting result.
[0103] Optionally, the determination device also includes: a first analysis module, which is used to input the customer data of the target customer into a preset classification model and output the classification result, and when the classification result indicates that the target customer is a churn type of customer, analyze the customer data according to the feature sorting result to obtain an analysis result; and a fifth determination module, which is used to determine an adjustment strategy based on the analysis result, wherein the adjustment strategy is used to adjust the service business provided to the target customer.
[0104] The above-mentioned determination device may also include a processor and a memory. The above-mentioned sampling unit 20, screening unit 21, training unit 22, input unit 23, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0105] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and when the training result indicates that the training is completed, the customer data of the target customer is input into the preset classification model by adjusting the kernel parameters, and the classification result is output.
[0106] The above-mentioned memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one storage chip.
[0107] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having the following method steps: obtaining a historical data set, and sampling the historical data set using a preset sampling strategy to obtain an initial data set, screening the initial data set to obtain a target data set, using the target data set to train a preset classification model to obtain a training result, and when the training result indicates that the training is completed, inputting the customer data of the target customer into the preset classification model, and outputting the classification result.
[0108] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned method for determining the customer type.
[0109] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement the above-mentioned method for determining the customer type.
[0110] Figure 31 is a hardware structure block diagram of an electronic device (or mobile device) for a method for determining a customer type according to an embodiment of the present invention. Figure 3 As shown, the electronic device may include one or more ( Figure 3 302a, 302b, ..., 302n are used to illustrate) processor 302 (processor 302 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), memory 304 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 3 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 3 More or fewer components as shown, or with Figure 3 Different configurations are shown.
[0111] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0112] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0113] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0114] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0115] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0116] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0117] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for determining a customer type, characterized in that: include: Acquire a historical data set, and use a preset sampling strategy to sample the historical data set to obtain an initial data set, wherein the historical data set includes: a first data set and a second data set, each first data in the first data set is marked with a non-churn label, and each second data in the second data set is marked with a churn label; Screening the initial data set to obtain a target data set; Using the target data set to train a preset classification model to obtain a training result; When the training result indicates that the training is completed, the customer data of the target customer is input into the preset classification model, and a classification result is output, wherein the classification result is used to indicate the customer type to which the target customer belongs, and the customer type includes: churn type and non-churn type.
2. The determination method according to claim 1, characterized in that: The step of sampling the historical data set using a preset sampling strategy to obtain an initial data set includes: Based on the historical data set, determining a data ratio between the first data set and the second data set; Determining a sampling ratio based on the data ratio; Based on the sampling ratio, extracting a preset number of the first data from the first data set to obtain a sampled data set, wherein the preset number is determined according to the sampling ratio and the number of the second data in the second data set; The sampled data set and the second data set are combined to obtain the initial data set.
3. The determination method according to claim 1, characterized in that: The initial data set includes: N pieces of initial data, each piece of the initial data includes: M feature data, the feature data includes: a feature primary key and a feature key value, N and M are positive integers, respectively, the initial data set is screened to obtain a target data set, including: Determine the total number of null values of the feature key values corresponding to all the feature primary keys; When the total number is greater than a preset null value threshold, the feature data indicated by the total number is deleted from each piece of the initial data to obtain a preset data set; Based on the preset number of features, a preset recursive algorithm is used to screen the preset data set to obtain the target data set, wherein the target data set includes: K target data, the total amount of feature data of each target data is the preset number of features, and K is equal to N.
4. The determination method according to claim 3, characterized in that: After the initial data set is screened to obtain the target data set, the method further includes: Performing standardization processing on all the feature data in the target data to obtain the processed target data; Based on the processed target data, construct the processed target data set; The processed target data set is divided into a training set and a test set.
5. The determination method according to claim 1, characterized in that: Before using the target data set to train the preset classification model and obtain the training result, the method further includes: Determine a preset function, and determine model parameters based on the preset function; Based on the preset function and the model parameters, the preset classification model is constructed.
6. The determination method according to claim 5, characterized in that: The step of using the target data set to train a preset classification model to obtain a training result comprises: Using a training set to train the preset classification model to obtain an initial classification model, wherein the parameter value of the model parameter in the initial classification model is an initial parameter value; Based on the initial parameter values, the initial classification model is evaluated using a test set to obtain an evaluation index value; When the evaluation index value is less than the preset index threshold, continue to use the training set to train the initial classification model until the evaluation index value of the initial classification model is greater than or equal to the preset index threshold, and record the training result as training completion.
7. The determination method according to claim 6, characterized in that: After recording the training result as training completion, the method further includes: Inputting the target data set into the trained preset classification model to obtain a weight value for each feature data; Based on the weight value, all the feature data are sorted to obtain a feature sorting result.
8. The determination method according to claim 7, characterized in that: After inputting the customer data of the target customer into the preset classification model and outputting the classification result, the method further includes: When the classification result indicates that the target customer is the customer type of the churn type, analyzing the customer data according to the feature sorting result to obtain an analysis result; Based on the analysis result, an adjustment strategy is determined, wherein the adjustment strategy is used to adjust the service business provided to the target customer.
9. A device for determining a customer type, characterized in that: include: A sampling unit, configured to obtain a historical data set, and sample the historical data set using a preset sampling strategy to obtain an initial data set, wherein the historical data set includes: a first data set and a second data set, each first data in the first data set is annotated with a non-churn label, and each second data in the second data set is annotated with a churn label; A screening unit, used for screening the initial data set to obtain a target data set; A training unit, used to train a preset classification model using the target data set to obtain a training result; An input unit is used to input the customer data of the target customer into the preset classification model and output a classification result when the training result indicates that the training is completed, wherein the classification result is used to indicate the customer type to which the target customer belongs, and the customer type includes: churn type and non-churn type.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for determining the customer type according to any one of claims 1 to 8.
11. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the customer type determination method described in any one of claims 1 to 8.