Model training method, object loss prediction method, device and electronic equipment
By constructing positive and negative sample pairs and training a recognition model using behavioral, attribute, and activity information, a target feature vector is generated, which solves the problem of insufficient accuracy in predicting user churn in investment banking business and improves the accuracy of churn prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-29
- Publication Date
- 2026-03-24
AI Technical Summary
Existing technologies lack the accuracy to predict user churn in investment banking, making it impossible to accurately identify user churn risks.
By constructing positive and negative sample pairs, and utilizing behavioral, attribute, and activity information from the training samples, the recognition model is trained to generate target feature vectors. The model parameters are then adjusted based on the loss function to improve the accuracy of user churn prediction.
It enhances the accuracy of the identification model in recognizing similar user information, reduces discrepancies, and improves the accuracy of user churn prediction.
Smart Images

Figure CN116070715B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of artificial intelligence and big data technology, and in particular to a model training method, an object churn prediction method, a device, and an electronic device. Background Technology
[0002] In investment banking systems, the existing registered user base has reached a considerable size, and the optimal period for user growth has passed. Customer acquisition costs are gradually increasing. Therefore, serving existing users well and preventing churn will be more profitable than acquiring an equivalent number of new users. Consequently, reducing user churn will become a crucial performance indicator in investment banking operations.
[0003] In related technologies, using data tracking to obtain user information to assess whether investment banking users are likely to churn is far from achieving accurate prediction. Therefore, how to improve the accuracy of churn prediction is a technical problem that needs to be solved. Summary of the Invention
[0004] This application aims to at least partially address one of the technical problems in the related art.
[0005] To this end, this application proposes a model training method, an object churn prediction method, an apparatus, and an electronic device, which trains an identification model to obtain feature vectors indicating whether a user has churned, thereby improving the accuracy of user churn prediction.
[0006] One embodiment of this application proposes a model training method, including:
[0007] Obtain a training sample set; wherein each training sample includes a positive sample pair and a negative sample pair; the positive sample pair includes object information of objects of the same type; the negative sample pair includes object information of objects of different types; the object information includes behavioral information, attribute information, and activity information;
[0008] For each training sample, the training sample is input into the recognition model, and the target feature vectors of each object information included in the positive sample pair and the target feature vectors of each object information included in the negative sample pair are output.
[0009] The loss function is determined based on the target feature vectors of each object information included in the positive sample pair and the target feature vectors of each object information included in the negative sample pair.
[0010] The recognition model is trained based on the loss function.
[0011] Another embodiment of this application proposes a method for predicting object churn, including:
[0012] Obtain object information of the target object; wherein, the object information includes behavioral information, attribute information, and activity information;
[0013] The object information is input into a recognition model of at least one activity level obtained through training, and the target feature vector of the object information output by the recognition model of each activity level is obtained.
[0014] Based on the target feature vector of the object information output by the recognition model for each of the activity levels, determine at least one churn probability of the target object;
[0015] The churn risk of the target object is determined based on at least one churn probability of the target object.
[0016] Another embodiment of this application proposes a model training apparatus, comprising:
[0017] An acquisition module is used to acquire a training sample set; wherein each training sample includes a positive sample pair and a negative sample pair; the positive sample pair includes object information of objects of the same type; the negative sample pair includes object information of objects of different types; the object information includes behavioral information, attribute information, and activity information;
[0018] The recognition module is used to input the training sample into the recognition model for each training sample and output the target feature vector of each object information included in the positive sample pair and the target feature vector of each object information included in the negative sample pair.
[0019] The determination module is used to determine the loss function based on the target feature vectors of each object information included in the positive sample pair and the target feature vectors of each object information included in the negative sample pair.
[0020] The training module is used to train the recognition model according to the loss function.
[0021] Another embodiment of this application proposes an object churn prediction device, comprising:
[0022] The acquisition module is used to acquire object information of the target object; wherein, the object information includes behavioral information, attribute information, and activity information;
[0023] The recognition module is used to input the object information into a recognition model of at least one activity level obtained through training, and to obtain the target feature vector of the object information output by the recognition model of each activity level;
[0024] The first determining module is used to determine at least one churn probability of the target object based on the target feature vector of the object information output by the recognition model of each activity level;
[0025] The second determining module is used to determine the churn risk of the target object based on at least one churn probability of the target object.
[0026] Another embodiment of this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the method described in one aspect above or the method described in the other aspect above.
[0027] Another embodiment of this application proposes a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in one aspect above or the method described in another aspect above.
[0028] Another embodiment of this application proposes a computer program product having a computer program stored thereon, which, when executed by a processor, implements the method described in one aspect above or the method described in the other aspect above.
[0029] The model training method, object churn prediction method, device, and electronic device proposed in this application construct positive sample pairs based on object information of the same type of object and negative sample pairs based on object information of different types of objects. The object information includes behavioral information, attribute information, and activity information. Based on the object information contained in the positive sample pairs and the object information contained in the negative sample pairs, the recognition model can learn the semantic information between similar object information and the semantic information between dissimilar object information. This allows the trained recognition model to reduce the differences between object information of the same type and increase the differences between object information of different types when recognizing object information of the same type of object, thereby improving the accuracy of the target feature vector of the object information recognized by the recognition model, and thus improving the accuracy of object churn prediction based on the target feature vector.
[0030] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0031] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0032] Figure 1 A schematic flowchart illustrating a model training method provided in an embodiment of this application;
[0033] Figure 2 A flowchart illustrating another model training method provided in an embodiment of this application;
[0034] Figure 3 This is a schematic diagram of the structure of the recognition model provided in the embodiments of this application;
[0035] Figure 4 A flowchart illustrating another model training method provided in an embodiment of this application;
[0036] Figure 5 This is a schematic diagram of the structure of the recognition model and classification model provided in the embodiments of this application;
[0037] Figure 6 A flowchart illustrating an object churn prediction method provided in this application embodiment;
[0038] Figure 7 This is a schematic diagram of the structure of a model training device provided in an embodiment of this application;
[0039] Figure 8 This is a schematic diagram of the structure of an object loss prediction device provided in an embodiment of this application;
[0040] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0041] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0042] The model training method, object churn prediction method, apparatus, and electronic device of this application are described below with reference to the accompanying drawings.
[0043] Figure 1 This is a schematic flowchart of a model training method provided in an embodiment of this application.
[0044] The execution subject of the model training method in this embodiment is a model training device, which can be set in a server. The server can be a single server or a server cluster, a local server or a cloud server. This embodiment does not impose any limitations.
[0045] like Figure 1 As shown, the method may include the following steps:
[0046] Step 101: Obtain the training sample set.
[0047] Each training sample includes positive sample pairs and negative sample pairs. Positive sample pairs include object information of objects of the same type, while negative sample pairs include object information of objects of different types.
[0048] In this embodiment, the two objects included in the positive sample pair are of the same type. In the scenario of object churn risk prediction, the type indicates whether the user has a churn risk or not. That is, the object information of the two objects included in the positive sample pair is similar. The following are the cases where the positive sample pair may be omitted:
[0049] In the first scenario, the two objects to which the positive sample pair belongs are both users at risk of churn.
[0050] In the second scenario, the two objects to which the positive sample pair belongs are users who are not at risk of churn.
[0051] In the third scenario, the positive sample pair includes two object information entries that represent the same object within the same type but at different time periods. In one scenario, "same type" indicates that the object has no churn risk; that is, one object information entry contains data for object A in the first time period, and the other object information contains data for object A in the second time period. The data from the first and second time periods are different. In another scenario, "same type" indicates that the object has a churn risk; that is, one object information entry contains data for object A in the third time period, and the other object information contains data for object A in the fourth time period. The data from the third and fourth time periods are different.
[0052] The two object information belongs to two objects that are different types of the same object. That is, one object information is the data of object A when there is no risk of churn, and the other object information is the data of object A when there is a risk of churn.
[0053] A negative sample pair consists of two objects of different types. In other words, the object information of the two objects in a negative sample pair is not very similar and they are not similar.
[0054] The negative sample pairs include the following cases:
[0055] In the first scenario, the negative sample pair includes two object information, one of which is the object information of an object with churn risk, and the other is the object information of an object without churn risk.
[0056] In the second scenario, the negative sample pair includes two sets of object information: data for the same object at different time periods, with different user types in each time period. In one scenario, one set of object information is data for object A in the first time period, where object A is a user without churn risk; the other set of object information is data for object A in the second time period, where object A is a user with churn risk. The data from the first and second time periods are different.
[0057] The object information includes behavioral information, attribute information, and activity information, which are used to identify the risk of object churn.
[0058] In this embodiment of the application, the object information is described using a banking or investment banking scenario as an example.
[0059] The target's behavioral information includes the number of invested projects (unit: projects), total invested amount (unit: RMB 10,000), maximum investment amount, minimum investment amount, average investment amount, maximum financing term (unit: months), minimum financing term, average financing term, first investment time, last investment time, time since last investment time (unit: months), whether there are any investment projects within 1 month, time since last login time (unit: months), location of the last login network protocol (Internet Protocol, IP), the target's interest rate preference for browsing products, and the target's financing term preference for browsing products (unit: months).
[0060] The object's attribute information includes age, gender, registration duration (in years), mobile phone number location, object registration source, membership level, and the type of enterprise customer to which the object belongs.
[0061] The activity information of the object, including user growth information, specifically includes:
[0062] Task completion data will be pushed to the user on the web or mobile application, such as mini-games or check-ins, to earn points. Daily task completion rate = number of daily tasks completed / total number of daily tasks; core task completion rate = number of core tasks completed / total number of core tasks. Based on the task completion rate, the user's growth or activity level can be determined.
[0063] Achievement data, based on the number of medals, titles, and rankings earned by the individual through various activities, determines the individual's growth or activity level.
[0064] Points data is used to determine an individual's growth or activity level based on the amount and frequency of points redemption and the amount and frequency of points redemption in the points mall.
[0065] Step 102: For each training sample, input the training sample into the recognition model and output the target feature vector of each object information included in the positive sample pair and the target feature vector of each object information included in the negative sample pair.
[0066] In this embodiment of the application, for each training sample, the object information included in the positive sample pairs and negative sample pairs included in the training sample is input into the recognition model to obtain the target feature vector of each object information included in the positive sample pair and the target feature vector of each object information included in the negative sample pair.
[0067] As one implementation method, one of the positive sample pair and the negative sample pair is input first, and the other is input after the recognition is completed. In other words, the recognition model can process two object information at the same time to obtain the target feature vector of each object information. The target feature vector of each object information is based on the higher semantic level feature information learned from the object information, indicating the probability of the object being lost.
[0068] As another implementation, based on positive and negative sample pairs, the object information of the same type of objects contained in the positive sample pairs and the object information of different types of objects contained in the negative sample pairs are determined to determine the object information contained in the training sample. The object information can be 3 or 4, that is, the recognition model can process 3 or 4 user information at the same time to obtain the target feature vector of each object information. The target feature vector of each object information is based on the higher semantic level feature information learned from the object information, indicating the probability of the object being lost.
[0069] Step 103: Determine the loss function based on the target feature vectors of each object information included in the positive sample pairs and the target feature vectors of each object information included in the negative sample pairs.
[0070] In one implementation of this application, a first similarity is determined between objects of the same type included in the positive sample pair based on the target feature vectors of the object information included in the positive sample pair, and a second similarity is determined between objects of different types included in the negative sample pair based on the target feature vectors of the object information included in the negative sample pair, and a loss function is determined based on the first similarity and the second similarity.
[0071] Step 104: Train the recognition model according to the loss function.
[0072] In this embodiment of the application, the recognition model is trained according to the loss function to continuously adjust the parameters of the recognition model. Through iterative training, the trained recognition model minimizes the distance between the target feature vectors corresponding to the output object information when recognizing user information between objects of the same type in positive sample pairs, and maximizes the distance between the target feature vectors corresponding to the output object information when recognizing user information between objects of different types included in negative sample pairs, so as to increase the difference of features.
[0073] In the model training method of this application embodiment, the constructed training samples include positive sample pairs and negative sample pairs. Positive sample pairs include object information of objects of the same type, and negative sample pairs include object information of objects of different types. The object information includes behavioral information, attribute information, and activity information. The training samples are input into the recognition model, and the model outputs the target feature vectors of each object information in the positive sample pairs and the target feature vectors of each object information in the negative sample pairs. Based on the target feature vectors of each object information in the positive and negative sample pairs, a loss function is determined to train the recognition model. In this application, the loss function is based on the same... Positive sample pairs are constructed from object information of different object types, while negative sample pairs are constructed from object information of different object types. The object information includes behavioral information, attribute information, and activity information. Based on the positive and negative sample pairs, the recognition model can learn the semantic information between similar object information and the semantic information between dissimilar object information. This allows the trained recognition model to reduce the differences between object information of the same type and increase the differences between object information of different types when recognizing object information of the same type. This improves the accuracy of the target feature vector of the object information recognized by the recognition model, and thus improves the accuracy of object churn prediction based on the target feature vector.
[0074] Based on the above embodiments, Figure 2 A flowchart illustrating another model training method provided in this application embodiment is shown below. Figure 2 As shown, the method includes the following steps:
[0075] Step 201: Obtain the training sample set.
[0076] The explanation of the training samples can be found in the aforementioned embodiments, as the principle is the same, and will not be repeated here.
[0077] Step 202: For each training sample, input the training sample into the recognition model and output the target feature vector of each object information included in the positive sample pair and the target feature vector of each object information included in the negative sample pair.
[0078] The identification model includes at least two sub-networks that share parameters, and the network structures of the at least two sub-networks are also identical. For example, a model based on a twin network architecture.
[0079] As an example, this application embodiment uses an identification model that includes two sub-networks sharing parameters for illustration. For example... Figure 3 As shown, the two sub-networks are referred to as sub-network 1 and sub-network 2, respectively. Sub-network 1 and sub-network 2 both contain an input layer, a convolutional layer, and a fully connected layer. Sub-network 1 and sub-network 2 share parameters, meaning that the parameters of each layer in sub-network 1 and sub-network 2 are the same.
[0080] As an example, taking a positive sample pair as an input, the positive sample pair contains object information 1 of object 1 and object information 2 of object 2. The objects 1 and 2 corresponding to object information 1 and object information 2 are of the same category, that is, both are objects with the risk of churn, or both are objects without the risk of churn.
[0081] The object information 1 and object information 2 contained in the positive sample pair are input into sub-network 1 and sub-network 2 respectively. Since the parameters of sub-network 1 and sub-network 2 are the same, the implementation method of outputting the target feature vector of object information is the same. In this embodiment, sub-network 1 is used as an example for explanation.
[0082] The object information 1 is input into the input layer of sub-network 1. The input layer is used to extract features from the object information 1 to obtain the corresponding initial feature vector. Some of the behavioral, attribute, and activity information contained in the object information are numerical features, i.e., features that are numerical in the object information, such as the object's age, registration duration, financing period, investment amount, number of investments, and activity information. Features that are not numerical in the object information are categorical features, i.e., words, text, etc., such as gender, location, and membership level. For numerical features, normalization is performed to map the numerical range to 0-1 to obtain the corresponding feature vector; for categorical features, one-hot encoding is performed to obtain the corresponding feature vector. Then, the feature vectors contained in the object information are concatenated to obtain a 1*N feature vector, which is used as the initial feature vector of the object information.
[0083] It should be noted that the initial feature vector of the object information can be obtained by processing at the input layer of the recognition model, or it can be generated by other models or manually before being input into the recognition model. This embodiment does not impose any restrictions.
[0084] Then, the initial feature vector is input into a convolutional layer, which contains a first convolutional layer and a second convolutional layer. The first convolutional layer contains 16 1*5 convolutional kernels with a stride of 1 to downsample the input. The downsampled result is then input into the second convolutional layer, which contains 16 1*3 convolutional kernels with a stride of 1 for further downsampling. Finally, the downsampled result is passed through a fully connected layer, and the recognition network outputs the target feature vector of object information 1, such as... Figure 3 In the model, the 16 numerical values output by subnetwork 1 form a one-dimensional feature vector, which is used to distinguish the differences between objects.
[0085] As an example, the target feature vector input to the recognition model is a 1*128 vector. The first convolutional layer uses 16 1*5 convolutional kernels with a stride of 1, outputting 16 1*124 feature maps. A 1*2 max-pooling downsampling operation is then performed to obtain 16 1*62 feature maps. Next, a second convolutional layer uses 16 1*3 convolutional kernels with a stride of 1, outputting 16 1*60 feature maps. A 1*2 max-pooling downsampling operation is then performed to obtain 16 1*15 feature maps. Finally, a fully connected layer is passed, with an input of 16*15 = 240 and an output of 1*32. The recognition model outputs a vector, for example, a one-dimensional feature vector composed of 32 values, used to distinguish differences between users.
[0086] Similarly, the target feature vector corresponding to object information 2 in the positive sample pair can be obtained. Likewise, after inputting the negative sample pair into the recognition model, the target feature vector of the object information contained in the negative sample pair can also be obtained.
[0087] Step 203: Determine the first weight coefficient of the positive sample pair based on the target feature vector of each object information included in the positive sample pair.
[0088] In this embodiment, a first similarity is determined between objects of the same type in the positive sample pair based on the target feature vectors of each object information included in the positive sample pair, and a first weight coefficient is determined based on the first similarity. As one implementation, a cosine similarity is calculated based on the target feature vectors of the two object information included in the positive sample pair, and the reciprocal of the cosine similarity is used as the first weight coefficient for the third similarity of the positive sample pair.
[0089] The third similarity is determined differently from the first similarity. The third similarity can be the distance between the target feature vectors of two objects in a positive sample pair. This distance is based on the L2 norm.
[0090] As an example, a positive sample pair contains object information for object a and object p. The target feature vectors of object a and object p have high similarity. If the cosine similarity between the target feature vectors of object a and object p is 0.6, then the first weight coefficient w... pi =1 / 0.6 = 1.67. If the cosine similarity value is 0.8, then w pi =1 / 0.8 =1.25.
[0091] Step 204: Determine the second weighting coefficient of the negative sample pair based on the target feature vector of each object information included in the negative sample pair.
[0092] In this embodiment, a second similarity is determined between objects of different types in the negative sample pair based on the target feature vectors of each object information included in the negative sample pair, and a second weighting coefficient is determined based on the second similarity. As one implementation, cosine similarity is calculated based on the target feature vectors of the two object information included in the negative sample pair, and the reciprocal of the cosine similarity is used as the second weighting coefficient of the fourth similarity of the negative sample pair.
[0093] The fourth similarity is determined differently from the second similarity. The fourth similarity can be the distance between the target feature vectors of the two objects in the negative sample pair, which is a distance based on the L2 norm.
[0094] As an example, in a negative sample pair, objects a and n are of different types, meaning the similarity between the target feature vectors of object a and object n is low. If we calculate the cosine similarity between the target feature vectors of object a and object n, and the cosine similarity value is -0.6, then w ni =1 / |-0.7|=1.43, if the cosine similarity value is -0.5, then w ni =1 / |-0.8|=2.
[0095] Step 205: Determine the loss function based on the target feature vectors and first weight coefficients of each object information included in the positive sample pairs, and the target feature vectors and second weight coefficients of each object information included in the negative sample pairs.
[0096] In this embodiment, a third similarity is determined based on the target feature vectors of the two objects included in a positive sample pair. This third similarity is the distance between the target feature vectors of the two objects in the positive sample pair, which is a norm-based distance. Similarly, a fourth similarity is determined based on the target feature vectors of the two objects included in a negative sample pair. This fourth similarity is the distance between the target feature vectors of the two objects in the negative sample pair, which is also a norm-based distance.
[0097] Furthermore, a weighted operation is performed based on the third similarity and the first weight coefficient, as well as the fourth similarity and the second weight coefficient, to determine the loss function. In this embodiment, the first weight coefficient and the second weight coefficient can further reduce the gap between the target feature vectors of the object information included in the positive sample pair and increase the gap between the target feature vectors of the object information included in the negative sample pair, thereby improving the accuracy of the target feature vectors of the object information output by the recognition model.
[0098] The loss function satisfies the following relationship:
[0099]
[0100] Where B represents BatchSize, the number of training samples input each time, i represents the i-th training sample, and w pi w is the first weighting coefficient for positive sample pairs. ni The second weighting coefficient for negative sample pairs. The target feature vector of object a in the training sample. The target feature vector of object p in the training sample. This is the target feature vector of object n in the training samples.
[0101] As an example, the training samples contain three objects: object a, object p, and object n. Objects a and p are objects without churn risk, or non-churned objects; object n is an object with churn risk, or an object about to churn. Positive sample pairs include object information for object a and object information for object p, while negative sample pairs include object information for object a and object information for object n.
[0102] The target feature vector of object a output by the identification model is f(a) = (a1, a2, ..., a2). k The target feature vector of object p is f(p) = (p1, p2, ..., p2). k If the cosine similarity of the target feature vectors of objects a and p is greater than 0.5 (e.g., 0.6), it indicates a high similarity between them. Therefore, the target feature vectors f(a) and f(p) output by the recognition model should have a relatively small Euclidean distance, thus determining the first weight coefficient as 1.67. The target feature vector of object n is f(n) = (n1, n2, ..., nn...). k If the cosine similarity between the target feature vectors of object a and object n is less than -0.5, for example -0.8, it indicates that the similarity between object a and object n is low. Therefore, the output vectors f(a) and f(n) of the recognition model should have a relatively large Euclidean distance, and the second weight coefficient is determined to be 1.25.
[0103] Therefore, based on the formula for the loss function mentioned above, the value of the loss function can be calculated. Based on the value of the loss function, the parameters of the recognition model are adjusted. Then, the recognition model with adjusted parameters is used to perform recognition based on the training samples. Through continuous iteration, until the value of the loss function converges or the set number of iterations is reached, the recognition model training is completed.
[0104] In the model training method of this application embodiment, the first weight coefficient and the second weight coefficient can further reduce the gap between the target feature vectors of each object information included in the positive sample pair and increase the gap between the target feature vectors of each object information included in the negative sample pair, thereby improving the accuracy of the target feature vectors of the object information output by the recognition model.
[0105] Based on the above embodiments, this application provides another model training method. Figure 4 A flowchart illustrating another model training method provided in this application embodiment is shown below. Figure 4 As shown, the method includes the following steps:
[0106] Step 401: Obtain historical activity information of multiple second objects.
[0107] Among them, historical activity information refers to the behavioral information of the second object in the historical period before the current moment. The historical period can be the past 3 months. This behavioral information indicates the activity information of the second object, such as the time since the last login, the time since the last investment, the frequency of product browsing, and the user's growth information.
[0108] Specifically, user growth information includes:
[0109] Task completion data will be pushed to the user on the web or mobile application, such as mini-games or check-ins, to earn points. Daily task completion rate = number of daily tasks completed / total number of daily tasks; core task completion rate = number of core tasks completed / total number of core tasks. Based on the task completion rate, the user's growth or activity level can be determined.
[0110] Achievement data, based on the number of medals, titles, and rankings earned by the individual through various activities, determines the individual's growth or activity level.
[0111] Points data is used to determine an individual's growth or activity level based on the amount and frequency of points redemption and the amount and frequency of points redemption in the points mall.
[0112] Step 402: Determine the activity value of each second object based on its historical activity information.
[0113] One implementation method is to determine the activity level of each second object based on the mapping relationship between historical activity information and activity levels. For example, historical activity information includes the object's task completion rate; the higher the task completion rate, the higher the activity level. Thus, the corresponding activity level is determined based on the mapping relationship between task completion rate and the set activity level.
[0114] Step 403: Based on the activity value of each second object, determine the first object corresponding to the target activity level from multiple second objects.
[0115] The target activity level is at least one of multiple activity levels.
[0116] In this embodiment of the application, the activity value of each second object is determined based on the historical activity information of each second object. For each second object, the activity value corresponding to the second object is compared with a set value to determine the activity level corresponding to the second object. The second object corresponding to the target activity level is taken as the first object, thereby determining at least one first object corresponding to the target acquisition level.
[0117] In this embodiment of the application, the higher the historical activity information indicates the activity level of the second object, the higher the activity level. For example, the activity level is divided into two levels: low activity level and normal activity level.
[0118] In the first scenario, the target activity level includes the low activity level.
[0119] In the second scenario, the target activity level includes the normal activity level.
[0120] In the third scenario, the target activity level includes normal activity level and low activity level. Therefore, the objects corresponding to the target activity level are the objects corresponding to the normal activity level and the objects corresponding to the low activity level, which is the total number of objects.
[0121] In real-world scenarios, activity levels can also be categorized based on requirements, but this embodiment does not impose such a limitation.
[0122] Step 404: Obtain the object information of the first object corresponding to the target activity level.
[0123] The first object is at least one, including users in various real-world scenarios. For example, in a banking or investment banking scenario, the first object is a registered user, who can be a savings user, an investment user who purchases wealth management products, and so on.
[0124] In this embodiment, based on the user's historical data, including login data, purchase data, and data on completing related push tasks, which can indicate the user's activity level, the user can be divided into multiple activity levels, such as low activity level, medium activity level, or high activity level. The specific activity level division can be set based on the needs, and is not limited in this embodiment.
[0125] In this embodiment, the target activity level is one of multiple activity levels. For each activity level, multiple training samples are generated by using users of that activity level to train the recognition model corresponding to that activity level. This achieves the recognition model that can obtain multiple activity levels. The model of each activity level can be used for targeted recognition, or multiple activity level models can be used for joint recognition to increase the accuracy of recognition.
[0126] Step 405: Generate multiple training samples based on the object information of multiple first objects to form a training sample set.
[0127] In this embodiment of the application, the multiple first objects belonging to the target activity level include objects of the same type and objects of different types, wherein the type indicates whether the object has the risk of churn.
[0128] Step 406: Obtain the training sample set.
[0129] Step 407: For each training sample, input the training sample into the recognition model and output the target feature vector of each object information included in the positive sample pair and the target feature vector of each object information included in the negative sample pair.
[0130] Step 408: Determine the loss function based on the target feature vectors of each object information included in the positive sample pairs and the target feature vectors of each object information included in the negative sample pairs.
[0131] Step 409: Train the recognition model according to the loss function.
[0132] Steps 406-409 can be explained in the foregoing embodiments, as the principle is the same, and will not be repeated here.
[0133] In the model training method of this application embodiment, when training the recognition model, object information of the target activity level is used to generate training samples, and the recognition model is trained based on the training samples of the target activity level, so as to realize the recognition model that can obtain various activity levels and meet the model requirements of different scenarios.
[0134] Based on the above embodiments, in one implementation of the embodiments of this application, as follows: Figure 5As shown, after the recognition model is trained, the target feature vector of the object output by the recognition model is input into the classification model to train the classification model, so that the classification model can learn the object relationship between the target feature vector of the input object and the object's churn probability.
[0135] The classification model can be a logistic model.
[0136] Specifically, training samples are acquired, which include target feature information and annotation information of the objects to be identified. The annotation information is the type label of the objects to be identified, with 1 being the type label for churned objects and 0 being the type label for non-churned objects. The target feature information is input into the classification model, and through supervised learning, the target feature vector of the objects to be identified is learned, which is the weight w of each dimension of the differential feature vector of the objects to be identified. i The target feature vector, along with the bias term b, passes through a parameter sharing layer and a difference measurement layer, and is ultimately calculated using the sigmoid function to obtain a churn probability value y within the range of (0,1). If y approaches 0, the user to be identified has a low churn probability and is considered a non-churning user; if y approaches 1, the user to be identified has a high churn probability and is identified as a user at risk of churn. The probability value y satisfies the following relationship:
[0137]
[0138] in, f(x) i For each dimension of the feature vector, K is the number of dimensions of the feature vector, and w i Here are the weights for each dimension.
[0139] In this embodiment, the accurate target feature vector output by the recognition model for each activity level is used as a training sample to train the corresponding classification model. This achieves the training of the classification model for the object at that activity level, improves the convergence speed of the classification model, reduces the difficulty of training the classification model, and improves the accuracy of the classification model.
[0140] Based on the above embodiments, Figure 6 This is a flowchart illustrating an object churn prediction method provided in an embodiment of this application, as shown below. Figure 6 As shown, the method includes the following steps:
[0141] Step 601: Obtain the object information of the target object.
[0142] The object information includes behavioral information, attribute information, and activity information.
[0143] The target group refers to the group whose churn risk needs to be predicted.
[0144] The object information can be referred to the explanation in the foregoing embodiments, as the principle is the same, and will not be repeated here.
[0145] Step 602: Input the object information into the recognition model of at least one activity level obtained through training, and obtain the target feature vector of the object information output by the recognition model of each activity level.
[0146] In the aforementioned embodiments, training samples were generated using objects at each activity level to complete the training of recognition models for each activity level. The training method can be referred to the explanation in the aforementioned embodiments, and is not limited in this embodiment.
[0147] As an example, there are at least three activity levels, referred to as activity level 1, activity level 2 and activity level 3, respectively. The corresponding trained recognition models are recognition model 1, recognition model 2 and recognition model 3. In this embodiment, the object information of the target object is input into recognition model 1, recognition model 2 and recognition model 3 respectively, and the target feature vector 1, target feature vector 2 and target feature vector 3 of the object information of the target object are output.
[0148] Step 603: Determine at least one churn probability of the target object based on the target feature vector of the object information output by the recognition model for each activity level.
[0149] In this embodiment of the application, the target feature vector of the object information output by the recognition model for each activity level is used to determine the churn probability of the target object.
[0150] As an example, for target feature vector 1, target feature vector 2, and target feature vector 3, target feature vector 1 is input into the trained classification model to obtain the churn probability 1 output by the classification model. Similarly, the churn probability 2 determined based on target feature vector 2 and the churn probability 3 determined based on target feature vector 3 are obtained. The training method of the classification model can be referred to the explanation in the previous embodiments, and the principle is the same, so it will not be repeated here.
[0151] Step 604: Determine the churn risk of the second object based on at least one churn probability of the target object.
[0152] In this embodiment of the application, each churn probability of the target object is compared with a set probability. If the proportion of churn probabilities greater than the set probability is greater than the set proportion, it is determined that the target object has a churn risk; if the proportion of churn probabilities greater than the set probability is less than or equal to the set proportion, it is determined that the target object does not have a churn risk.
[0153] As an example, based on the churn probabilities 1, 2, and 3 corresponding to the target object, each is compared with a set probability. If churn probability 1 is greater than the set probability, churn probability 3 is greater than the set probability, and churn probability 2 is less than or equal to the set probability, then the percentage of churn probabilities greater than the set probability is two-thirds, or 67%, which is greater than the set percentage of 60%. Therefore, the target object is determined to have a churn risk, and relevant personnel need to intervene to prevent churn. If churn probability 1 is greater than the set probability, churn probability 3 is less than or equal to the set probability, and churn probability 2 is less than or equal to the set probability, then the percentage of churn probabilities greater than the set probability is one-third, or 33%, which is less than the set percentage of 60%. Therefore, the target object is determined not to have a churn risk. By using a recognition model corresponding to multiple activity levels to identify target feature vectors, and based on the identified target feature vectors, the churn risk of the target object is identified, improving the accuracy of prediction.
[0154] It is important to understand that when using a recognition model to identify target feature vectors, the recognition model can be trained based on training samples generated from objects with various activity levels, in order to improve the recognition model's ability to accurately identify various types of objects.
[0155] In the object churn prediction method of this application embodiment, the object information of the target object is processed by a recognition model with at least one activity level trained to obtain various target feature vectors of the target object. Since the recognition models of various activity levels reduce the difference between target feature vectors of similar objects and increase the difference between target feature vectors of dissimilar objects during the training process, the recognition models of various activity levels trained can output accurate target feature vectors of the target object. Then, classification is performed based on each target feature vector, which improves the accuracy of classification. At the same time, a comprehensive judgment based on the prediction results of multiple models is realized, which improves the prediction accuracy.
[0156] To implement the above embodiments, this application also proposes a model training device.
[0157] Figure 7 This is a schematic diagram of the structure of a model training device provided in an embodiment of this application.
[0158] like Figure 7 As shown, the device may include:
[0159] The acquisition module 71 is used to acquire a training sample set; wherein each training sample includes a positive sample pair and a negative sample pair; the positive sample pair includes object information of objects of the same type; the negative sample pair includes object information of objects of different types; the object information includes behavioral information, attribute information and activity information;
[0160] The recognition module 72 is used to input the training sample into the recognition model for each training sample and output the target feature vector of each object information included in the positive sample pair and the target feature vector of each object information included in the negative sample pair.
[0161] The determination module 73 is used to determine a loss function based on the target feature vectors of each object information included in the positive sample pair and the target feature vectors of each object information included in the negative sample pair.
[0162] Training module 74 is used to train the recognition model according to the loss function.
[0163] Furthermore, in one implementation of this application embodiment, the apparatus further includes:
[0164] The generation module is used to obtain object information of a first object corresponding to the target activity level; and generate multiple training samples based on the object information of the first object to form the training sample set.
[0165] In one implementation of this application, the identification model includes at least two sub-networks that share parameters.
[0166] In one implementation of this application embodiment, the determining module 73 is specifically used for:
[0167] Based on the target feature vectors of each object information included in the positive sample pair, determine the first weight coefficient of the positive sample pair;
[0168] The second weighting coefficient of the negative sample pair is determined based on the target feature vector of each object information included in the negative sample pair.
[0169] The loss function is determined based on the target feature vectors of each object information included in the positive sample pair and the first weight coefficient, and the target feature vectors of each object information included in the negative sample pair and the second weight coefficient.
[0170] In one implementation of this application embodiment, the determining module 73 is specifically used for:
[0171] Based on the target feature vectors of each object information included in the positive sample pair, a first similarity is determined between objects of the same type in the positive sample pair; based on the first similarity, a first weight coefficient is determined.
[0172] In one implementation of this application embodiment, the determining module 73 is further configured to:
[0173] Based on the target feature vectors of the object information included in the negative sample pair, a second similarity between different types of objects in the negative sample pair is determined; based on the second similarity, a second weight coefficient is determined.
[0174] In one implementation of this application, the generation module is specifically used for:
[0175] Retrieve historical activity information of multiple secondary objects;
[0176] Based on the historical activity information of each of the second objects, determine the activity value of each of the second objects;
[0177] Based on the activity value of each of the second objects, a first object corresponding to the target activity level is determined from a plurality of second objects.
[0178] It should be noted that the foregoing explanation of the method embodiments also applies to the apparatus of this embodiment, and will not be repeated here.
[0179] In the model training device of this application embodiment, positive samples are constructed based on object information of objects of the same type, and negative samples are constructed based on object information of objects of different types. The object information includes behavioral information, attribute information, and activity information. Based on the object information contained in the positive samples and the object information contained in the negative samples, the recognition model can learn the semantic information between similar object information and the semantic information between dissimilar object information. This allows the trained recognition model to reduce the differences between object information of the same type and increase the differences between object information of different types when recognizing object information of the same type, thereby improving the accuracy of the target feature vector of the object information recognized by the recognition model, and thus improving the accuracy of object churn prediction based on the target feature vector.
[0180] To achieve the above embodiments, this application also proposes an object churn prediction device.
[0181] Figure 8 This is a schematic diagram of the structure of an object loss prediction device provided in an embodiment of this application.
[0182] like Figure 8 As shown, the device may include:
[0183] The acquisition module 81 is used to acquire object information of the target object; wherein, the object information includes behavior information, attribute information and activity information.
[0184] The recognition module 82 is used to input the object information into a recognition model of at least one activity level obtained through training, and to obtain the target feature vector of the object information output by the recognition model of each activity level.
[0185] The first determining module 83 is used to determine at least one churn probability of the target object based on the target feature vector of the object information output by the recognition model of each activity level.
[0186] The second determining module 84 is used to determine the churn risk of the target object based on at least one churn probability of the target object.
[0187] Furthermore, in one implementation of this application embodiment, the second determining module 84 is specifically used for:
[0188] Compare the churn probability of each target object with the set probability;
[0189] If the percentage of cases where the churn probability is greater than the set probability is greater than the set percentage, then the target object is determined to be at risk of churn.
[0190] If the percentage of the churn probability being greater than the set probability is less than or equal to the set percentage, it is determined that the target object does not have a churn risk.
[0191] It should be noted that the foregoing explanation of the method embodiments also applies to the apparatus of this embodiment, and will not be repeated here.
[0192] In the object churn prediction device of this application embodiment, the object information of the target object is processed by a recognition model of at least one activity level trained to obtain various target feature vectors of the target object. Since the recognition models of various activity levels are trained by reducing the difference between target feature vectors of similar objects and increasing the difference between target feature vectors of dissimilar objects, the recognition models of various activity levels can output accurate target feature vectors of the target object. Then, classification is performed based on each target feature vector, which improves the accuracy of classification. At the same time, a comprehensive judgment based on the prediction results of multiple models is realized, which improves the prediction accuracy.
[0193] To implement the above embodiments, this application also proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements the method described in the foregoing method embodiments.
[0194] To implement the above embodiments, this application also proposes a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method described in the foregoing method embodiments.
[0195] To implement the above embodiments, this application also proposes a computer program product having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in the foregoing method embodiments.
[0196] Figure 9 This is a block diagram of an electronic device provided in an embodiment of this application. (For example...) Figure 9 As shown, the electronic device 10 includes a processor 11, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 12 or a program loaded from a memory 16 into a random access memory (RAM) 13. The RAM 13 also stores various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0197] The following components are connected to I / O interface 15: memory 16 including hard disks, etc.; and communication section 17 including network interface cards such as LAN (Local Area Network) cards, modems, etc., which performs communication processing via a network such as the Internet; and driver 18 is also connected to I / O interface 15 as needed.
[0198] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via the communication section 17. When the computer program is executed by the processor 11, it performs the functions defined in the methods of this application.
[0199] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory 16 including instructions, which can be executed by a processor 11 of an electronic device 10 to perform the above-described method. Optionally, the storage medium may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.
[0200] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0201] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0202] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0203] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0204] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0205] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0206] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0207] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. A model training method, characterized in that, include: Obtain a training sample set; wherein each training sample includes a positive sample pair and a negative sample pair; the positive sample pair includes object information of objects of the same type; the negative sample pair includes object information of objects of different types; the object information includes behavioral information, attribute information, and activity information; the type indicates whether the user is at risk of churn or not. For each training sample, the training sample is input into the recognition model, and the target feature vectors of each object information included in the positive sample pair and the target feature vectors of each object information included in the negative sample pair are output. The loss function is determined based on the target feature vectors of each object information included in the positive sample pair and the target feature vectors of each object information included in the negative sample pair. The recognition model is trained according to the loss function; Before obtaining the training sample set, historical activity information of multiple second objects is also obtained; based on the historical activity information of each second object, the activity value of each second object is determined; based on the activity value of each second object, a first object corresponding to the target activity level is determined from the multiple second objects; object information of the first object corresponding to the target activity level is obtained; and based on the object information of the first object, multiple training samples are generated to constitute the training sample set; wherein, the first object includes users in various real-world scenarios.
2. The method as described in claim 1, characterized in that, The recognition model includes at least two sub-networks that share parameters.
3. The method as described in claim 1, characterized in that, The step of determining the loss function based on the target feature vectors of each object information included in the positive sample pair and the target feature vectors of each object information included in the negative sample pair includes: Based on the target feature vectors of each object information included in the positive sample pair, determine the first weight coefficient of the positive sample pair; The second weighting coefficient of the negative sample pair is determined based on the target feature vector of each object information included in the negative sample pair. The loss function is determined based on the target feature vectors of each object information included in the positive sample pair and the first weight coefficient, and the target feature vectors of each object information included in the negative sample pair and the second weight coefficient.
4. The method as described in claim 3, characterized in that, Determining the first weight coefficient of the positive sample pair based on the target feature vectors of each object information included in the positive sample pair includes: Based on the target feature vectors of each object information included in the positive sample pair, determine the first similarity between objects of the same type in the positive sample pair; The first weight coefficient is determined based on the first similarity.
5. The method as described in claim 3, characterized in that, The step of determining the second weight coefficient of the negative sample pair based on the target feature vector of each object information included in the negative sample pair includes: Based on the target feature vectors of each object information included in the negative sample pair, determine the second similarity between different types of objects in the negative sample pair; The second weighting coefficient is determined based on the second similarity.
6. A method for predicting customer churn, characterized in that, include: Obtain object information of the target object; wherein, the object information includes behavioral information, attribute information, and activity information; The object information is input into a recognition model of at least one activity level trained using the method described in any one of claims 1-5, to obtain the target feature vector of the object information output by the recognition model of each activity level. Based on the target feature vector of the object information output by the recognition model for each of the activity levels, determine at least one churn probability of the target object; The churn risk of the target object is determined based on at least one churn probability of the target object.
7. The method as described in claim 6, characterized in that, Determining the churn risk of the target object based on at least one churn probability of the target object includes: Compare the churn probability of each target object with the set probability; If the percentage of cases where the churn probability is greater than the set probability is greater than the set percentage, then the target object is determined to be at risk of churn. If the percentage of the churn probability being greater than the set probability is less than or equal to the set percentage, it is determined that the target object does not have a churn risk.
8. A model training device, characterized in that, include: The acquisition module is used to acquire a training sample set; wherein each training sample includes a positive sample pair and a negative sample pair; the positive sample pair includes object information of objects of the same type; the negative sample pair includes object information of objects of different types; the object information includes behavioral information, attribute information and activity information; the type indicates whether the user has the risk of churn or not. The recognition module is used to input the training sample into the recognition model for each training sample and output the target feature vector of each object information included in the positive sample pair and the target feature vector of each object information included in the negative sample pair. The determination module is used to determine the loss function based on the target feature vectors of each object information included in the positive sample pair and the target feature vectors of each object information included in the negative sample pair. The training module is used to train the recognition model according to the loss function; The generation module is used to acquire historical activity information of multiple second objects before acquiring the training sample set; determine the activity value of each second object based on the historical activity information of each second object; determine the first object corresponding to the target activity level from the multiple second objects based on the activity value of each second object; acquire the object information of the first object corresponding to the target activity level; and generate multiple training samples based on the object information of the first object to constitute the training sample set; wherein, the first object includes users in various real-world scenarios.
9. An object churn prediction device, characterized in that, include: The acquisition module is used to acquire object information of the target object; wherein, the object information includes behavioral information, attribute information, and activity information; The recognition module is used to input the object information into a recognition model of at least one activity level trained by the method described in any one of claims 1-5, and obtain the target feature vector of the object information output by the recognition model of each activity level. The first determining module is used to determine at least one churn probability of the target object based on the target feature vector of the object information output by the recognition model of each activity level; The second determining module is used to determine the churn risk of the target object based on at least one churn probability of the target object.
10. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements the method as described in any one of claims 1-7.
11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-7.
Citation Information
Patent Citations
A pedestrian re-identification task-oriented data expansion method based on a paired sample random occlusion strategy
CN109670528A
Subject extraction method and device based on artificial intelligence, electronic equipment and medium
CN114398877A