Disclosure of Invention
One or more embodiments of the present specification describe a method and an apparatus for predicting a macro state of a user group based on a user event sequence, which better predict an expected value of a macro quantity by exploring a relationship between a user micro-behavior event and the macro quantity of the user group, so that a service platform can better perform service deployment for the whole user.
According to a first aspect, there is provided a method of predicting a macroscopic state of a population of users, comprising:
determining an event intensity function corresponding to each user based on the event sequence of each user in the plurality of users;
acquiring a first expected value of a target macroscopic quantity of a user group consisting of the plurality of users at a first moment, wherein the target macroscopic quantity depends on events made by the users;
determining a first intermediate function according to an event intensity function corresponding to each user and a magnitude function for representing the degree of influence of the user on the target macroscopic quantity; the amplitude function of each user is in a linear relation with the expected value of the target macroscopic quantity, and the proportionality coefficient of the linear relation is a first coefficient; the first intermediate function is determined based on the sum of the products of the first coefficients of the respective users and the event intensity function;
substituting the first time, a first expected value and a second time after the first time into a first relational expression of which the expected value changes along with time so as to determine a second expected value of the target macroscopic quantity at the second time; wherein the first relation depends on an integral of the first intermediate function over time.
According to one embodiment, determining the event intensity function corresponding to the user specifically includes: extracting the behavior related characteristics of the user based on the event sequence of the user; inputting the behavior related characteristics into a neural network model to obtain parameter values in the intensity function corresponding to the user; and obtaining an event intensity function corresponding to the user based on the parameter value and a preset form of the intensity function.
Further, in one embodiment, the neural network model may be trained based on: obtaining a plurality of sample event sequences of a plurality of sample users; inputting the behavior related characteristics corresponding to the plurality of sample event sequences into the neural network model to obtain an assumed intensity function corresponding to each sample user; determining, based on the postulated strength function, a likelihood that the plurality of sample users made the plurality of sample event sequences; and training the neural network model by taking the maximum likelihood as a target.
In various embodiments, the predetermined form of the event intensity function depends on a point process that fits the user behavior, the point process being selected from one of: a Hawkes process, a self-correcting point process, a self-exciting point process.
In a specific embodiment, the first relation includes a first operation term obtained by applying a natural exponent operation to the first expected value, where a base of the natural exponent operation is a natural constant, and an exponent is an integral accumulated value of values of the first intermediate function between the first time and the second time.
In one embodiment, the linear relationship further includes a second coefficient as an offset; the method further comprises determining a second intermediate function based on a sum of products of a second coefficient corresponding to each user and the event intensity function; the first relation is also dependent on the second intermediate function.
Further, in one embodiment, the first relation may include a first operand and a second operand, where: the first operation item comprises applying natural exponential operation on the first expected value, wherein the base number of the natural exponential operation is a natural constant, and the exponent is an integral accumulated value of values of the first intermediate function between the first time and the second time; the second operation item comprises the integration and accumulation of the value of the third intermediate function between the first time and the second time; the third intermediate function is a superposition of the second intermediate function and an integral function of the first intermediate function.
In a further embodiment, the event intensity function is in the form of an exponential decay over time; the index in the natural index operation is determined according to the value of the first intermediate function at the second moment; and the operation result of the second operation item is determined according to the product of the difference obtained by subtracting the natural exponential operation result from 1 and a first proportional coefficient, wherein the first proportional coefficient is the ratio of the second intermediate function to the first intermediate function at a second moment.
According to one embodiment, the first relation is determined by solving a mean-field stochastic differential equation characterizing the correlation between the corresponding micro-point process of the event sequence of the respective user and the target macro quantity, the mean-field stochastic differential equation including the amplitude function.
In various embodiments, the sequence of events may include a purchase event in an e-commerce platform, the expected value of the target macroscopic quantity including a commodity sales quantity; or; the event sequence comprises comment events aiming at the target object in the social platform, and the expected value of the target macroscopic quantity can comprise the total comment amount of the target object; or; the event sequence comprises any operation event of a user in the Internet service platform, and the expected value of the target macroscopic quantity comprises access flow.
According to a second aspect, there is provided an apparatus for predicting a macroscopic state of a user population, comprising:
the intensity function determining unit is configured to determine an event intensity function corresponding to each user based on the event sequence of each user in the plurality of users;
a first acquisition unit configured to acquire a first expected value of a target macroscopic quantity of a user population constituted by the plurality of users at a first time, the target macroscopic quantity depending on an event made by each user;
the intermediate function determining unit is configured to determine a first intermediate function according to the event intensity function corresponding to each user and a magnitude function used for representing the degree of influence of the user on the target macroscopic quantity; the amplitude function of each user is in a linear relation with the expected value of the target macroscopic quantity, and the proportionality coefficient of the linear relation is a first coefficient; the first intermediate function is determined based on the sum of the products of the first coefficients of the respective users and the event intensity function;
a prediction unit configured to substitute the first time, a first expected value, and a second time after the first time into a first relational expression in which an expected value changes with time, thereby determining a second expected value of the target macroscopic quantity at the second time; wherein the first relation depends on an integral of the first intermediate function over time.
According to a third aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method of the first aspect.
According to a fourth aspect, there is provided a computing device comprising a memory and a processor, wherein the memory has stored therein executable code, and wherein the processor, when executing the executable code, implements the method of the first aspect.
In the embodiment of the specification, the event sequence of the user is modeled through a point process to obtain an event intensity function, so that the microscopic user behavior is better described. In addition, in the process of establishing the connection between the microscopic behaviors and the macroscopic state through the random differential equation in the form of the average field, the assumption that the user can observe the expected value of the macroscopic quantity and then influence the macroscopic state is made, the influence degree is in a linear relation with the expected value of the macroscopic quantity, the assumption is obviously more practical, and an approximate solvable ordinary differential equation can be obtained. By solving the ordinary differential equation, an explicit relation of expected values over time can be obtained. And in the prediction process, the macroscopic state quantity is directly predicted according to the explicit relational expression.
Detailed Description
The scheme provided by the specification is described below with reference to the accompanying drawings.
Fig. 1 is a scene diagram illustrating group macro state prediction based on user behavior. The left side of fig. 1 shows user behavior as a microscopic state. Specifically, U1, U2, …, Um represent m users with index numbers of 1 to m, and a series of small dots represent a series of events generated by user behavior. These events may include various events in an internet environment, such as: login events, search events, click events, buy events, payment events, comment events, and the like. Accordingly, user behavior may be viewed as a sequence of events that occur over time.
The right side of fig. 1 shows the macroscopic state of the user population, which can be represented by some macroscopic quantity x (t) over time. The macroscopic quantity x (t) is a representation of the macroscopic bulk state with a certain randomness. For this purpose, the desired value of the macroscopic quantity x (t) is also introduced
Indicating the result of the aggregation or polymerization of the macroscopic quantities. Specifically, the expected value
May be expressed as an average value of x (t). For example, when the microscopic behavior involves a purchase event by the user, the macroscopic quantity x (t) may include a total sale of the good, while the desired value
May be expressed as a determined sales volume of the commodity; when the microscopic behavior relates to a music collection event of the user in the music app, the macroscopic quantity x (t) may include the overall collection status of music in the app,
can be expressed as the music collection on the music chart.
Interdependence and association between microscopic behavior and macroscopic state. At any time t, the macroscopic state can be considered as a combined action result of the microscopic events of m users in the whole user population; the microscopic events performed by the user depend on their behavior history and possibly on the macroscopic state at that moment.
There are some relevant modeling approaches for predicting the macroscopic state of a user population. The existing modeling mode often makes a strong assumption that the individual behaviors of the user and/or the micro-and macro-relations are not consistent with the actual situation. For example, in one approach, it is assumed that the user's behavior at each occurrence depends on his historical behavior in a fixed manner, and can only positively stimulate the occurrence of future behavior. With respect to micro and macro relationships, in one modeling approach, it is assumed that the individual user's contribution to the macro state is achieved at a uniform, fixed magnitude; in another modeling approach, it is assumed that an individual user can obtain all information of the macroscopic global state, and based on all information, influence and contribution are made to the macroscopic state. These assumptions are some distance from the actual situation and thus the modeling and prediction is not good enough.
In view of this, embodiments of the present specification provide several solutions in which microscopic user behavior is better characterized by point process modeling, and the microscopic behavior is linked to the macroscopic state by random differential equations in the form of mean fields, exploiting the correlation therebetween, and thus predicting the macroscopic state quantities more accurately, based on the more realistic assumption that the user will observe the expected values of the macroscopic quantities and thus have an effect on the macroscopic state.
FIG. 2 illustrates a modeling diagram that enables macro state prediction based on user behavior in one embodiment. As shown in FIG. 2, the modeling process in this embodiment may include the following three parts: (1) modeling microscopic user behaviors; (2) micro-macro correlation modeling; and (3) macroscopic state inference. The following description is made separately.
Assuming that a user group contains m users, the behavior history of each user can be represented by an event sequence (t, K), where t is the time when the event occurs, and K is the event type of the event, which is one of K possible event types assumed in advance. Can use
Representing the history of behavior or events of user i, then
Represents an aggregation of event history information for all users.
Fig. 3 illustrates a diagram of event histories for multiple users. In fig. 3, the behavior of three users is characterized as different sequences of events, the different types of events being characterized by different shapes (pentagram, diamond, triangle, circle, etc.), the arrowed lines indicating the context between events. For such scenarios, in accordance with embodiments of the present specification, a point process is employed to model user behavior.
The point process for user i is denoted Ni(t) represents the number of events occurring before time t. The function of the time-series dynamics of the main guide point process is called a conditional intensity function (conditional intensity function), or intensity function, which can be defined as the following equation:
wherein λ is
tRepresenting the intensity at time t;
representing historical events occurring by time t;
is shown in given
At time intervals (t, t + delta)]The desired number of events that occur within. It should be understood that formula (1) shows the definition of the intensity function, and the actually used intensity function is a function with time t as an independent variable and intensity as a dependent variable, and is denoted as λ (t). For user i, its intensity function is denoted λ
i(t)。
The intensity function may be determined by training in the following manner. Event history for a given user i
Its likelihood can be expressed as:
thus, observed events generated by the point process of all users
The likelihood of (c) is the sum of the likelihoods of each point process, i.e.:
a neural network model may be constructed to learn the intensity function with the goal of likelihood maximization shown in equation (3). Specifically, the function form of the intensity function may be assumed, and the parameters thereof are left to be determined by the neural network model. In the model training process, the user characteristics and the event history characteristics of each user are input into the neural network model, the parameter values of the intensity function are output through the forward propagation process, so that the expression of the intensity function of each user is obtained, and the likelihood estimation can be obtained by substituting the expressions into the formula (3). With the goal of likelihood increase in equation (3), the neural network model is continually optimized by back propagation until the likelihood is maximized. And obtaining a final expression of the intensity function according to the parameter value output by the neural network model at the moment.
Specifically, in one embodiment, a Hawkes process is employed to fit the point process of the user behavior history. According to the Hawkes process, the intensity function is of the form:
in another embodiment, a self-correcting process is employed to fit the point process of the user behavior history. Under this assumption, the intensity function is of the form shown below:
in other embodiments, other point process models, such as poisson point processes, free-running point processes, etc., may also be employed, with various point process models having corresponding forms of intensity functions.
The intensity function parameter values corresponding to each user, such as μ, α and β in formula (4), μ in formula (5), etc., are determined by inputting the user characteristics and event history characteristics of the user into the trained neural network model.
The neural network model described above may be implemented by various forms of neural networks. For example, in one embodiment, the neural network model described above may be implemented using a time-sequential neural network, such as LSTM, RNN, or the like. In another embodiment, a Transformer may be used to implement the neural network model described above. In the case of a Transformer neural network model, the event sequence of the user may be input to the model at the same time, and the Transformer processes the event representations of the plurality of events based on the attention mechanism, thereby determining the parameter values of the intensity function.
Therefore, through multiple modes, the corresponding point process N can be determined for each user ii(t) and an intensity function λ i (t).
Next, micro-macro associative modeling is described. In embodiments of the present description, microscopic events are correlated with macroscopic states based on mean-field random differential equations, and modifications are made to existing equation forms.
The stochastic differential equation jsde (jump stored differential equalisation) was originally used to characterize the kinetic mechanism of the diffusive motion of particles. Combining this with mean field theory describing the macroscopic state of a large number of microscopic particles, a mean field JSDE model can be obtained.
In the context of user behavior events and user population macroscopic states, as described above, the user behaviors of m users may be represented as an m-point process, and the differential equation driven by the m-point process may be represented as:
in the above formula (6), x (t) is a state of a macroscopic quantity at time t, and Ni(t) is the ith point process with a defined intensity functionλi(t) of (d). Amplitude function hi(x) Representing the impact of the point process i on the macroscopic state.
According to one embodiment of the present description, it is assumed that the amplitude function has a linear form: h isi(x)=ai*x+ciThen, based on equation (6) above, the following compact form of representation can be obtained:
from this equation (7), it is assumed in the embodiments of the present specification that the contribution and influence of the point process of the user i on the macroscopic state depend on the expectation value of the macroscopic quantity
And is linear with it. This is obviously more practical, because in an actual scenario, the user individual generally cannot acquire all information of the macro state, such as x (t), and can only know the expected values as the aggregation result of the macro state, such as total sales of goods, and music collection.
To solve the differential equation, consider the more general form of the mean field JSDE:
based on the above general form of mean field JSDE, transformations can be performed using the ita lemma (Ito's formula). The ita theorem is directed to the microscopic particle motion (brownian motion) and diffusion processes, resulting in some rules that differentiate functions of random processes. Given the mean field JSDE in the form of equation (8) according to the ita theorem, then for a continuously differentiable function f (x, y), the following reasoning holds:
in the formula (9), x (0) is a macroscopic quantity at the initial time (t ═ 0 time), the second term on the right side of the formula can be regarded as an operation result of the classical chain derivative rule, and the third term is a jump term.
Next, based on the inference of equation (9), further transformation is performed in conjunction with equation (7). Specifically, let
Let f (x, y) be x and follow the procedure in halter strap theory
N in the formula (9)
i(t) use
Alternatively, in conjunction with the relationship of equation (7), the following differential equation can be obtained:
thus, by the above equation (10), the expected value of the macroscopic quantity to be predicted
Intensity function lambda with micro-point process
i(t) a direct connection is established.
Next, in a third stage of modeling, macroscopic state inference is performed. For this purpose, equation (10) needs to be solved.
As mentioned above, the modeling of micro-macro relationships in the embodiments of the present specification is based on the following assumptions: contribution and influence of the point process of user i on the macroscopic state depends on the expectation value of the macroscopic quantity
And is linear with it. That is, h is a general form of formula (8)
i(x, y) is reduced to h
i(x) And assume that:
hi(x)=aix+ci (11)
the amplitude function h in the formula (11)iIs substituted into equation (10), which can be written as an ordinary differential equation form as follows:
V′(t)=a(t)V(t)+y(t) (12)
wherein:
for the ordinary differential equation shown in equation (12), the form of its solution can be obtained:
thus, equation (15) shows the change in the macroscopic quantity expected value V (0) with time at the time when the initial time t is known to be 0, at the subsequent time.
In some special cases, the solution to the macroscopic quantity expectation in equation (15) has a simpler or more concise form.
In one case, the amplitude function is linear with x, hi(x)=aix is c in formula (11)iIs 0. In such a case, equation (15) can be simplified as:
in another case, it is assumed that the intensity function has an exponential form λi=exp{-vit and the coefficients satisfy vi> 0, then equation (15) can have a more direct analytical solution:
of course, when the intensity function has the above exponential form, ciIn the case of 0, equation (17) can be further simplified to include only the first term.
In the stage of estimating the macroscopic state, the ordinary differential equation ODE obtained by modeling in the second stage is solved to obtain the expected value of the macroscopic quantity
The expressions over time, as shown in the above equations (15), (16) and (17), can be used to predict the expected value of the macroscopic quantity in the actual scene.
The following describes a method of predicting the macroscopic state of a user population based on the analysis and derivation results of the above modeling process.
FIG. 4 illustrates a flow diagram of a method of predicting a user population macro-state, according to one embodiment. It is to be appreciated that the method can be performed by any apparatus, device, platform, cluster of devices having computing and processing capabilities. As shown in fig. 4, the method includes the following steps.
In step 41, based on the event sequence of each of the plurality of users, an event intensity function corresponding to the user is determined. Specifically, when the user group includes m users, the event sequence of each user i is obtained, and the event intensity function corresponding to the user i, that is, the intensity function λ, is determined according to the event sequencei(t)。
As previously described in connection with fig. 2 and 3, in embodiments of the present description, a point process is employed to model and fit user behavior. Different point process models correspond to different intensity function forms. In various embodiments, a Hawkes process, a self-correcting point process, a free-running point process, etc., may be selected as a point process that describes a series of behavioral actions (i.e., a sequence of events) of a user. For example, in the Hawkes point process model, the event intensity function λi(t) has the form shown in formula (4).
To determine the parameter values of the intensity function based on a particular point process model and the corresponding form of the intensity function, corresponding behavior-related features may be extracted based on the event sequences of the respective users i. The behavior-related characteristics may include, for example, attribute characteristics of the user i itself, and event characteristics of each event in the event sequence, such as an event occurrence time, an event type, a target value to which the event relates (e.g., a payment amount in a payment event), a device used, and the like.
And then inputting the behavior related characteristics into a neural network model to obtain parameter values in the intensity function corresponding to the user. For example, in the case where the intensity function takes the form of equation (4), this step may result in the parameter values μ, α, and β corresponding to the user i. Thus, based on the parameter values and the predetermined form of the intensity function, the event intensity function λ i (t) corresponding to the user i is obtained.
As previously mentioned, the neural network model may be implemented by various forms of neural networks. For example, in one embodiment, the neural network model described above may be implemented using a time-sequential neural network, such as LSTM, RNN, or the like. In another embodiment, a Transformer may be used to implement the neural network model described above.
The neural network model may be trained based on the likelihood of occurrence of an event. Specifically, in one embodiment, the neural network model can be obtained by training through the following steps. Firstly, a plurality of sample event sequences of a plurality of sample users can be obtained; then, the behavior related characteristics corresponding to the plurality of sample event sequences, including the attribute characteristics of the user, the characteristics of the events in the event sequences, and the like, are input into the neural network model. And obtaining the assumed intensity function corresponding to each sample user by the neural network model based on the model algorithm and the model parameters. For example, where the neural network model employs a Transformer model, the model algorithm herein includes processing the event features of individual events in the sequence of events based on an attention mechanism. The expression of the assumed intensity function is used here, since this is only an intermediate result obtained during the model training.
On the basis of the assumed intensity function, the likelihood that the plurality of sample users make the plurality of sample event sequences can be determined. For example, the likelihood that the sample user makes a plurality of sample event sequences as a whole can be obtained according to the foregoing formula (3). Next, the neural network model is trained with the likelihood maximization as a target. That is, model parameters in the neural network model are continuously adjusted by back propagation with the goal of likelihood increase until likelihood is maximized. Thus, a trained neural network model is obtained.
Based on the trained neural network model, an event intensity function λ of the current user i can be determined in step 41i(t)。
On the other hand, in
step 42, a first expected value at a first time t1 of a target macroscopic quantity x (t) of the user group consisting of the plurality of users is obtained
The first time is a time at which the expected value of the target macroscopic quantity is known. In one example, the first time is a certain historical time; in another example, the first time may also be the current time. In practice, this first time is often regarded as the initial time of the macro-state prediction, and therefore it is written as time 0, that is, t1 is set to 0. Thereby, the first desired value
Corresponding to V (0) in equations (15) to (17). It is understood that the first expected value V (0) is a reference expected value for macroscopic state prediction.
Further, in
step 43, the event intensity function λ is determined for each user i
i(t) and a magnitude function h for representing the degree of influence of the user i on the target macroscopic quantity
iDetermining a first intermediate function; wherein the amplitude function h of each user
iExpected value of target macroscopic quantity
A linear relation, wherein a proportionality coefficient of the linear relation is a first coefficient; the first intermediate function is a first coefficient and an event intensity function lambda of each user
i(t) sum of products.
As described previously, in the embodiment of the present specification, the amplitude function h is assumed
iDependent on the desired value of the target macroscopic quantity
And is linear with it. In particular, it is assumed that the amplitude function conforms to the form of equation (11), where the scaling factor a
iNamely the first coefficient. Accordingly, the first intermediate function corresponds to α (t), which satisfies the definition of equation (13), where α (t) is the first coefficient a of each user
iAnd an event intensity function λ
i(t) sum of products. It should be understood that the first intermediate function and the intensity function are both expressed as a function of time t as an argument.
Based on this, in step 44, a first time, a first expected value, and a second time after the first time are substituted into a first relational expression in which the expected value changes with time, so as to determine a second expected value of the target macroscopic quantity at the second time; wherein the first relation depends on an integral of the first intermediate function a (t) over time.
It will be appreciated that, according to one embodiment, the first relationship is determined by solving a mean field random differential equation JSDE which characterizes the association between the corresponding micro-point processes of the event sequences of the respective users and the target macro quantities. The initial form of the mean field JSDE is shown in equation (7) and includes the above-mentioned amplitude function h
i. By assuming that the amplitude function depends on the desired value of the target macroscopic quantity
And the linear relation is formed, and the derivation is carried out by combining the Itanium theorem, so that the equation forms of the formulas (10) and (12) can be obtained, and the first relation which is required for expressing the change of the expected value of the macroscopic quantity along with the time is obtained by solving the ordinary differential equation of the formula (12).
In one example, assume that the amplitude function hiIt is strictly linear with respect to the expected value, i.e., ci in equation (11) is 0. In such a case, the first relational expression includes, for the first periodAnd applying a first operation item obtained by natural exponential operation to the expectation value V (0), wherein the base number of the natural exponential operation is a natural constant e, and the exponent is an integral accumulated value of the first intermediate function alpha (t) between the first time (0) and the second time (t).
The first relation at this time corresponds to the formula (16) in which the natural exponent is calculated as
The first operation term is
In one embodiment, the amplitude function hiThe linear relation to the desired value is of a more general form (11) and includes a second non-zero coefficient ciAs an offset. In this case, the method further includes determining a second coefficient c corresponding to each useriAnd an event intensity function λi(t) determining a second intermediate function. It is understood that this second intermediate function corresponds to γ (t) in equation (14). In such a case, the resulting first relation also depends on the second intermediate function γ (t).
In particular, according to one embodiment, the first relation may include a first operand and a second operand, where: the first operation item is the same as the above, and includes applying natural exponential operation to the first expected value V (0), where the base of the natural exponential operation is a natural constant, and the exponent is an integral accumulated value of a value of the first intermediate function between the first time and the second time; the second operation item comprises the integration and accumulation of the value of the third intermediate function between the first time and the second time; the third intermediate function is a superposition of the second intermediate function and an integral function of the first intermediate function.
In one example, the first relation is shown in equation (15), wherein the first operation term is a right first term, the second operation term corresponds to a right second term, and the third intermediate function is a combination of the second intermediate function γ (t) and an integral function of the first intermediate function α (t)Is expressed as a function of, i.e.
In one specific example, the event intensity function λ
i(t) is in the form of an exponential decay over time. E.g. λ
i=exp{-v
it and the coefficients satisfy v
iIs greater than 0. In such a case, the first relation has a more straightforward and direct result, i.e. the natural exponent operation described above
The index of (1) is determined according to the value of the first intermediate function at the second moment; the operation result of the second operation term is determined according to the product of the difference obtained by subtracting the natural exponential operation result from 1 and a first scale coefficient, wherein the first scale coefficient is the ratio of the second intermediate function gamma (t) to the first intermediate function alpha (t) at a second moment.
Specifically, the first relational expression at this time may be as shown in equation (17):
wherein the result of the natural index operation is e
αtThe first scale factor is γ/α.
It is understood that the first coefficient ai and the second coefficient ci of each user i can be determined in a manner similar to "training". In other words, according to a large number of sample user behaviors and a known macroscopic quantity expected value, the predicted value is calculated according to the mode, and the first coefficient and the second coefficient of each user are determined by taking the minimization of the difference between the predicted value and the known macroscopic quantity expected value as a target. In the prediction stage shown in fig. 4, the expected macroscopic quantity value can be predicted based on the first coefficient and the second coefficient determined for each user i.
It will be appreciated that the method of fig. 4 is applicable to a variety of technical scenarios. For example, the event sequence of the user may include a purchase event in the e-commerce platform, and the expected value of the corresponding target macroscopic quantity may include a commodity sales quantity; or; the event sequence of the user comprises comment events aiming at the target object in the social platform, and the expected value of the corresponding target macroscopic quantity comprises the total comment quantity of the target object. The target objects can include various objects presented online, such as movies, songs, books, commodities, and even offline stores, and the total amount of comments can be embodied as a comment list. For another example, the event sequence of the user may include any operation event in the internet service platform, and the expected value of the corresponding target macroscopic quantity may include, access traffic, and the like. It will be appreciated that the above method may also be applicable to other more technical scenarios where there is a correlation between user micro-behavior and user population macro-state.
Reviewing the whole process, in the embodiment of the present specification, the event sequence of the user is modeled by a point process to obtain an event intensity function thereof, so as to better depict the microscopic user behavior. In addition, in the process of establishing the connection between the microscopic behaviors and the macroscopic state through the random differential equation in the form of the average field, the assumption that the user can observe the expected value of the macroscopic quantity and then influence the macroscopic state is made, the influence degree is in a linear relation with the expected value of the macroscopic quantity, the assumption is obviously more practical, and an approximate solvable ordinary differential equation can be obtained. By solving the ordinary differential equation, an explicit relation of expected values over time can be obtained, which can be directly used for predicting the macroscopic state quantity.
According to an embodiment of another aspect, an apparatus for predicting a macroscopic state of a user population is provided. Fig. 5 shows a schematic structural diagram of a prediction apparatus according to an embodiment, which may be deployed in any device, platform or device cluster having data storage, computation, and processing capabilities. As shown in fig. 5, the prediction apparatus 500 includes:
an intensity function determining unit 51 configured to determine an event intensity function corresponding to each of the plurality of users based on the event sequence of the user;
a first obtaining unit 52 configured to obtain a first expected value of a target macroscopic quantity of a user group constituted by the plurality of users at a first time, the target macroscopic quantity depending on events made by the respective users;
an intermediate function determining unit 53, configured to determine a first intermediate function according to the event intensity function corresponding to each user and a magnitude function for representing the degree of influence of the user on the target macroscopic quantity; the amplitude function of each user is in a linear relation with the expected value of the target macroscopic quantity, and the proportionality coefficient of the linear relation is a first coefficient; the first intermediate function is determined based on the sum of the products of the first coefficients of the respective users and the event intensity function;
a prediction unit 54 configured to substitute the first time, a first expected value, and a second time after the first time into a first relational expression in which an expected value changes with time, thereby determining a second expected value of the target macroscopic quantity at the second time; wherein the first relation depends on an integral of the first intermediate function over time.
According to an embodiment, the intensity function determination unit 51 is specifically configured to:
extracting the behavior related characteristics of the user based on the event sequence of the user;
inputting the behavior related characteristics into a neural network model to obtain parameter values in the intensity function corresponding to the user;
and obtaining an event intensity function corresponding to the user based on the parameter value and a preset form of the intensity function.
Further, in one embodiment, the neural network model may be trained based on: obtaining a plurality of sample event sequences of a plurality of sample users; inputting the behavior related characteristics corresponding to the plurality of sample event sequences into the neural network model to obtain an assumed intensity function corresponding to each sample user; determining, based on the postulated strength function, a likelihood that the plurality of sample users made the plurality of sample event sequences; and training the neural network model by taking the maximum likelihood as a target.
In various embodiments, the predetermined form of the event intensity function depends on a point process that fits the user behavior, the point process being selected from one of: a Hawkes process, a self-correcting point process, a self-exciting point process.
In a specific embodiment, the first relation includes a first operation term obtained by applying a natural exponent operation to the first expected value, where a base of the natural exponent operation is a natural constant, and an exponent is an integral accumulated value of values of the first intermediate function between the first time and the second time.
In one embodiment, the linear relationship further includes a second coefficient as an offset; the method further comprises determining a second intermediate function based on a sum of products of a second coefficient corresponding to each user and the event intensity function; the first relation is also dependent on the second intermediate function.
Further, in one embodiment, the first relation may include a first operand and a second operand, where: the first operation item comprises applying natural exponential operation on the first expected value, wherein the base number of the natural exponential operation is a natural constant, and the exponent is an integral accumulated value of values of the first intermediate function between the first time and the second time; the second operation item comprises the integration and accumulation of the value of the third intermediate function between the first time and the second time; the third intermediate function is a superposition of the second intermediate function and an integral function of the first intermediate function.
In a further embodiment, the event intensity function is in the form of an exponential decay over time; the index in the natural index operation is determined according to the value of the first intermediate function at the second moment; and the operation result of the second operation item is determined according to the product of the difference obtained by subtracting the natural exponential operation result from 1 and a first proportional coefficient, wherein the first proportional coefficient is the ratio of the second intermediate function to the first intermediate function at a second moment.
According to one embodiment, the first relation is determined by solving a mean-field stochastic differential equation characterizing the correlation between the corresponding micro-point process of the event sequence of the respective user and the target macro quantity, the mean-field stochastic differential equation including the amplitude function.
In various embodiments, the sequence of events may include a purchase event in an e-commerce platform, the expected value of the target macroscopic quantity including a commodity sales quantity; or; the event sequence comprises comment events aiming at the target object in the social platform, and the expected value of the target macroscopic quantity can comprise the total comment amount of the target object; or; the event sequence comprises any operation event of a user in the Internet service platform, and the expected value of the target macroscopic quantity comprises access flow.
Through the device, the service platform can predict the expected value of the macroscopic quantity of the user group based on the event sequence formed by the user microscopic behaviors, so that service business deployment is carried out according to the expected value of the macroscopic quantity.
According to an embodiment of another aspect, there is also provided a computer-readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method described in connection with fig. 4.
According to an embodiment of yet another aspect, there is also provided a computing device comprising a memory and a processor, the memory having stored therein executable code, the processor, when executing the executable code, implementing the method described in connection with fig. 4.
Those skilled in the art will recognize that, in one or more of the examples described above, the functions described in this invention may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium.
The above-mentioned embodiments, objects, technical solutions and advantages of the present invention are further described in detail, it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made on the basis of the technical solutions of the present invention should be included in the scope of the present invention.