Behavior prediction method, model training method and related devices thereof
By constructing a causal model to predict the probability of users' behavior when they have not received information, and fitting function parameters based on user characteristics, the problem of traditional methods not considering the influence of external intervention factors is solved, and the accuracy of behavior prediction and decision-making optimization capabilities are improved.
Patent Information
- Application Number
- CN202510653660.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-09-23
AI Technical Summary
Traditional behavior prediction methods fail to fully consider the impact of external intervention factors on the probability of behavior occurrence, resulting in reduced prediction accuracy under intervention conditions.
By building a causal model, we can predict the probability of users’ behavior when they do not receive information, fit function parameters based on user characteristics, calculate the probability of behavior after intervention, and improve prediction accuracy.
It improves the accuracy of behavior prediction, can better consider the impact of external intervention factors on user behavior, and optimize advertising delivery and decision-making.
Smart Images

Figure CN120687929A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to data processing technology, and in particular to a behavior prediction method, a model training method and related devices. Background Art
[0002] Traditional behavior prediction methods often focus solely on users' natural behavior, ignoring the impact of external interventions on the probability of a behavior. However, in real-world scenarios, interventions such as promotional campaigns in marketing and policy adjustments in risk management are common and can significantly alter the probability of a user's behavior. Consequently, the accuracy of behavior prediction methods in related technologies decreases when subject to intervention. Summary of the Invention
[0003] The embodiments of the present application provide a behavior prediction method, a model training method and related devices, which can improve the accuracy of behavior prediction.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] This embodiment of the present application provides a behavior prediction method, the method comprising:
[0006] In a case where the first user has not received the first information, predicting a first probability of the first user's behavior occurring based on the first feature of the first user;
[0007] Predicting a parameter value of a first function based on the first feature to obtain a first parameter value, wherein the first function represents a relationship to be fitted between the first probability and a second probability, and the second probability is a probability of the first user's behavior occurring when the first user receives the first information;
[0008] Calculating a second function according to the first parameter value and the first function;
[0009] The second probability is determined based on the first probability and the second function.
[0010] The present invention provides a model training method, which includes:
[0011] Using the second model, when the first sample user has not received the first sample information, based on the sample characteristics of the first sample user, predict a third probability of the first sample user's behavior occurring;
[0012] Based on the sample characteristics, a parameter value of a third function is predicted to obtain a second parameter value, wherein the third function represents a relationship to be fitted between the third probability and a fourth probability, and the fourth probability is a probability of the first sample user's behavior occurring when the first sample user receives the first sample information;
[0013] Calculating a fourth function according to the second parameter value and the third function;
[0014] determining the fourth probability based on the third probability and the fourth function;
[0015] The second model is trained based on the third probability, the fourth probability, and the behavior label of the first sample user.
[0016] The present invention provides a behavior prediction device, comprising:
[0017] a probability prediction module, configured to predict a first probability of occurrence of a behavior of the first user based on a first feature of the first user when the first user has not received the first information;
[0018] a parameter prediction module, configured to predict a parameter value of a first function based on the first feature to obtain a first parameter value, wherein the first function represents a relationship to be fitted between the first probability and a second probability, and the second probability is a probability of the first user's behavior occurring when the first user receives the first information;
[0019] a calculation module, configured to calculate a second function based on the first parameter value and the first function;
[0020] A determination module is configured to determine the second probability based on the first probability and the second function.
[0021] The present invention provides a model training device, comprising:
[0022] a probability prediction module, configured to predict, by using a second model, a third probability of the first sample user's behavior occurring based on the sample characteristics of the first sample user when the first sample user has not received the first sample information;
[0023] a parameter prediction module, configured to predict a parameter value of a third function based on the sample characteristics to obtain a second parameter value, wherein the third function represents a relationship to be fitted between the third probability and a fourth probability, the fourth probability being a probability of the first sample user's behavior occurring upon receiving the first sample information;
[0024] a calculation module, configured to calculate a fourth function based on the second parameter value and the third function;
[0025] a determining module, configured to determine the fourth probability based on the third probability and the fourth function;
[0026] A training module is used to train the second model based on the third probability, the fourth probability and the behavior label of the first sample user.
[0027] An embodiment of the present application provides an electronic device, comprising:
[0028] a memory for storing computer-executable instructions or computer programs;
[0029] The processor is used to implement the behavior prediction method or model training method provided in the embodiment of the present application when executing the computer executable instructions or computer program stored in the memory.
[0030] An embodiment of the present application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the behavior prediction method or model training method provided in the embodiment of the present application when executed by a processor.
[0031] An embodiment of the present application provides a computer program product, including a computer program or computer-executable instructions. When the computer program or computer-executable instructions are executed by a processor, the behavior prediction method or model training method provided in the embodiment of the present application is implemented.
[0032] The embodiments of the present application have the following beneficial effects:
[0033] In the case that the first user has not received the first information, the first probability of the first user's behavior is predicted based on the first feature of the first user, providing a benchmark reference for subsequent analysis; the parameter value of the first function is predicted based on the first feature to obtain the first parameter value, and the second function is calculated based on the obtained first parameter value and the first function, so that the second function can accurately characterize the fitting relationship between the first probability and the second probability of the first user's behavior when receiving the first information; the second probability is calculated based on the second function and the first probability, so as to fully consider the impact of the first information on the user's behavior and improve the accuracy of behavior prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 Schematic diagram of the behavior prediction system provided in the embodiment of the present application;
[0035] Figure 2 is a structural diagram of an electronic device provided in an embodiment of the present application;
[0036] Figure 3 This is a flow diagram of the behavior prediction method provided in the embodiment of the present application. Figure 1 ;
[0037] Figure 4 This is a flow diagram of the behavior prediction method provided in the embodiment of the present application. Figure 2 ;
[0038] Figure 5 This is a flow diagram of the behavior prediction method provided in the embodiment of the present application. Figure 3 ;
[0039] Figure 6 This is a flow diagram of a model training method provided by another embodiment of the present application. Figure 1 ;
[0040] Figure 7 This is a flow diagram of a model training method provided by another embodiment of the present application. Figure 2 ;
[0041] Figure 8 This is a flow diagram of a model training method provided by another embodiment of the present application. Figure 3 ;
[0042] Figure 9 This is a flow diagram of a model training method provided by another embodiment of the present application. Figure 4 ;
[0043] Figure 10 This is a flowchart of the construction and application of the intervention increment model provided in the embodiment of the present application;
[0044] Figure 11 This is a flowchart for obtaining the natural conversion probability of all users provided by the embodiment of the present application;
[0045] Figure 12 This is a linear relationship diagram between the conversion rate of users under intervention and the natural conversion rate provided by the embodiment of the present application;
[0046] Figure 13 This is a polynomial relationship diagram between the conversion rate of users under intervention and the natural conversion rate provided in the embodiment of the present application;
[0047] Figure 14 This is a network structure diagram of the intervention increment model provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solutions and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0049] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0050] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0051] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0052] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0053] The relevant data collection and processing in the embodiments of this application should be strictly in accordance with the requirements of relevant laws and regulations when applied in examples, and the informed consent or separate consent of the personal information subject should be obtained. Subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the personal information subject.
[0054] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0055] 1) Causal inference: This involves studying how to more scientifically identify causal relationships between variables and estimate the differences in outputs of the same individual with and without intervention (mutually exclusive conditions).
[0056] 2) Causal Model: A causal model is a mathematical model that reflects the non-corresponding relationship between two variables, x and y. Causal models include unidirectional causal relationship models and multidirectional causal relationship models.
[0057] 3) Uplift Model: The Uplift Model is a causal inference model used to estimate the uplift of intervention (i.e., the difference in an individual's response between an intervention and a non-intervention). It is used to evaluate the additional effects of intervention actions (such as promotional activities, coupon distribution, etc.) on user behavior (such as purchases, conversions, etc.).
[0058] 4) Organic Conversion Rate: This is the percentage of users who spontaneously initiate purchases or conversions without any external intervention. Organic conversion rates typically reflect factors such as the appeal of the product or service, the fit between user needs and the product, and user experience.
[0059] 5) Conversion rate increment: refers to the additional conversion rate compared to the natural conversion rate after implementing specific promotional methods (such as advertising, promotional activities, content marketing, etc.).
[0060] 6) Activation function (Sigmoid), used in the output layer or hidden layer of a neural network. Activation functions map all real numbers to the interval (0, 1), normalizing the data. The Sigmoid function plays an important role in the output layer of regression prediction and binary classification models.
[0061] 7) Multi-Layer Perceptron (MLP): It is a feed-forward neural network that performs nonlinear transformation and combination of input features through multiple hidden layers.
[0062] 8) Coefficient of determination (R 2 ): It is the core indicator for evaluating the goodness of fit of the model. Its value range is [0,1], which indicates the proportion of the variability of the target variable (such as intervention conversion rate y) that the model can explain. 2 =1, the model fits the data perfectly; R 2 = 0, the model is equivalent to directly taking the mean prediction. For example: input the paired data of the non-intervention conversion rate x and the post-intervention conversion rate y, the system fits the linear, exponential and polynomial models in turn, and calculates the R of each model. 2 The values are compared and the formula of the optimal model and the fitting curve are output.
[0063] In the related art, the Uplift model is based on the principle of causal inference, and estimates the individual treatment effect (ITE) of each user by comparing the data of the experimental group (receiving intervention) and the control group (not receiving intervention). In the process of calculating the conversion rate y after the implementation of the intervention, the features can be used to directly estimate the conversion rate y after the intervention (such as models S-Learner, T-Learner, etc.), or the conversion rate y after the intervention can be expressed as an increment y0+ (such as model EUEN). In actual promotion scenarios, the effect of the intervention on the user has a certain positive correlation with the user's natural conversion rate. The related art does not explicitly take into account the increment. Even if the increment is taken into account, the increment is not refined as a function of the natural conversion rate, and the intervention increment value cannot be modeled more carefully and accurately.
[0064] Based on the problems existing in the related art, the embodiments of the present application provide a behavior prediction method, a model training method and related devices, which can improve the accuracy of behavior prediction. The following describes an exemplary application of the behavior prediction device provided in the embodiment of the present application, which is an electronic device for implementing the behavior prediction method. The electronic device provided in the embodiment of the present application can be implemented as various types of terminals such as laptops, tablet computers, desktop computers, set-top boxes, smart phones, smart speakers, smart watches, smart TVs, and car terminals, and can also be implemented as servers. Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal and the server can be directly or indirectly connected by wired or wireless communication, which is not limited in the embodiments of the present application. Below, an exemplary application of the behavior prediction device when it is implemented as a terminal or a server will be described.
[0065] See also Figure 1 , Figure 1It is a schematic diagram of the architecture of the behavior prediction system provided in the embodiment of the present application. In order to perform the behavior prediction operation, a behavior prediction application can be provided. For example, the behavior prediction application can be an application dedicated to behavior prediction, or it can be a functional module in other applications (such as a behavior prediction module in a financial application, etc.). The behavior prediction system 100 in the embodiment of the present application includes at least a terminal 400, a network 300 and a server 200, wherein the server 200 is a server for the behavior prediction application. The server 200 can constitute the behavior prediction device in the embodiment of the present application, that is, the behavior prediction method in the embodiment of the present application is implemented through the server 200. The terminal 400 is connected to the server 200 via the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.
[0066] See also Figure 1 , the user can perform interactive operations on the client of the behavior prediction application through the terminal 400. After receiving the user's interactive operation, the client can encapsulate the terminal identifier or client identifier into the behavior prediction request, and send the behavior prediction request to the server 200 through the terminal 400. In response to the received behavior prediction request, the server 200 predicts the first probability of the first user's behavior based on the first feature of the first user when the first user has not received the first information; the server 200 predicts the parameter value of the first function based on the first feature to obtain the first parameter value, wherein the first function characterizes the relationship to be fitted between the first probability and the second probability, and the second probability is the probability of the first user's behavior occurring when the first user receives the first information; the server 200 calculates the second function based on the first parameter value and the first function; the server 200 determines the second probability based on the first probability and the second function. After obtaining the second probability, the server 200 can send the first probability and the second probability to the terminal 400. The terminal 400 displays the first probability and the second probability on the current interface.
[0067] In some embodiments, the behavior prediction method of the embodiment of the present application can also be executed by the terminal 400, that is, when the first user has not received the first information, based on the first feature of the first user, predict the first probability of the first user's behavior occurring; the terminal 400 predicts the parameter value of the first function based on the first feature to obtain the first parameter value, wherein the first function represents the relationship to be fitted between the first probability and the second probability, and the second probability is the probability of the first user's behavior occurring when the first user receives the first information; the terminal 400 calculates the second function based on the first parameter value and the first function; and the terminal 400 determines the second probability based on the first probability and the second function. The terminal 400 displays the first probability and the second probability on the current interface.
[0068] In the promotion scenario, the promotion platform hopes to increase the user's purchase probability through advertising. In order to optimize the allocation of advertising budget, it is necessary to predict the changes in user behavior before and after the advertisement is placed. The user's age, gender, browsing history, click behavior, etc. are used as the first feature, and the first feature is used to predict the user's purchase probability (first probability) when the advertisement (first information) is not received. Construct a first function to describe the impact of advertising intervention on the user's purchase probability, and based on the first feature, predict the parameter value of the first function to obtain the first parameter value, and calculate the second function based on the first parameter value and the first function. Using the second function and the first probability, calculate the user's purchase probability (second probability) when the advertisement is received. Based on the predicted purchase probability of the user before receiving the advertisement and the purchase probability when receiving the advertisement, determine whether to place an advertisement for the user, give priority to high-potential users for advertising, and optimize the allocation of advertising budget.
[0069] In a healthcare scenario, a hospital wants to evaluate the impact of a new therapy on the patient's probability of recovery in order to decide whether to promote the therapy. The patient's age, medical history, severity of illness, lifestyle habits, etc. are used as the first feature, and the first feature is used to predict the patient's probability of recovery (first probability) before receiving the new therapy (first information). A first function is constructed to describe the impact of the new therapy on the patient's probability of recovery, and the first parameter value of the first function is predicted through the first feature. The second function is calculated based on the first parameter value and the first function. Using the second function and the first probability, the patient's probability of recovery after receiving the new therapy (second probability) is calculated. Based on the prediction results, the patient group most suitable for the new therapy is screened out.
[0070] In some embodiments, the electronic device may be Figure 1 Terminal 400 in Figure 2 , Figure 2 is a structural diagram of an electronic device provided in an embodiment of the present application, Figure 2 The electronic device shown includes: at least one processor 410, a memory 450, at least one network interface 420 and a user interface 430. The various components in the electronic device are coupled together via a bus system 440. It is understood that the bus system 440 is used to achieve connection and communication between these components. In addition to including a data bus, the bus system 440 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 440 is not shown in FIG. Figure 2 Various buses are labeled as bus system 440 .
[0071] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0072] The user interface 430 includes one or more output devices 431 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0073] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.
[0074] The memory 450 includes volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.
[0075] In some embodiments, the memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplified below.
[0076] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, and driver layer, which are used to implement various basic services and process hardware-based tasks;
[0077] A network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include Bluetooth, Wi-Fi, and Universal Serial Bus (USB);
[0078] a presentation module 453 for enabling presentation of information via one or more output devices 431 (e.g., a display screen, a speaker, etc.) associated with the user interface 430 (e.g., a user interface for operating peripheral devices and displaying content and information);
[0079] The input processing module 454 is configured to detect one or more user inputs or interactions from one of the one or more input devices 432 and to translate the detected inputs or interactions.
[0080] In some embodiments, the apparatus provided in the embodiments of the present application may be implemented in software. Figure 2 The behavior prediction device 455 stored in the memory 450 is shown. This device can be software in the form of a program or plug-in, and includes the following software modules: a probability prediction module 4551, a parameter prediction module 4552, a calculation module 4553, and a determination module 4554. These modules are logical and can be arbitrarily combined or further separated according to the functions they implement. The functions of each module will be described below.
[0081] In other embodiments, the device provided in the embodiments of the present application can be implemented in hardware. As an example, the device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the behavior prediction method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs) or other electronic components.
[0082] See also Figure 3 , Figure 3 This is a flow diagram of the behavior prediction method provided in the embodiment of the present application. Figure 1 , will combine Figure 3 The steps shown are explained as Figure 3 As shown, the behavior prediction method is described as an example in which the execution subject is a server. The method includes the following steps 101 to 104:
[0083] In step 101, when the first user has not received the first information, a first probability of the first user's behavior occurring is predicted based on the first feature of the first user.
[0084] Here, the first user is the user for whom behavior prediction is needed, such as a potential purchaser in a promotional scenario. The first feature is data describing the first user's attributes or historical behavior, which may include the first user's age, gender, geographic location, browsing history, click behavior, conversion behavior, and purchase behavior. The first information is information sent to the first user intended to trigger or influence the first user's behavior. The first information has a clear goal, such as guiding the first user to complete a certain conversion behavior (such as a click, purchase, registration, etc.). The first information may include promotional information (such as advertisements, promotional activities, coupon issuance, discount notifications, etc.), interactive information (such as order status updates, logistics reminders, event invitations, member benefits notifications, etc.), and recommendation information (such as product, service, or content recommendations generated based on user interests or historical behavior). If the first user does not receive the first information, that is, the first user has not been interfered with, the first probability is the predicted probability that the first user will engage in the target behavior (such as purchasing a product, clicking, converting, etc.) in the absence of interference.
[0085] For example, in a promotion platform predicting whether a user will purchase a product, the first user is a 30-year-old woman living in City A. In the past month, she browsed a mobile phone page 10 times and added the phone to her shopping cart once. The first characteristics of the first user include: Age = 30, Gender = Female, Number of Views = 10, and Number of Add-to-Carts = 1. Based on these first characteristics, the prediction results show that the first probability of the first user purchasing the phone is 20%, assuming the first user does not receive any advertising information related to the phone (the first information).
[0086] In some embodiments, the behavior prediction method is implemented through a first model. The first model is a pre-trained model for predicting the probability of user behavior. The embodiment of the application does not limit the type of the first model, for example, it can be a machine learning model, a neural network model, etc.
[0087] In some embodiments, see Figure 4 , Figure 4 It shows that the first probability of the first user's behavior occurring is predicted based on the first feature of the first user in step 101, which can be achieved by the following steps 1011 to 1013:
[0088] In step 1011, the first feature is encoded to obtain a first encoding vector.
[0089] Here, the first encoded vector is a numerical vector representation of the first feature after encoding. Discrete features within the first feature (such as gender and location) are one-hot encoded or embedded, and continuous features within the first feature (such as age and number of views) are normalized or standardized to obtain the first encoded vector.
[0090] For example, the first feature is a user feature: age = 30, gender = female, number of views = 10, and number of added to cart = 1. The encoding process for the first feature is as follows: gender (a discrete feature) is one-hot encoded, with female represented as [0, 1]. Age (a continuous feature) is normalized to the range [0, 1], with 30 years old represented as 0.6. The number of views and number of added to cart are directly input as numerical values, resulting in the first encoded vector [0.6, 0, 1, 10, 1].
[0091] It should be noted that the first model includes a first network and a second network. The first network is used to predict a first probability of the first user's behavior occurring, and the second network is used to predict the parameter value of the first function to obtain the first parameter value. The first feature can be encoded by the first network in the first model to obtain a first encoded vector.
[0092] In some embodiments, the step of encoding the first feature to obtain the first encoded vector may not be performed by the first network. The first model may further include an encoding layer, where the encoding layer in the first model encodes the first feature to obtain the first encoded vector. The first encoded vector is input into the first network in the first model, so that the first network predicts the first probability of the first user's behavior occurring based on the first encoded vector.
[0093] In step 1012, mapping processing is performed on the first encoding vector to obtain a second encoding vector.
[0094] Here, the first code vector can be mapped using the first network in the first model to obtain the second code vector. The first network can include a multilayer perceptron (MLP), which can be composed of one or more fully connected layers. The mapping process for the first code vector involves performing a linear transformation on the first code vector using a weight matrix and a bias term in the fully connected layer of the first network to obtain the second code vector.
[0095] Exemplarily, mapping processing is performed on the first coding vector [0.6, 0, 1, 10, 1] to obtain a second coding vector [0.8, 0.2, 0.5, ..., 0.1] (assuming it is a 10-dimensional vector).
[0096] In step 1013, activation processing is performed on the second coding vector to obtain a first probability.
[0097] Here, the second encoded vector can be activated by the first network in the first model to obtain the first probability. The activation process can be implemented by performing a nonlinear transformation on the second encoded vector using a nonlinear activation function (such as a ReLU function) to obtain an output value, and then converting the output value into the first probability in the interval [0, 1] using an activation function (Sigmoid activation function).
[0098] Exemplarily, the second encoding vector [0.8, 0.2, 0.5, ..., 0.1] is converted into an output value of -1.2 using a ReLU function, and the output value is converted into a first probability of 0.23 using an activation function.
[0099] The embodiment of the present application adopts unique hot encoding or embedded encoding for discrete features such as gender and geographic location, which can effectively solve the problem that categorical data cannot be directly input into the model, while retaining the semantic information of the features, and normalizing or standardizing continuous features such as age and number of views, so that features of different dimensions can be compared within the same numerical range, avoiding certain features from dominating the model learning process due to excessive numerical range. The first network (such as a multi-layer perceptron) linearly transforms the first encoding vector through the weight matrix and bias term of the fully connected layer, extracts high-level features, generates a second encoding vector, and introduces nonlinear characteristics through an activation function (such as ReLU), so that the model can better fit complex data distributions. The final output value is compressed to the interval [0, 1] to obtain the first probability, which is easy to interpret and apply.
[0100] In step 102, a parameter value of the first function is predicted based on the first feature to obtain a first parameter value.
[0101] The first function represents the relationship to be fitted between the first probability and the second probability, and the second probability is the probability of the first user's behavior occurring when the first user receives the first information.
[0102] Here, the first function is a function with a fixed function type and undetermined parameters. The type of the first function can be a linear function, a nonlinear function, an exponential function, or other mathematical expression. The type of the first function can be determined based on the sample data of the sample user before the behavior prediction. When the user does not receive the first information, the first probability of the behavior occurring can be used as the independent variable of the first function. When the user receives the first information, the second probability of the behavior occurring can be used as the dependent variable of the first function. The undetermined parameters are parameters in the first function that need to be determined through data fitting or prediction, and are used to quantify the relationship between the probability of the user's behavior occurring when the user does not receive the first information and when the user receives the first information.
[0103] The number of undetermined parameters in the first parameter can be one or more. Different types of first functions can have different or the same number of undetermined parameters. The number of undetermined parameters depends on the type of the first function.
[0104] For example, the first function is a linear function, and the number of parameters to be determined is two. Then the first function is y=ax+k, x is the first probability, y is the second probability, and a and k are both parameters to be determined. Alternatively, the function type of the first function to be fitted is a polynomial function, and the number of parameters to be determined is three. Then the first function is y=ax 2+ kx+c, x is the first probability, y is the second probability, a, k and c are all unknown parameters.
[0105] In some embodiments, see Figure 5 , Figure 5 It is shown that in step 102, the parameter value of the first function is predicted based on the first feature to obtain the first parameter value, which can be achieved by the following steps 1021 to 1022:
[0106] In step 1021 , according to the type of the first function, a first model matching the first function is searched from a plurality of first models.
[0107] Here, the type of the first function is determined based on the sample data of the sample user before behavior prediction. Because the sample data of different sample users have different data characteristics, the first function derived from the sample data of a specific sample user has a specific type. The first model is also trained based on the sample data of the sample user to predict the probability of user behavior. Therefore, the second network in the first model, trained based on the sample data of the specific sample user, will also be used to predict the parameter values of the first function of the specific type.
[0108] In this embodiment of the present application, multiple first models are pre-trained using sample data from different sample users, each of which includes a second network corresponding to a function type. After obtaining the type of the first function, a second network matching the type can be found from the second networks included in the multiple first models. The first model containing the second network matching the type is used as the first model matching the first function.
[0109] Exemplarily, the sample data of sample users in sample set A are used to train a first model a in advance, and the type of function obtained by fitting the sample data of sample users in sample set A is a linear function. Then, the second network a1 in the first model a is used to predict the parameter values of the first function of the linear function type. The sample data of sample users in sample set B are used to train a first model b, and the type of function obtained by fitting the sample data of sample users in sample set B is a polynomial function. Then, the second network b1 in the first model b is used to predict the parameter values of the first function of the polynomial function type. Assuming that the first function is y=ax+k and the type of the first function is a linear function, a second network a1 that matches the first function is found from the second network a1 and the second network b1. The first model a where the second network a1 is located is used as the first model that matches the first function.
[0110] In step 1022, the first feature is encoded using a first model that matches the first function to obtain a first encoding vector, and the first encoding vector is mapped to obtain a first parameter value.
[0111] Here, the specific process of encoding the first feature to obtain the first encoding vector is consistent with the process of step 1011 above and will not be described here. The second network in the first model may include a multi-layer perceptron (MLP), and the number of second networks is the same as the number of undetermined parameters in the first function. A second network is used to predict the first parameter value of an undetermined parameter. The first feature can be encoded by the second network in the first model that matches the first function to obtain a first encoding vector, and the first encoding vector is mapped to obtain the first parameter value. The mapping process of the first encoding vector is to perform a linear transformation on the first encoding vector by the fully connected layer in the second network through the weight matrix and the bias term to obtain a linear transformation result, and then perform a nonlinear transformation on the linear transformation result through a nonlinear activation function (such as a ReLU function) to obtain the first parameter value.
[0112] In some embodiments, the step of encoding the first feature to obtain the first encoded vector may not be performed by the first network. The first model may further include an encoding layer, where the encoding layer in the first model encodes the first feature to obtain the first encoded vector. The first encoded vector is input into the first network and the second network in the first model, respectively, so that the first network predicts the first probability of the first user's behavior based on the first encoded vector, and the second network performs mapping processing on the first encoded vector to obtain the first parameter value.
[0113] Exemplarily, the first function is y=ax+k, and the first model matching the first function includes two second networks: second network A and second network B. A first encoding vector [0.6, 0, 1, 10, 1] is input to second network A. Second network A maps the first encoding vector to obtain a first parameter value of the undetermined parameter a of 1.4. A first encoding vector [0.6, 0, 1, 10, 1] is input to second network B. Second network B maps the first encoding vector to obtain a first parameter value of the undetermined parameter k of 0.1.
[0114] The first model in this embodiment includes multiple second networks, each used to predict an undetermined parameter in the first function. This enables refined modeling of complex relationships. The second network maps the first encoded vector to predict the first parameter value in the first function for each user, thereby adapting to the behavioral characteristics of different users. Because each first parameter value is predicted by an independent second network, the entire process can be parallelized, significantly improving computational efficiency.
[0115] In step 103, a second function is calculated based on the first parameter value and the first function.
[0116] Here, the second function is a concretized function obtained by substituting the first parameter value into the first function. Each first parameter value is substituted into the corresponding undetermined parameter in the first function to obtain the second function.
[0117] Exemplarily, the first function is y=ax+k, and the predicted first parameter values are a=1.4, k=0.1. Substituting the first parameter values into the first function, the second function is y=1.4x+0.1.
[0118] In step 104 , a second probability is determined based on the first occurrence probability and the second function.
[0119] Here, the first probability is assigned to the independent variable x in the second function, and the second probability y is calculated.
[0120] For example, in a scenario where a promotion platform predicts whether a user will purchase a product, the predicted probability of the first user purchasing the phone is 20% if the user has not received a mobile phone advertisement. The second function is y = 1.4x + 0.1. Assigning the first probability of 0.2 to the independent variable x yields y = 1.4 × 0.2 + 0.1 = 0.38, indicating a second probability of 38% for the first user purchasing the phone if the user has received the mobile phone advertisement.
[0121] In an embodiment of the present application, when the first user has not received the first information, a first probability of the first user's behavior is predicted based on the first feature of the first user, providing a benchmark reference for subsequent analysis; a parameter value of the first function is predicted based on the first feature to obtain a first parameter value, and a second function is calculated based on the obtained first parameter value and the first function, so that the second function can accurately characterize and capture the fitting relationship between the first probability and the second probability of the first user's behavior occurring when the first user receives the first information; a second probability is calculated based on the second function and the first probability, thereby fully considering the impact of the first information on the user's behavior and improving the accuracy of behavior prediction.
[0122] In some embodiments, after obtaining the first probability and the second probability of the first user, the probability difference between the second probability and the first probability can be determined. When the probability difference is greater than a preset probability threshold, it is considered that the first information has a greater impact on the probability of the first user's behavior, and an intervention action is performed on the first user, that is, the first information is sent to the first user. When the probability difference is less than or equal to the probability threshold, it is considered that the first information has a smaller impact on the probability of the first user's behavior, and no intervention action is performed on the first user, that is, the first information is not sent. The embodiment of the present application does not limit the value of the probability threshold, and it can be set based on actual needs.
[0123] For example, the first probability of the first user purchasing a mobile phone is 0.2, the second probability is 0.8, the first information is a coupon issued to the user, and the preset probability threshold is 0.5. Then the probability difference corresponding to the first user = 0.8-0.2=0.6, which is greater than the probability threshold, and the coupon is issued to the first user.
[0124] See also Figure 6 , Figure 6 This is a flow diagram of a model training method provided by another embodiment of the present application. Figure 1 , will combine Figure 6 The steps shown are explained.
[0125] In step 201, a third probability of the first sample user's behavior occurring is predicted based on the sample characteristics of the first sample user through the second model when the first sample user has not received the first sample information.
[0126] Here, the second model is defined in the same way as the first model in the above embodiment and will not be described here. Sample features are data describing the attributes or historical behaviors of the first sample user, and may include the first sample user's age, gender, geographic location, historical browsing history, click behavior, conversion behavior, and purchase behavior. The first sample information is similar to the definition of the first information in the above embodiment and will not be described here. The specific process of predicting the third probability of the first sample user's behavior based on the sample features of the first sample user is similar to the process of step 101 in the above embodiment and will not be described here.
[0127] In step 202, the parameter value of the third function is predicted based on the sample characteristics to obtain a second parameter value.
[0128] The third function represents the relationship to be fitted between the third probability and the fourth probability, and the fourth probability is the probability of the first sample user's behavior occurring when the first sample user receives the first sample information.
[0129] Here, the third function can be the same as the first function in step 102 in the above embodiment. That is, after constructing the third function during the model training phase, the third function can be directly applied as the first function in the behavior prediction method. The specific process of predicting the parameter value of the third function based on the sample characteristics to obtain the second parameter value is similar to the process in step 102 in the above embodiment and will not be further described here.
[0130] After constructing the third function, the number of undetermined parameters can be obtained from the third function, and a second model to be trained can be constructed based on the number of undetermined parameters, wherein the number of second networks in the second model is consistent with the number of undetermined parameters, and the second network is used to execute step 202. The second model also includes a first network for executing step 201.
[0131] In some embodiments, see Figure 7 , Figure 7 It is shown that before step 201, the model training method further includes the following steps 301 to 302:
[0132] In step 301 , for each type of function, the function is fitted based on the sample characteristics of the first sample user to obtain a fitting function, and a fitting value of the fitting function is determined.
[0133] Here, function types may include, but are not limited to, linear, exponential, and logarithmic functions. The first sample users are users used to train and validate the second model and construct the third function. For example, on a promotion platform, the first sample users may be a subset of users in historical data, whose behavior records (e.g., browsing, clicking, purchasing, etc.) are clearly labeled. The definition of sample features is similar to that of the first features and will not be further explained here. The fitting function is a specific function form fitted to the sample features of the first sample users using an optimization algorithm (e.g., least squares, gradient descent, etc.). Each type of function (e.g., linear, exponential, etc.) has a corresponding fitting function, and the parameter values in the fitting function are obtained by fitting the sample features. The fitting function describes the relationship between the probability of the first sample user's behavior occurring after receiving the first sample information and the probability of the behavior occurring after not receiving the first sample information. The fitting value is a metric that measures the ability of the fitting function to predict the probability of the behavior occurring after receiving the first sample information, based on the probability of the behavior occurring after not receiving the first sample information. Common fitting values include mean square error and coefficient of determination.
[0134] In some embodiments, see Figure 8 , Figure 8 It is shown that in step 301, a function is fitted based on the sample characteristics of the first sample user to obtain a fitting function, which can be achieved by the following steps 3011 to 3014:
[0135] In step 3011, the first sample users are grouped based on the sample characteristics to obtain multiple groups.
[0136] Here, there are multiple first sample users, and each group includes some sample users. The embodiment of the present application does not limit the method of obtaining multiple groups based on sample feature grouping. For example, the first sample users can be grouped using a clustering algorithm (such as K-Means) or manually setting a threshold.
[0137] In some embodiments, if the sample characteristics are directly quantifiable indicators (such as the number of times a user visits a product, the number of days a user visits a product, the number of purchases, user activity, etc.), multiple first sample users can be directly sorted based on the sample characteristics of each first sample user, either from low to high or from high to low. The sorted first sample users are divided into a group according to a preset number (for example, every 100 first sample users). If the total number of first sample users cannot be divided evenly, the last group contains the remaining first sample users.
[0138] For example, the sample feature is the number of user visits. Assuming there are 500 first sample users, after sorting by the number of visits, the first 100 first sample users are divided into group 1, the next 100 first sample users are divided into group 2, and so on, a total of 5 groups are obtained.
[0139] In some embodiments, the first sample users are grouped based on sample characteristics to obtain multiple groups, which can be achieved in the following way: first, based on the sample characteristics of the first sample users, the seventh probability of the first sample user's behavior occurring without receiving the first sample information is determined; then, based on the seventh probability of occurrence, the first sample users are grouped to obtain multiple groups.
[0140] Here, the seventh probability of the first sample user's behavior occurring without receiving the first sample information can be predicted through the pre-trained second model based on the sample characteristics of the first sample user. The embodiment of the present application does not limit the model structure of the second model, and it can be a machine learning model (such as logistic regression, random forest, neural network, etc.). Based on the seventh probability of each first sample user, multiple first sample users are sorted from low to high or from high to low. The sorted first sample users are divided into a group according to a preset number (for example, every 100 first sample users). If the total number of first sample users cannot be divided evenly, the last group contains the remaining first sample users.
[0141] The embodiment of the present application predicts the seventh probability (the probability of the behavior occurring without receiving the first sample information) of each first sample user through the second model, and groups the first sample users based on this. The seventh probability can accurately reflect the user's behavioral tendencies when the first sample information is not received, and is more representative than directly using the original features (such as the number of visits, activity, etc.). Grouping based on probability values ensures that the sample users in each group have similar behavior patterns, thereby improving the scientific nature and accuracy of the grouping results. The first sample users are sorted based on the seventh probability and divided into a group according to a fixed number. The sorting process is simple and efficient, and can be completed quickly whether sorting from low to high or from high to low. The grouping rules are clear, which facilitates subsequent analysis and processing. Even if the total number of first sample users cannot be divided evenly, the design of the last group containing the remaining users ensures that all first sample users are reasonably allocated.
[0142] In some embodiments, the first sample users include second sample users who have not received the first sample information. Determining, based on the sample characteristics of the first sample users, the seventh probability that the first sample user's behavior would have occurred if they had not received the first sample information can be achieved by first training a third model based on the sample characteristics of the second sample users and the behavior labels of the second sample users; then, based on the third model and the sample characteristics of the first sample users, predicting the seventh probability that the first sample user's behavior would have occurred if they had not received the first sample information.
[0143] Here, the behavior label is used to indicate whether the user has performed the target behavior. For example, if the behavior label is "1", it means that the user has performed the target behavior, and if the behavior label is "0", it means that the user has not performed the target behavior. The features of multiple second sample users can be input into the third model to be trained, and the third model outputs the predicted probability of each second sample user's behavior occurring without receiving the first sample information. Based on the predicted probability and behavior label of each second sample user, the model loss (such as cross entropy loss) is calculated, and the model parameters in the third model are updated based on the model loss to obtain the trained third model. The third model can be a binary classification model. After the training is completed, the sample features of each first sample user are input into the third model, and the third model outputs the seventh probability of the behavior occurring for each first sample user without receiving the first sample information.
[0144] The embodiment of the present application trains a third model based on the sample features and behavior labels of the second sample users who have not received the first sample information, ensuring that the third model can accurately predict the probability of user behavior in the absence of the first sample information. The third model is used to predict the first sample users and obtain the seventh probability of each first sample user, providing a reliable basis for subsequent grouping and analysis. This method supports multiple types of feature data (such as discrete features and continuous features) and can select different machine learning models according to actual needs.
[0145] In step 3012, for each group, a fifth probability that the first sample user in the group will behave in the absence of receiving the first sample information and a sixth probability that the first sample user in the group will behave in the absence of receiving the first sample information are determined.
[0146] Here, the first sample users include the second sample users who have not received the first sample information and the third sample users who have received the first sample information. Each group includes some second sample users and some third sample users. The fifth probability is the probability of the actual behavior of the second sample users in the group, and the sixth probability is the probability of the actual behavior of the third sample users in the group. For each group, obtain the behavior label of each second sample user in the group, and the behavior label of each third sample user. A behavior label of "1" indicates that the user actually has a behavior, and a behavior label of "0" indicates that the user actually has no behavior. The average value of the behavior labels of multiple second sample users in the group can be calculated, and the average value can be used as the fifth probability. The average value of the behavior labels of multiple third sample users in the group can be calculated, and the average value can be used as the sixth probability.
[0147] In an embodiment of the present application, determining the fifth probability that the first sample user in the group will perform the behavior without receiving the first sample information, and the sixth probability that the first sample user in the group will perform the behavior after receiving the first sample information, can be achieved in the following manner: first, determining the first number of second sample users, the second number of third sample users, the third number of sample users among the second sample users who have performed the behavior, and the fourth number of sample users among the third sample users who have performed the behavior from the group; then, taking the ratio of the third number to the first number as the fifth probability; finally, taking the ratio of the fourth number to the second number as the sixth probability.
[0148] Here, the sample users who have performed actions among the second sample users are the sample users who have performed actions without receiving the first sample information. The sample users who have performed actions among the third sample users are the sample users who have performed actions after receiving the first sample information. After obtaining the behavior label of each first sample user in the group, the third number of second sample users who have performed actions in the group and the fourth number of third sample users who have performed actions are counted based on the behavior label. For example, the second sample user with a behavior label of "1" is regarded as the sample user who has performed actions among the second sample users, and the third sample user with a behavior label of "1" is regarded as the sample user who has performed actions among the third sample users. The fifth probability represents the proportion of behavior occurrence of the second sample users in the group, and the sixth probability represents the proportion of behavior occurrence of the third sample users in the group.
[0149] For example, Group 1 includes 100 first sample users, 50 second sample users, and 50 third sample users. Of the 50 second sample users, 10 second sample users engaged in an activity, and of the 50 third sample users, 20 second sample users engaged in an activity. Therefore, the first number is 50, the third number is 10, and the corresponding fifth probability for Group 1 is = third number / first number = 10 / 50 = 0.2. The second number is 50, and the fourth number is 20. The corresponding sixth probability for Group 1 is = fourth number / second number = 20 / 50 = 0.4.
[0150] The embodiment of the present application can accurately calculate the probability of occurrence of the corresponding behavior of the group when the first information is not received and when the first information is received, respectively, by clarifying the first number, the second number, the third number and the fourth number.
[0151] In step 3013, for each group, the fifth probability is used as the horizontal coordinate and the sixth probability is used as the vertical coordinate to obtain the coordinate point corresponding to the group.
[0152] Here, each group corresponds to a coordinate point. The coordinate points corresponding to multiple groups constitute multiple coordinate points in the curve used to fit the function. In other words, fitting these multiple coordinate points can obtain the fitting function. The fifth and sixth probabilities corresponding to each group are converted into coordinate points on a two-dimensional plane. For each group, the fifth probability corresponding to the group is used as the horizontal coordinate x, and the sixth probability is used as the vertical coordinate y to obtain the coordinate point (x, y) corresponding to the group.
[0153] For example, if the fifth probability of group 1 is 0.2 and the sixth probability is 0.4, the coordinate point of group 1 is (0.2, 0.4). If the fifth probability of group 2 is 0.35 and the sixth probability is 0.45, the coordinate point of group 2 is (0.35, 0.45).
[0154] In step 3014, a function is fitted based on the coordinate points corresponding to the multiple groups to obtain a fitting function.
[0155] Here, the fitting function is obtained by fitting the coordinate points corresponding to the multiple groups. An optimization algorithm (such as the least squares method, the gradient descent method, etc.) can be used to fit different types of functions based on the coordinate points corresponding to the multiple groups.
[0156] For example, the coordinate points corresponding to group 1 are (0.2, 0.4), and the coordinate points corresponding to group 2 are (0.35, 0.45). If a linear function is fitted, the fitting function can be y=0.2x+0.36. If an exponential function is fitted, the fitting function can be y=0.3e 0.5x .
[0157] The embodiment of the present application scientifically groups the first sample users based on sample characteristics or the seventh probability, ensuring that the first sample users in each group have similar behavior patterns (such as behavioral tendencies when not receiving the first message and when receiving the first message), reducing the impact of inter-group differences on subsequent analysis. The actual behavior probability (fifth probability and sixth probability) of each group when not receiving the first message and when receiving the first message is calculated, providing accurate behavior data at the group level, which can accurately reflect the behavioral changes of different user groups before and after the intervention. The fifth probability and sixth probability of the group are converted into coordinate points to form visual data for intuitive analysis and understanding. Different types of functions are fitted based on the coordinate points corresponding to multiple groups to obtain the function type with the best fitting effect. Through scientific fitting, it is ensured that the third function can best describe the probability relationship between the user's behavior when not receiving the first message and when receiving the first message. Supports multiple function types (such as linear, exponential, etc.), and flexibly selects the optimal model according to actual business needs. Through scientific grouping, precise quantification, visual analysis and efficient fitting, a reliable basis is provided for subsequent behavior prediction, which improves the accuracy of the prediction of the probability of user behavior when receiving the first message.
[0158] In some embodiments, determining the fitting value of the fitting function in step 301 can be achieved by: first, calculating the average of the sixth probabilities corresponding to multiple groups, and calculating a first deviation of the sixth probabilities corresponding to the multiple groups relative to the average. Then, for each group, based on the fifth probability corresponding to the group and the fitting function, calculating the eighth probability that the first sample user in the group will engage in a behavior after receiving the first sample information; then, calculating the second deviation of the sixth probabilities corresponding to the multiple groups relative to the corresponding eighth probabilities; finally, performing a predetermined operation on the first deviation and the second deviation to obtain the fitting value of the fitting function.
[0159] Here, the sixth probabilities corresponding to the multiple groups are summed to obtain a total probability. The ratio of the obtained total probability to the number of groups is used as the average of the sixth probabilities corresponding to the multiple groups. A first deviation value is determined based on the average value and the sixth probabilities corresponding to the multiple groups. The first deviation value is an indicator that measures the degree of dispersion or fluctuation of the sixth probabilities corresponding to the multiple groups relative to their average value. The embodiment of the present application does not limit the calculation method of the first deviation value. For example, reference may be made to calculation methods such as variance, standard deviation, and total sum of squares.
[0160] Exemplarily, the first deviation value is a total sum of squares. The difference between the sixth probability and the average value for each group is determined, the square of the difference corresponding to each group is calculated, and the squares corresponding to multiple groups are summed to obtain the first deviation value. The first deviation value satisfies the following formula (1).
[0161]
[0162] Among them, SS tot is the first deviation value, y i is the sixth probability of the i-th group, is the average of the sixth probabilities corresponding to multiple groups, and n is the total number of groups.
[0163] For each group, the fifth probability corresponding to the group is assigned to the independent variable x of the fitting function, and the eighth probability y is calculated.
[0164] For example, if the fitting function is a linear function type, y=1.4x+0.01, and the fifth probability corresponding to group 1 is 0.2, then 0.2 is assigned to x, and the eighth probability is calculated to be y=1.4×0.2+0.01=0.29. If the fitting function is an exponential function type, y=0.3e 0.5x , the fifth probability corresponding to group 1 is 0.2, then 0.2 is assigned to x, and the eighth probability y is calculated to be 0.3e 0.5×0.2 =0.33.
[0165] A second deviation value is determined based on the sixth probability and the eighth probability corresponding to each group. The second deviation value is an indicator that measures the degree of difference between the sixth probability corresponding to each group and its eighth probability. This embodiment of the application does not limit the method for calculating the second deviation value. For example, reference can be made to calculation methods such as variance, standard deviation, and residual sum of squares.
[0166] Exemplarily, the second deviation value is the residual sum of squares. The difference between the sixth probability and the eighth probability for each group is determined, the square of the difference corresponding to each group is calculated, and the squares corresponding to multiple groups are summed to obtain the second deviation value. The second deviation value satisfies the following formula (2).
[0167]
[0168] Among them, SS res is the second deviation value, y i is the sixth probability corresponding to the i-th group, is the eighth probability corresponding to the i-th group, and n is the total number of groups.
[0169] The preset operation on the first deviation value and the second deviation value can be achieved in the following manner: determining the ratio of the second deviation value to the first deviation value, and using the difference between the value "1" and the ratio as the fitting value of the fitting function.
[0170] The embodiment of the present application quantifies the degree of dispersion of the sixth probability corresponding to multiple groups relative to their average value by calculating the first deviation value, and quantifies the difference between the sixth probability of each group and the eighth probability predicted based on the fitting function by calculating the second deviation value, which directly reflects the predictive ability of the fitting function. By substituting the fifth probability into the fitting function, the eighth probability is obtained, thereby establishing a mapping relationship from known data (fifth probability) to target data (eighth probability). By performing a preset operation on the first deviation value and the second deviation value, the fitting value of the fitting function is obtained, which further optimizes the selection of the fitting function.
[0171] In step 302 , the type of the fitting function corresponding to the maximum fitting value is determined, and a third function belonging to the type is constructed.
[0172] Here, after fitting to obtain multiple types of fitting functions and determining the fitting value of each type of fitting function, the maximum fitting value is selected from the multiple fitting values, the type of fitting function corresponding to the maximum fitting value is determined, and the general expression of this type of function is used as the third function.
[0173] For example, the fitting value is the coefficient of determination R 2 The fitting function of the linear function type is y = 0.2x + 0.36, and the fitting function of the exponential function type is y = 0.3e 0.5x The coefficient of determination of the fitting function y=0.2x+0.36 is 0.976, and the fitting function y=0.3e 0.5x The coefficient of determination is 0.942, so the maximum fitting value is 0.976, and the type of fitting function corresponding to the maximum fitting value is determined to be a linear function. The general expression of the linear function y = ax + k is determined as the third function, where a and k are unknown parameters, x is the third probability, and y is the fourth probability.
[0174] The embodiment of the present application fits a variety of function types, calculates their fitting values, selects the function type with the best fitting effect to construct a third function, ensures that the third function can best describe the probability relationship between the user's behavior when the first information is not received and when the first information is received, avoids the deviation that may be caused by subjective selection of function types, and improves the scientific nature and reliability of the model. Different user groups may be suitable for different function types. The above scheme can select the most suitable function type for different user groups. As the business scenario changes (such as the introduction of new promotion strategies or changes in user behavior patterns), a new function type can be selected by refitting the data to ensure that the first model always adapts to the latest situation. By comparing the fitting values of different function types, the most suitable function type is selected to avoid overfitting problems caused by overly complex functions.
[0175] In step 203, a fourth function is calculated based on the second parameter value and the third function.
[0176] Here, the specific process of calculating the fourth function based on the second parameter value and the third function is similar to the process in step 103 and will not be described again here.
[0177] In step 204 , a fourth probability is determined based on the third probability and the fourth function.
[0178] Here, the specific process of determining the fourth probability based on the third probability and the fourth function is similar to the process of step 104 in the above embodiment and will not be described again here.
[0179] In step 205 , a second model is trained based on the third probability, the fourth probability, and the behavior label of the first sample user.
[0180] Here, the model loss can be calculated based on the third probability, the fourth probability and the behavior label of the first sample user, and the model parameters in the first network in the second model and the model parameters in the second network are updated based on the model loss until the model loss is minimized to obtain the trained second model.
[0181] It should be noted that when there is only one first sample user, the second model can be used to predict the third probability of the first sample user's behavior occurring if the first sample user has not received the first message, as well as the fourth probability of the first sample user's behavior occurring if the first sample user has received the first message. A determination is made as to whether the first sample user has actually received the first message. If the first sample user has not received the first sample message, a loss value is calculated based on the third probability and the behavior label of the first sample user. The first network is trained using this loss value. If the first sample user has received the first sample message, a loss value is calculated based on the fourth probability and the behavior label of the first sample user. The second network is trained using this loss value.
[0182] In an embodiment of the present application, the second model is based on the multidimensional sample characteristics of the first sample user to predict the third probability of the first sample user's behavior when the first information is not received, and the fourth probability of the first sample user's behavior when the first information is received is further predicted by combining the third function and the third probability. The second model contains multiple second networks (the number is consistent with the parameters to be determined) and a first network, which are used for parameter prediction and prediction of the probability of behavior when the first information is not received. This structural design enables the second model to simultaneously learn the complex relationship between sample characteristics and the probability of behavior, thereby enhancing the generalization ability of the second model. Based on the third probability, the fourth probability and the behavior label of the first sample user, the model loss is calculated and the model parameters are updated until the loss is minimized. This end-to-end training process ensures that the second model can be efficiently optimized on large-scale data. Through iterative optimization, the second model can continuously adjust parameters to better adapt to different user groups and intervention strategies.
[0183] In some embodiments, the number of first sample users is multiple, the second model includes a first network and a second network, the second network corresponds to the second parameter value one-to-one, the first network is used to predict the third probability, and the second network is used to predict the second parameter value. Figure 9 , Figure 9 It is shown that in step 205, the second model is trained based on the third probability, the fourth probability and the behavior label of the first sample user, which can be achieved by the following steps 2051 to 2054:
[0184] In step 2051 , for a second sample user among the plurality of first sample users who has not received the first sample information, a first loss value is determined based on the third probability of the second sample user and the behavior label of the second sample user.
[0185] Here, after the sample features of multiple first sample users are input into the first model, the first model outputs the third probability of each first sample user when the first sample information is not received, and the fourth probability when the first sample information is received. For each first sample user, if the first sample user is a second sample user who has not received the first sample information, a loss value can be calculated using the third probability and behavior label of the second sample user. The embodiment of the present application does not limit the calculation method of the loss value, for example, it can be mean square error or cross entropy loss. The loss values calculated for each second sample user in the multiple first sample users are summed to obtain the first loss value.
[0186] For example, for 10 first sample users, there are 6 second sample users, and the loss values calculated for the 6 second sample users are: 0.2, 0.1, 0.05, 0.3, 0.1, 0.05, respectively. Then the first loss value = 0.2 + 0.1 + 0.05 + 0.3 + 0.1 + 0.05 = 0.8.
[0187] In step 2052 , for a third sample user among the plurality of first sample users who has received the first sample information, a second loss value is determined based on the fourth probability of the third sample user and the behavior label of the third sample user.
[0188] Here, for each first sample user, if the first sample user is a third sample user who received the first sample information, a loss value can be calculated using the fourth probability and behavior label of the third sample user. This embodiment of the application does not limit the calculation method of the loss value, and for example, it can be a mean square error or cross entropy loss. The loss value calculated for each third sample user among the multiple first sample users is summed to obtain a second loss value.
[0189] For example, for 10 first sample users, there are 4 third sample users, and the loss values calculated for the 4 third sample users are 0.05, 0.3, 0.1, and 0.05, respectively. Then the second loss value = 0.05 + 0.3 + 0.1 + 0.05 = 0.5.
[0190] In step 2053, a third loss value is calculated based on the first loss value and the second loss value.
[0191] Here, a preset operation is performed on the first loss value and the second loss value to obtain the third loss value. Alternatively, the third loss value can be obtained by performing a weighted summation of the first loss value and the second loss value. During the weighted summation, the first weight corresponding to the first loss value and the second weight corresponding to the second loss value can be set based on actual experience.
[0192] For example, the first weight is 0.5, the second weight is 0.5, the first loss value is 0.8, and the second loss value is 0.5, then the third loss value = 0.5×0.8+0.5×0.5=0.65.
[0193] In step 2054, the first network and the second network are trained based on the third loss value.
[0194] The updated first network is used to predict the third probability, and the updated second network is used to predict the second parameter value.
[0195] Here, the gradients of all trainable parameters in the first network and the second network in the second model can be calculated using the backpropagation algorithm based on the third loss value. The trainable parameters are updated according to the gradients using an optimization algorithm (such as gradient descent), and the process of calculating the loss value and updating the parameters is repeated until a stopping condition is met (such as convergence of the third loss value or reaching the maximum number of iterations), thereby obtaining the trained second model.
[0196] The embodiment of the present application calculates the first loss value and the second loss value for the second sample user who did not receive the first information and the third sample user who received the first information, and comprehensively evaluates the prediction accuracy of the second model in the two scenarios; by taking the weighted sum of the two parts of the loss value to obtain a comprehensive third loss value, the importance of the non-intervention and intervention scenarios is effectively balanced; based on the third loss value, the model parameters are updated using the back propagation algorithm to ensure that the second model can simultaneously optimize the prediction performance of the third probability and the fourth probability. The whole process not only improves the generalization and robustness of the second model, but also enhances the ability to characterize complex user behavior patterns, providing a more accurate quantitative basis for subsequent business decisions. This end-to-end training method greatly reduces the cost of manual parameter adjustment, while supporting flexible adjustment of weights to meet the needs of different application scenarios.
[0197] The following describes an exemplary application of the embodiments of the present application in a practical application scenario.
[0198] The embodiment of the present application proposes a behavior prediction method and a model training method. The behavior prediction method is implemented by a model trained by the model training method. The model is an intervention increment model (Uplift model) based on an explicit increment function.
[0199] Figure 10 This is a flowchart of the construction and application of the intervention increment model provided in the embodiment of the present application.
[0200] See also Figure 10 , step 1101, analyzing the conversion rate relationship between intervention and no intervention.
[0201] Among them, the non-intervention conversion rate (corresponding to the fifth probability in the above embodiment) is x, the intervention conversion rate (corresponding to the sixth probability in the above embodiment) is y, and the conversion rate relationship between y and x (corresponding to the type of function in the above embodiment) is determined to be linear, exponential or polynomial, etc.
[0202] Step 1102: training the intervention increment model.
[0203] Among them, based on the determined conversion rate relationship (corresponding to the first type in the above embodiment), an intervention incremental model (corresponding to the second model in the above embodiment) architecture is built, and the intervention incremental model is trained using training data.
[0204] Step 1103, obtain the model file.
[0205] Among them, the model file is the intervention incremental model that has been trained.
[0206] Step 1104, online application.
[0207] Among them, for different user characteristics (corresponding to the first characteristic of the first user in the above embodiment), the multi-layer perceptron (MLP) in the intervention incremental model will obtain different relationship expressions (corresponding to the second function in the above embodiment), and the intervention conversion rate (corresponding to the second probability in the above embodiment) is obtained based on the relationship expression and the predicted natural conversion rate (corresponding to the first probability in the above embodiment).
[0208] The specific training process of the intervention increment model in the embodiment of the present application is described below.
[0209] The specific training process of the intervention incremental model is mainly divided into two parts: data analysis and model building. The data analysis stage is used to analyze the conversion rate relationship between intervention and non-intervention. A conversion rate model for users under non-intervention is constructed (corresponding to the second model in the above embodiment), and the natural conversion probability (corresponding to the seventh probability in the above embodiment) of all users (corresponding to the first sample users in the above embodiment) is obtained. Figure 11 This is a flowchart for obtaining the natural conversion probability of all users provided in an embodiment of the present application.
[0210] See also Figure 11 , step 1201, collect user samples under the control group.
[0211] The control group includes multiple users (corresponding to the second sample users in the above embodiment) who did not receive the intervention (corresponding to not receiving the first sample information). The user sample includes user characteristics and behavior labels (conversion labels, indicating whether the user converted). Whether the user converted can be determined based on actual needs. For example, if the need is to purchase a product, the behavior label is determined by whether the user purchased the product.
[0212] Step 1202: Build a binary classification model.
[0213] Among them, a deep learning network (Deep Neural Network, DNN), a tree model, etc. can be used to construct a binary classification model (corresponding to the third model in the above embodiment).
[0214] Step 1203, obtain the model file.
[0215] Among them, the model file is the trained binary classification model.
[0216] Step 1204: Collect user features of all users.
[0217] All users (corresponding to the first sample users in the above embodiment) include users in the control group (corresponding to the second sample users in the above embodiment) and users in the intervention group (corresponding to the third sample users in the above embodiment). User characteristics of all users (corresponding to the sample characteristics in the above embodiment) are obtained. User characteristics may include activity level, age, gender, occupation, number of visits, number of favorites, product characteristics, etc.
[0218] Step 1205: Estimate the natural conversion rate of all users.
[0219] The user features of all users are input into the model file, and a binary classification model is used to perform binary classification estimation on all users to obtain the natural conversion rate of all users (corresponding to the seventh probability in the above embodiment).
[0220] After obtaining the natural conversion rate, all users are divided into tiers according to the natural conversion rate, and the conversion rate of non-intervention users (corresponding to the fifth probability in the above embodiment) and the conversion rate of intervention users (corresponding to the sixth probability in the above embodiment) in each tier (corresponding to the group in the above embodiment) are counted. For example, the estimated natural conversion rate of all users is 0.1-0.6, and there are 800 users in total, divided into 8 tiers. Sorted by natural conversion rate, the 100 users with the smallest scores are in the first tier, the users ranked between 100-200 are in the second tier, and so on, the last 100 users are in the eighth tier. The 100 users in each tier are split according to whether they are intervened or not, and their number of converted users / total number of users are counted, which is the conversion rate under intervention or non-intervention.
[0221] With the conversion rate of non-intervention users as x and the conversion rate of intervention users as y, the relationship between the two, y=f(x), is obtained by fitting. The coordinate points of each gradation can be added in Excel, and trend lines can be added. The fitting function can be obtained by fitting with linear function, exponential function, and polynomial function respectively. Determine the coefficient of determination of different fitting functions (corresponding to the fitting value in the above embodiment), and select a fitting method with a higher coefficient of determination. The coefficient of determination is an important indicator for measuring the goodness of fit of the model, and its value ranges from 0 to 1. Generally speaking, the closer the coefficient of determination is to 1, the better the model fits the data, and the higher the variability that can be explained. Figure 12 This is a linear relationship diagram between the user conversion rate and the natural conversion rate under intervention provided by the embodiment of this application. Figure 12 , all users are divided into 8 levels according to the probability of natural conversion. Each level is a coordinate point (xi, yi) in the figure. xi is the conversion rate of users in the i-th level without intervention, and yi is the conversion rate of users in the i-th level with intervention. Figure 12 The vertical coordinates yi of the middle 8 gears are 9.9%, 12.2%, 15.5%, 15.5%, 17.1%, 18.6%, 20.3%, and 23.4% respectively. The linear fitting result is y=1.8244x-0.069. Figure 13 It is a polynomial relationship diagram between the conversion rate of users under intervention and the natural conversion rate provided in the embodiment of the present application. Figure 13 The vertical coordinates yi of the middle 8 gears are 9.9%, 12.2%, 15.5%, 15.5%, 17.1%, 18.6%, 20.3%, and 23.4% respectively. The polynomial relationship is fitted to obtain y=7.6458x 2 -0.0753x+0.0452.
[0222] The following describes the specific process of model building.
[0223] The Uplift model plays a crucial role in intelligent marketing. It helps businesses identify "coupon-sensitive users"—those who will purchase only after receiving coupons and will not purchase unless they receive them. By precisely targeting these users, businesses can more effectively allocate marketing resources, increase conversion rates, and reduce marketing costs. Furthermore, the Uplift model can be applied to other scenarios requiring evaluation of intervention effectiveness, such as recommending promotional timing and product recommendations.
[0224] The Uplift model estimates the conversion rate P(y_c) (corresponding to the first probability in the above example) without user intervention (control) and the conversion rate P(y_t) (corresponding to the second probability in the above example) with user intervention (treatment). Then, intervention is applied to users with a higher P(y_t)-P(y_c) ratio. Intervention actions include issuing coupons, making phone calls, recommending specific products, and so on.
[0225] Figure 14 This is a network structure diagram of the intervention increment model provided in the embodiment of the present application. Figure 14 , the user features pass through the encoding layer 1501 (Embedding) to obtain the feature vector f. The feature vector f passes through the multi-layer neural network 1502 (MLP) and then the linear mapping layer (Linear) 1503. The sigmoid activation function is used to produce a natural conversion probability of 0-1, representing the conversion rate P(y_c) without user intervention. Among them, MLP is a universal multi-layer neural network. The structure of each layer of the neural network is a fully connected layer. The number of fully connected layers can be the same or different. The processing process of the neural network is RELU(wf+b), where w and b are parameters that are iteratively learned during backpropagation. w is the weight matrix, b is the bias term, f is the input feature vector, and RELU is an activation function.
[0226] The feature vector f passes through a multi-layer neural network (MLP) to obtain the i-th parameter value parameter_i (corresponding to the second parameter value in the above embodiment). The number of i depends on the fitting function determined in the analysis, and i increases from 1. For example, if a linear relationship is fitted to obtain y = ax + k, then two parameter values need to be obtained: parameter_1 (i.e., a) and parameter_2 (i.e., k).
[0227] If the fitting function is y=ax+k, you only need to add two MLPs to output two parameter values a and k respectively, and then obtain p(y_t) according to p(y_c)×a+k. Use p(y_t) and the behavior label yt of the intervened user to calculate the error (corresponding to the second loss value in the above embodiment), and use p(y_c) and the behavior label y0 of the non-intervention user to calculate the error (corresponding to the first loss value in the above embodiment). The two errors are weighted to obtain the total error (corresponding to the third loss value in the above embodiment). Use the total error backpropagation to train the parameters in the MLP.
[0228] If the fitting function is y=ax 2 +kx+c means that three MLPs need to be added to output the three parameter values of a, k and c respectively, and then p(y_t) is obtained according to p(y_c)×p(y_c)×a+p(y_c)×k+c. The error between p(y_t) and yt is calculated, and the error between p(y_c) and y0 is calculated. The two errors are weighted to obtain the total error, and the total error is used for back propagation to train the parameters in the MLP.
[0229] The final output results of different neural networks (MLP) in the model structure have different meanings, which leads to errors in the calculation of different parts. Then, after the error is back-propagated, the parameters in the MLP will also change, that is, the weight matrix w extracted from the feature vectors input into different neural networks will be different.
[0230] According to the functional relationship between y and x determined in the fitting function, y = f(x), and p(y_c) is substituted for x, we can obtain the conversion rate under user intervention, P(y_t) = f(P(y_c)). For example, f(x) = ax + k. The predicted conversion rate p(y_t) = f(p(y_c)) = parameter_1 × p(y_c) + parameter_2. For example, f(x) = ax 2 +kx+c, then we construct and obtain three parameters: parameter_1, parameter_2, and parameter_3. In the figure, p(y_t)=f(p(y_c))=parameter_1×p(y_c)×p(y_c)+parameter_2×p(y_c)+parameter_3.
[0231] The embodiment itself finds through data analysis that the increment brought about by certain interventions is linearly related to the natural conversion rate. The higher the natural conversion rate, the higher the increment that the intervention can bring, that is, P(y_t)=P(y_c)+paramer_1×P(y_c)+paramer_2, which is simplified to P(y_t)=paramer_1×P(y_c)+paramer_2. Therefore, the relationship between the conversion rate under intervention and the conversion rate without intervention is found through data analysis, and it is built into a model structure. In the model structure, the conversion rate under user intervention is explicitly expressed as a function of the conversion rate under user intervention. The personalization of the embodiment of the present application is reflected in the different characteristics of each sample, and the parameter1 and parameter2 values calculated after the trained MLP layer (i.e., multiple RELU(wx+b)) are also different, realizing personalized differences.
[0232] This embodiment of the application makes incremental calculations more accurate by explicitly representing the natural conversion rate, thereby achieving more precise estimates. Through data analysis, the relationship between natural and intervention conversion rates is scientifically and precisely determined, guiding the design of the incremental function and resulting in more accurate estimates. This method is a universal solution suitable for all existing Uplift model scenarios.
[0233] It should be noted that the data analysis link in the embodiment of the present application may not be divided into tiers according to the natural conversion probability, but may be divided into tiers according to other characteristics (such as the number of times users visit the product, the number of days, the number of purchases, the activity level, etc.).
[0234] The following continues to describe the exemplary structure of the behavior prediction device 455 provided in the embodiment of the present application as a software module. In some embodiments, such as Figure 2 As shown, the software modules stored in the behavior prediction device 455 of the memory 450 may include:
[0235] The probability prediction module 4551 is configured to predict a first probability of the first user's behavior occurring based on the first feature of the first user when the first user has not received the first information;
[0236] Parameter prediction module 4552, configured to predict a parameter value of a first function based on the first feature to obtain a first parameter value, wherein the first function represents a relationship to be fitted between a first probability and a second probability, and the second probability is a probability of the first user's behavior occurring when the first user receives the first information;
[0237] A calculation module 4553 is configured to calculate a second function based on the first parameter value and the first function;
[0238] The determination module 4554 is configured to determine a second probability based on the first probability and the second function.
[0239] In some embodiments, the probability prediction module 4551 is further used to encode the first feature to obtain a first encoding vector; perform mapping processing on the first encoding vector to obtain a second encoding vector; and perform activation processing on the second encoding vector to obtain a first probability.
[0240] In some embodiments, the parameter prediction module 4552 is further used to search for a first model matching the first function from multiple first models based on the type of the first function, encode the first feature through the first model matching the first function to obtain a first encoding vector, and map the first encoding vector to obtain a first parameter value.
[0241] The following further describes an exemplary structure of a model training device provided by another embodiment of the present application implemented as a software module. In some embodiments, the software modules stored in the model training device in the memory 450 may include:
[0242] a probability prediction module, configured to predict, by using a second model, a third probability of the first sample user's behavior occurring based on the sample characteristics of the first sample user when the first sample user has not received the first sample information;
[0243] a parameter prediction module, configured to predict a parameter value of a third function based on the sample characteristics to obtain a second parameter value, wherein the third function represents a relationship to be fitted between a third probability and a fourth probability, where the fourth probability is a probability of the first sample user's behavior occurring when the first sample user receives the first sample information;
[0244] a calculation module, configured to calculate a fourth function based on the second parameter value and the third function;
[0245] a determination module, configured to determine a fourth probability based on the third probability and a fourth function;
[0246] The training module is used to train the second model based on the third probability, the fourth probability and the behavior label of the first sample user.
[0247] In some embodiments, the number of first sample users is multiple, and the second model includes a first network and a second network, and the second network corresponds one-to-one to the second parameter value; the training module is further used to determine a first loss value for a second sample user among the multiple first sample users who has not received the first sample information based on the third probability of the second sample user and the behavior label of the second sample user; determine a second loss value for a third sample user among the multiple first sample users who has received the first sample information based on the fourth probability of the third sample user and the behavior label of the third sample user; calculate a third loss value based on the first loss value and the second loss value; train the first network and the second network based on the third loss value, wherein the updated first network is used to predict the third probability, and the updated second network is used to predict the second parameter value.
[0248] In some embodiments, the model training device also includes a function construction module, which is used to fit the function for each type of function based on the sample characteristics of the first sample user, obtain a fitting function, and determine the fitting value of the fitting function; determine the type of fitting function corresponding to the maximum fitting value, and construct a third function belonging to the type.
[0249] In some embodiments, the function construction module is also used to group the first sample users based on sample characteristics to obtain multiple groups; for each group, determine the fifth probability that the first sample user in the group will behave in a case where the first sample information is not received, and the sixth probability that the first sample user in the group will behave in a case where the first sample information is received; for each group, use the fifth probability as the horizontal coordinate and the sixth probability as the vertical coordinate to obtain the coordinate point corresponding to the group; based on the coordinate points corresponding to the multiple groups, fit the function to obtain a fitting function.
[0250] The present invention provides a computer program product comprising a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the behavior prediction method or model training method described in the present invention.
[0251] The embodiment of the present application provides a computer-readable storage medium in which computer-executable instructions or computer programs are stored. When the computer-executable instructions or computer programs are executed by a processor, the processor will execute the behavior prediction method or model training method provided by the embodiment of the present application, for example, Figure 3 The behavior prediction method is shown.
[0252] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
[0253] In some embodiments, computer-executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0254] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinating files (e.g., files storing one or more modules, subroutines, or code portions).
[0255] By way of example, computer-executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed across multiple sites and interconnected by a communication network.
[0256] In summary, the present embodiment explicitly expresses the incremental effect of intervention on conversion rate as a function of the natural conversion rate, making incremental calculations more accurate and leading to more precise estimates. Through data analysis, the functional relationship between the natural and intervention conversion rates is scientifically and precisely derived, accurately guiding the design of incremental functions and leading to more accurate estimates.
[0257] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the scope of protection of the present application.
Claims
1. A behavior prediction method, characterized in that: The method comprises: In a case where the first user has not received the first information, predicting a first probability of the first user's behavior occurring based on the first feature of the first user; Predicting a parameter value of a first function based on the first feature to obtain a first parameter value, wherein the first function represents a relationship to be fitted between the first probability and a second probability, and the second probability is a probability of the first user's behavior occurring when the first user receives the first information; Calculating a second function according to the first parameter value and the first function; The second probability is determined based on the first probability and the second function.
2. The method according to claim 1, characterized in that The predicting, based on the first feature of the first user, a first probability of the first user's behavior occurring includes: Encoding the first feature to obtain a first encoding vector; Performing mapping processing on the first code vector to obtain a second code vector; Perform activation processing on the second encoding vector to obtain the first probability.
3. The method according to claim 1 or 2, characterized in that The step of predicting a parameter value of the first function based on the first feature to obtain the first parameter value includes: searching, according to the type of the first function, a first model matching the first function from a plurality of first models; The first feature is encoded using a first model that matches the first function to obtain a first encoding vector, and the first encoding vector is mapped to obtain a first parameter value.
4. A model training method, characterized in that: The method comprises: Using the second model, when the first sample user has not received the first sample information, based on the sample characteristics of the first sample user, predict a third probability of the first sample user's behavior occurring; Based on the sample characteristics, a parameter value of a third function is predicted to obtain a second parameter value, wherein the third function represents a relationship to be fitted between the third probability and a fourth probability, and the fourth probability is a probability of the first sample user's behavior occurring when the first sample user receives the first sample information; Calculating a fourth function according to the second parameter value and the third function; determining the fourth probability based on the third probability and the fourth function; The second model is trained based on the third probability, the fourth probability, and the behavior label of the first sample user.
5. The method according to claim 4, characterized in that There are multiple first sample users, the second model includes a first network and a second network, and the second network corresponds to the second parameter value in a one-to-one manner; The training of the second model based on the third probability, the fourth probability, and the behavior label of the first sample user includes: For a second sample user among the plurality of first sample users who has not received the first sample information, determining a first loss value based on a third probability of the second sample user and a behavior label of the second sample user; For a third sample user among the plurality of first sample users who receives the first sample information, determining a second loss value based on a fourth probability of the third sample user and a behavior label of the third sample user; Calculating a third loss value based on the first loss value and the second loss value; The first network and the second network are trained based on the third loss value, wherein the updated first network is used to predict the third probability, and the updated second network is used to predict the second parameter value.
6. The method according to claim 4, characterized in that Before predicting the third probability of the behavior of the first sample user occurring based on the sample characteristics of the first sample user, the method further includes: For each type of function, fitting the function based on the sample characteristics of the first sample user to obtain a fitting function, and determining a fitting value of the fitting function; The type of the fitting function corresponding to the maximum fitting value is determined, and a third function belonging to the type is constructed.
7. The method according to claim 6, characterized in that The fitting of the function based on the sample characteristics of the first sample user to obtain a fitting function includes: Grouping the first sample users based on the sample characteristics to obtain multiple groups; For each group, determining a fifth probability that the first sample user in the group will behave in a situation where the first sample user has not received the first sample information, and a sixth probability that the first sample user in the group will behave in a situation where the first sample user has received the first sample information; For each group, use the fifth probability as the abscissa and the sixth probability as the ordinate to obtain the coordinate point corresponding to the group; The function is fitted based on the coordinate points corresponding to the plurality of groups to obtain a fitting function.
8. An electronic device, characterized in that: The electronic device comprises: a memory for storing computer-executable instructions or computer programs; A processor is used to implement the behavior prediction method described in any one of claims 1 to 3 or the model training method described in any one of claims 4 to 7 when executing the computer-executable instructions or computer program stored in the memory.
9. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that: When the computer executable instructions or computer program are executed by a processor, the behavior prediction method described in any one of claims 1 to 3 or the model training method described in any one of claims 4 to 7 is implemented.
10. A computer program product comprising computer executable instructions or a computer program, characterized in that When the computer executable instructions or computer program are executed by a processor, the behavior prediction method described in any one of claims 1 to 3 or the model training method described in any one of claims 4 to 7 is implemented.