CN111160600A - Behavior prediction method, behavior prediction device, computer equipment and storage medium - Google Patents

Behavior prediction method, behavior prediction device, computer equipment and storage medium Download PDF

Info

Publication number
CN111160600A
CN111160600A CN201911147778.4A CN201911147778A CN111160600A CN 111160600 A CN111160600 A CN 111160600A CN 201911147778 A CN201911147778 A CN 201911147778A CN 111160600 A CN111160600 A CN 111160600A
Authority
CN
China
Prior art keywords
data
module
time
feature
time interval
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911147778.4A
Other languages
Chinese (zh)
Inventor
王帝
程建波
彭南博
敖滨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
JD Digital Technology Holdings Co Ltd
Original Assignee
JD Digital Technology Holdings Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by JD Digital Technology Holdings Co Ltd filed Critical JD Digital Technology Holdings Co Ltd
Priority to CN201911147778.4A priority Critical patent/CN111160600A/en
Publication of CN111160600A publication Critical patent/CN111160600A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biophysics (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Human Resources & Organizations (AREA)
  • Game Theory and Decision Science (AREA)
  • Development Economics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application relates to a behavior prediction method, a behavior prediction device, a computer device and a storage medium, wherein the method comprises the following steps: acquiring existing time series data corresponding to the target behavior; inputting each feature data and a time interval between every two adjacent sampling moments into a preset time recurrent neural network model, wherein the preset time recurrent neural network model is obtained by pre-training according to a training sample; the preset time recursive neural network model comprises a preset time interval sensing module, the preset time interval sensing module is used for respectively carrying out high-dimensional mapping on the feature data and the time interval, fusing the high-dimensional mapping data of the feature data and the high-dimensional mapping data of the time interval to obtain feature fusion data, and reducing the dimensions of the feature fusion data to obtain dimension reduction data, wherein the dimensions of the dimension reduction data are the same as the dimensions of the feature data; and determining a prediction result corresponding to the target behavior according to the output of the recurrent neural network model in the preset time, so that the accuracy and the prediction efficiency of the behavior prediction result are improved.

Description

Behavior prediction method, behavior prediction device, computer equipment and storage medium
Technical Field
The present application relates to computer technologies, and in particular, to a behavior prediction method, apparatus, computer device, and storage medium.
Background
The time sequence data refers to a sequence of the same statistical index arranged according to the time sequence of occurrence. A large amount of time-series data is generally generated in daily life. For example, stock closing prices updated once a day; counting the power consumption once per month; paying a bill with order amount and payment time generated once by using the mobile phone; income of listed companies published once a quarter; a history generated by the browser web page every click.
Generally, research analysis can be performed on time series data based on a time series model, and the development change rule of a research object is obtained so as to predict the future situation of the research object. Currently, the existing time series models are mainly divided into two categories: one type is a traditional time series analysis model based on statistical theory, such as: autoregressive Model (AR), Moving Average Model (MA), Autoregressive Moving Average Model (ARMA), Autoregressive Conditional variant difference Model (ARCH), Generalized Autoregressive Conditional variant difference Model (GARCH); another class is machine learning based sequence models such as: a Recurrent Neural Network (RNN), a Long Short Term Memory network (LSTM), and a Gated Recurrent network (GRU).
When the time series data is researched and analyzed based on the existing time series model to predict the user behavior, a basic assumption needs to be made: the collection of data points is regular, i.e. the time intervals between data are equal. However, this assumption is difficult to satisfy in practical applications because observers have different data observation recording modes. For example, the time series data formed by annual accounting of companies must be at equal time intervals; however, for order data generated every time an order is placed, since the order placing time is random, a set of sequence data with unequal time intervals is formed.
In contrast, in the prior art, there are two methods for performing research processing on time series data with unequal time intervals. The first processing mode is as follows: taking the interval between the current time and the previous time in the time series data as a feature, and incorporating the feature into a feature space of the current time, for example, a certain customer completes an order in each of days 1 month 3 and 1 month 20, where the feature space of the order is: amount (dollar), payment (1 is online payment, 0 is cash on delivery), delivery (0 is land transportation, 1 is air transportation), i.e. the feature data corresponding to the two orders can be represented as [100,1,0] and [78,1,1], if the feature data corresponding to the two orders is changed in consideration of the time interval: [100,1,0,0], [78,1,1,17] where 0 indicates that no orders were available until 1 month and 3 days of the order, and 17 indicates that an order was available 17 days before the 1 month and 20 days of the order. The second processing mode is as follows: the data in the middle of the time interval is filled with 0, i.e. in the above example, the two pieces of feature data are filled to 18 pieces of feature data, the first and last pieces are [100,1,0] and [78,1,1], respectively, and the middle 16 pieces of feature data are [0,0,0 ].
In the process of implementing the invention, the inventor finds that the main problems in the prior art comprise: 1) the processing mode is only to take the time interval as one characteristic, so that the influence of the time interval on other characteristics cannot be reflected, and the prediction result is not accurate; 2) the data volume is increased sharply, the increased data are useless data, and excessive invalid values greatly reduce the fitting efficiency and the training effect of the model, so that the accuracy of the prediction result is also reduced.
Disclosure of Invention
In order to solve the technical problem, the application provides a behavior prediction method, a behavior prediction device, a computer device and a storage medium.
In a first aspect, an embodiment of the present application provides a behavior prediction method, including:
acquiring existing time series data corresponding to a target behavior, wherein the existing time series data comprise characteristic data acquired at least two sampling moments;
inputting each feature data and a time interval between every two adjacent sampling moments into a preset time recurrent neural network model, wherein the preset time recurrent neural network model is obtained by pre-training according to a training sample; the preset time recursive neural network model comprises a preset time interval sensing module, the preset time interval sensing module is used for respectively carrying out high-dimensional mapping on the feature data and the time interval, fusing the high-dimensional mapping data of the feature data and the high-dimensional mapping data of the time interval to obtain feature fusion data, and reducing the dimensions of the feature fusion data to obtain dimension reduction data, wherein the dimensions of the dimension reduction data are the same as the dimensions of the feature data;
and determining a prediction result corresponding to the target behavior according to the output of the recurrent neural network model in the preset time.
In a second aspect, an embodiment of the present application provides a behavior prediction apparatus, including:
the existing time sequence data acquisition module is used for acquiring existing time sequence data corresponding to the target behavior, wherein the existing time sequence data comprises characteristic data acquired at least two sampling moments;
the data input module is used for inputting the characteristic data and the time interval between every two adjacent sampling moments into a preset time recurrent neural network model, wherein the preset time recurrent neural network model is obtained by pre-training according to training samples; the preset time recursive neural network model comprises a preset time interval sensing module, the preset time interval sensing module is used for respectively carrying out high-dimensional mapping on the feature data and the time interval, fusing the high-dimensional mapping data of the feature data and the high-dimensional mapping data of the time interval to obtain feature fusion data, and reducing the dimensions of the feature fusion data to obtain dimension reduction data, wherein the dimensions of the dimension reduction data are the same as the dimensions of the feature data;
and the prediction result determining module is used for determining a prediction result corresponding to the target behavior according to the output of the recurrent neural network model in the preset time.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
acquiring existing time series data corresponding to a target behavior, wherein the existing time series data comprise characteristic data acquired at least two sampling moments;
inputting each feature data and a time interval between every two adjacent sampling moments into a preset time recurrent neural network model, wherein the preset time recurrent neural network model is obtained by pre-training according to a training sample; the preset time recursive neural network model comprises a preset time interval sensing module, the preset time interval sensing module is used for respectively carrying out high-dimensional mapping on the feature data and the time interval, fusing the high-dimensional mapping data of the feature data and the high-dimensional mapping data of the time interval to obtain feature fusion data, and reducing the dimensions of the feature fusion data to obtain dimension reduction data, wherein the dimensions of the dimension reduction data are the same as the dimensions of the feature data;
and determining a prediction result corresponding to the target behavior according to the output of the recurrent neural network model in the preset time.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring existing time series data corresponding to a target behavior, wherein the existing time series data comprise characteristic data acquired at least two sampling moments;
inputting each feature data and a time interval between every two adjacent sampling moments into a preset time recurrent neural network model, wherein the preset time recurrent neural network model is obtained by pre-training according to a training sample; the preset time recursive neural network model comprises a preset time interval sensing module, the preset time interval sensing module is used for respectively carrying out high-dimensional mapping on the feature data and the time interval, fusing the high-dimensional mapping data of the feature data and the high-dimensional mapping data of the time interval to obtain feature fusion data, and reducing the dimensions of the feature fusion data to obtain dimension reduction data, wherein the dimensions of the dimension reduction data are the same as the dimensions of the feature data;
and determining a prediction result corresponding to the target behavior according to the output of the recurrent neural network model in the preset time.
The behavior prediction method, the behavior prediction device, the computer equipment and the storage medium comprise the following steps: acquiring existing time series data corresponding to a target behavior, wherein the existing time series data comprise characteristic data acquired at least two sampling moments; inputting each feature data and a time interval between every two adjacent sampling moments into a preset time recurrent neural network model, wherein the preset time recurrent neural network model is obtained by pre-training according to a training sample; the preset time recursive neural network model comprises a preset time interval sensing module, the preset time interval sensing module is used for respectively carrying out high-dimensional mapping on the feature data and the time interval, fusing the high-dimensional mapping data of the feature data and the high-dimensional mapping data of the time interval to obtain feature fusion data, and reducing the dimensions of the feature fusion data to obtain dimension reduction data, wherein the dimensions of the dimension reduction data are the same as the dimensions of the feature data; and determining a prediction result corresponding to the target behavior according to the output of the recurrent neural network model in the preset time. A preset time interval sensing module is added in the preset time recurrent neural network model, and input time intervals and characteristic data can be fused through the preset time interval sensing module, so that time sequence data and corresponding time intervals are directly modeled from a model level, the influence of the time intervals on the characteristic data can be considered in a prediction result, useless data does not need to be added, and the prediction accuracy and the prediction efficiency are improved.
Drawings
FIG. 1 is a diagram of an application environment of a behavior prediction method in one embodiment;
FIG. 2 is a flow diagram that illustrates a method for behavior prediction in one embodiment;
FIG. 3 is a schematic diagram of a structure of a recurrent neural network model with predetermined time according to an embodiment;
FIG. 4 is a diagram illustrating a structure of a predetermined neuron in one embodiment;
FIG. 5 is a flow diagram of a behavior prediction method in another embodiment;
FIG. 6 is a diagram illustrating a preset neuron structure according to another embodiment;
FIG. 7 is a schematic diagram of an embodiment of an apparatus for behavior prediction;
FIG. 8 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
FIG. 1 is a diagram of an application environment of a behavior prediction method in one embodiment. Referring to fig. 1, the behavior prediction method is applied to a behavior prediction system. The behavior prediction system includes a terminal 110 and a server 120. The terminal 110 and the server 120 are connected through a network. The terminal 110 may specifically be a desktop terminal or a mobile terminal, and the mobile terminal may specifically be at least one of a mobile phone, a tablet computer, a notebook computer, and the like. The server 120 may be implemented as a stand-alone server or a server cluster composed of a plurality of servers.
In one embodiment, as shown in FIG. 2, a behavior prediction method is provided. The embodiment is mainly illustrated by applying the method to the terminal 110 (or the server 120) in fig. 1. Referring to fig. 2, the behavior prediction method specifically includes the following steps:
step S201, obtaining existing time series data corresponding to the target behavior.
In this embodiment, the existing time series data includes feature data acquired at least two sampling instants.
The target behavior may refer to any event that may occur multiple times over time, such as a user loan behavior, a user shopping consumption behavior, a page browsing behavior, an order payment behavior, and the like on the e-commerce platform. The existing time-series data may be a series of existing data generated by the target behavior at each historical time. The present embodiment may collect corresponding existing data as the feature data of the sampling time when the target behavior occurs each time, where the sampling time is the occurrence time of the target behavior. The existing time sequence data can be a sequence formed by arranging the characteristic data acquired at each sampling moment according to the time sequence. The feature data collected at each sampling instant may include one or more feature parameters to characterize the target behavior data at that sampling instant. Wherein each feature parameter may constitute a feature space of the sampling instant.
In one embodiment, when the target behavior is a user shopping consumption behavior, the user generates an order for each consumption, and each order includes information such as but not limited to payment amount, payment method and delivery method. In this embodiment, the three information of the payment amount, the payment method, and the distribution method may be used as the characteristic parameters, that is, the characteristic data collected at each sampling time is: payment amount, payment method, and delivery method. For example, in the payment mode, 1 represents online payment, and 0 represents payment due; in the distribution mode, when 0 represents land transportation and 1 represents air transportation, the feature data collected at a certain sampling moment can be represented by a vector mode as follows: [100,1,0]. The existing time sequence data corresponding to the target behavior refers to a sequence formed by arranging the characteristic data acquired at each sampling moment according to the time sequence, for example, the existing time sequence data is as follows: [100,1,0],[78,1,1],[150,1,1].
Step S202, inputting each feature data and the time interval between every two adjacent sampling moments into a preset time recurrent neural network model.
In the embodiment, the recurrent neural network model with preset time is obtained by pre-training according to the training sample; the preset time recursive neural network model comprises a preset time interval sensing module, wherein the preset time interval sensing module is used for respectively carrying out high-dimensional mapping on the feature data and the time interval, fusing the high-dimensional mapping data of the feature data and the high-dimensional mapping data of the time interval to obtain feature fusion data, and reducing the dimensions of the feature fusion data to obtain dimension reduction data, wherein the dimensions of the dimension reduction data are the same as the dimensions of the feature data.
The preset time recursion neural network model can be an artificial neural network model for carrying out time recursion on input information based on the connection sequence of network nodes, namely, the output result corresponding to the current time is determined by using a memory part of the input information at the historical time and the input information at the current time, so that the future situation can be predicted according to historical data. The specific structure of the preset time recursive network model can be preset based on the service scene and the actual requirement. The preset time interval sensing module is a module obtained by directly modeling the time series data and the corresponding time intervals from a model level, and is used for fusing the time intervals and the characteristic data so as to analyze the influence of the time intervals on the characteristic data.
Specifically, the present embodiment separately inputs the feature data corresponding to each sampling time and the time interval between two adjacent sampling times into the predetermined time recurrent neural network model. The preset time recurrent neural network model may include a plurality of preset neurons, and each preset neuron corresponds to the feature data acquired at each sampling time one to one. Each preset neuron can comprise a preset time interval sensing module so as to utilize the preset time interval processing model to carry out high-dimensional mapping on the feature data input before the current sampling moment to obtain high-dimensional mapping data of the feature data, high-dimensional mapping is carried out on the time interval between the current sampling moment and the last sampling moment to obtain high-dimensional mapping data of the current time interval, fusing the high-dimensional mapping data of the characteristic data and the high-dimensional mapping data of the time interval to obtain fused data, performing dimensionality reduction on the fused data to obtain dimensionality reduction data, fusing time interval data and feature data to obtain the influence condition of the time interval on the previously input feature data, performing integration processing on the feature data at the current sampling moment based on the fusion result, so that the output result of the pre-set time recurrent neural network model can take into account the influence of the time interval on the feature data.
It should be noted that, before the pre-set time recurrent neural network model is used, a training process for the pre-set time recurrent neural network model is also included. The training samples in this embodiment may include a plurality of time series data samples corresponding to the target behavior and an expected output result corresponding to each time series data sample. The method comprises the steps of inputting each time sequence data sample and the time interval between every two adjacent sampling moments in the time sequence data samples into a preset time recurrent neural network model, obtaining an actual output result of the preset time recurrent neural network model, determining an output error according to the actual output result and a corresponding expected output result, reversely transmitting the output error to the preset time recurrent neural network model when the output error is larger than an allowable error, adjusting network parameters in the preset time recurrent neural network model, training the preset time recurrent neural network model by utilizing a reverse transmission mechanism, and indicating that the training of the preset time recurrent neural network model is finished when the output error is smaller than or equal to the preset error.
Step S203, determining a prediction result corresponding to the target behavior according to the output of the recurrent neural network model in the preset time.
Specifically, the present embodiment may use an output result of the recurrent neural network model with a preset time as a prediction result corresponding to the target behavior. For example, when the loan default probability of the future loan behavior is predicted, the output value of the preset time recurrent neural network model is the predicted loan default probability corresponding to the loan behavior. The influence of the time interval on the characteristic data can be analyzed by utilizing a preset time interval sensing module in the preset time recurrent neural network model, so that the influence of the time interval can be considered in the prediction result, and the accuracy of the prediction result is improved.
In the technical scheme of this embodiment, the time interval between two adjacent sampling moments is not incorporated as a feature into a feature space formed by feature data, but is independently input into a preset time recurrent neural network model with the feature data, a preset time interval sensing module is added in the preset time recurrent neural network model, and the input time interval and the feature data can be fused through the preset time interval sensing module, so that the time series data and the corresponding time interval are directly modeled from a model level, the influence of the time interval on the feature data can be considered in a prediction result, and useless data does not need to be added, thereby improving prediction accuracy and prediction efficiency.
On the basis of the above technical solution, fig. 3 shows a schematic structural diagram of a recurrent neural network model with preset time. Fig. 4 shows a schematic diagram of a predetermined neuron structure. As shown in fig. 3, the time-recursive neural network 300 includes at least two preset neurons 400, and two adjacent preset neurons 400 are connected to perform time recursion, and the memory information obtained by a preset neuron before a certain preset neuron is transferred to the preset neuron for processing, so that the future situation can be predicted by using historical data. As shown in fig. 4, each preset neuron 400 includes a forgetting module 410, an input module 420, a cell memory state module 430, a hidden state module 440, an output module 450, and a preset time interval sensing module 460. The functions of the same module in the preset neurons at different positions are the same, and the present embodiment takes the current preset neuron as an example, and the functions of the modules 410 and 416 in the preset neurons are explained as follows.
In the current preset neuron, the forgetting module 410 is configured to determine data to be discarded from feature data corresponding to a current sampling time and historical encoded data corresponding to historical time series data, where the historical time series data includes feature data corresponding to each historical sampling time before the current sampling time; the historical encoded data is the output of the hidden state module 440 in the last predetermined neuron; the input module 420 is used for determining data to be added and memory state data of candidate cells from the feature data and the historical encoding data corresponding to the current sampling moment; the preset time interval sensing module 460 is specifically configured to: respectively carrying out high-dimensional mapping on the last memory cell state data and the time interval between the current sampling time and the last sampling time, fusing the high-dimensional mapping data of the last memory cell state data and the high-dimensional mapping data of the time interval between the current sampling time and the last sampling time to obtain the fused data of the last memory cell state data, carrying out dimensionality reduction on the fused data of the last memory cell state data to obtain the fused data of the last memory cell state data after dimensionality reduction, wherein the fused data of the last memory cell state data after dimensionality reduction is the same as the dimensionality of the last memory cell state data, and the last memory cell state data can be useful feature data screened from feature data corresponding to each historical sampling time before the current sampling time; the previous cell memory state data is the output result data of the cell memory state module 430 in the previous predetermined neuron; the cell memory state module 430 is configured to discard data to be discarded from the fusion data of the last memory cell state data after dimensionality reduction, perform data addition according to the data to be added and the candidate cell memory state data, obtain current cell memory state data, and output the current cell memory state data; the hidden state module 440 is configured to determine data to be output according to the feature data corresponding to the current sampling time and the historical encoding data corresponding to the historical time sequence data, and determine current encoding data corresponding to the current time sequence data according to the data to be output and the current cell memory state data; the current time sequence data comprises characteristic data corresponding to the current sampling time and each historical sampling time; the output module 450 is configured to determine output data corresponding to the target behavior at the current sampling time according to the current encoded data.
In the current preset neuron, the last cell memory state data is updated by using the preset time interval sensing module 460 to update the time interval between the current sampling time and the last sampling time, so that the fused data of the last cell memory state data after dimensionality reduction is the data after the time interval is acted, and the influence of the time interval can be considered in the final output data.
In the pre-set time recurrent neural network model 300, the number of pre-set neurons may be equal to the number of feature data, and each pre-set neuron corresponds to the feature data one-to-one, so that the feature data corresponding to the current sampling time and the time interval between the current sampling time and the last sampling time are input into the corresponding current pre-set neuron. As shown in fig. 4, the connection manner between two adjacent preset neurons is as follows: a first input end 1 of the preset time interval sensing module 460 in the current preset neuron is connected with an output end of the cell memory state module 430 in the last preset neuron; the input end of the forgetting module 410, the input end of the input module 420, and the first input end 1 of the hidden state module 440 in the current preset neuron are all connected to the output end of the hidden state module 440 in the previous preset neuron. It should be noted that the last cell memory state data and the historical encoding data of the first predetermined neuron in the predetermined time recurrent neural network model 300 are both null data, i.e. the first input 1 of the predetermined time interval sensing module 460 in the first predetermined neuron is set to null.
As shown in fig. 4, the connection mode of each module in the current preset neuron is as follows: the first input terminal 1 of the cell memory state module 430 is connected to the output terminal of the preset time interval sensing module 460; the second input end 2 of the cell memory state module 430 is connected with the output end of the forgetting module 410; the third input terminal 3 of the cell memory state module 430 is connected with the output terminal of the input module 420; the output terminal of the cell memory state module 430 is connected to the second input terminal 2 of the hidden state module 440; the output of the hidden state module 440 is connected to the input of the output module 450.
On the basis of the above technical solution, the step S202 of inputting each feature data and the time interval between every two adjacent moments into a preset time recurrent neural network model includes: inputting the time interval between the current sampling time and the last cell memory state data to the second input terminal 2 of the preset time interval sensing module 460 in the current preset neuron; the feature data corresponding to the current sampling time is all input to the input end of the forgetting module 410, the input end of the input module 420, and the second input end 2 of the hidden state module 440 in the current preset neuron.
Specifically, when the feature data corresponding to each sampling time and the time interval between every two adjacent sampling times are input into the preset time recurrent neural network model, the feature data corresponding to each sampling time and the time interval between two adjacent sampling times are respectively input into the preset neuron corresponding to the feature data. In one embodiment, a first feature data in the existing time series data and a time interval are input into a first preset neuron in a preset time recurrent neural network model, wherein the time interval input in the first preset neuron is zero; inputting second characteristic data in the existing time sequence data and a time interval between a second sampling moment and a first sampling moment into a second preset neuron in the preset time recurrent neural network model respectively; and analogizing until the last feature data in the existing time sequence data and the time interval between the last sampling time and the last sampling time are respectively input into the last preset neuron in the preset time recurrent neural network model.
It should be noted that each preset neuron in the preset time recurrent neural network model corresponds to one output module, so that output data corresponding to each sampling time can be obtained, that is, a prediction result corresponding to each sampling time can be obtained, dynamic prediction and monitoring of a target behavior are realized, and the output data of the last preset neuron is obtained by integrating all previous characteristic data, so that the prediction result of the last preset neuron is more accurate and has a reference value.
In one embodiment, as shown in fig. 5, the behavior prediction method includes the steps of:
step S301, existing time series data corresponding to the target behavior are obtained.
In this particular embodiment, the existing time series data includes feature data acquired at least two sampling instants.
Specifically, the number of preset neurons in the preset time recurrent neural network model is the same as the number of feature data, that is, the preset neurons correspond to the feature data one to one. When the characteristic data and the time interval between every two adjacent sampling moments are input into the preset time recurrent neural network model, the characteristic data acquired at each sampling moment and the time interval between the sampling moment and the last sampling moment are input into corresponding preset neurons in the preset time recurrent neural network model. The following operations of steps S302 to S307 are performed for the feature data acquired at each sampling timing in the existing time-series data.
In step S302, the time interval between the current sampling time and the previous cell memory state data are input to the preset time interval sensing module 460.
In this embodiment, the preset time interval sensing module 460 performs high-dimensional mapping on the previous memory cell state data and the time interval between the current sampling time and the previous sampling time, fuses the high-dimensional mapping data of the previous memory cell state data and the high-dimensional mapping data of the time interval between the current sampling time and the previous sampling time to obtain the fusion data of the previous memory cell state data, performs dimensionality reduction on the fusion data of the previous memory cell state data, and outputs the fusion data of the previous memory cell state data after dimensionality reduction, where the fusion data of the previous memory cell state data after dimensionality reduction is the same as the dimensionality of the previous memory cell state data.
Fig. 6 shows a schematic structural diagram of a current neuron. Each of the preset neurons in the present embodiment has the same structure. The previous cell memory state data is the output result data of the cell memory state module 430 in the previous neuron of the current predetermined neuron.
In an embodiment, the preset time interval sensing module 460 may respectively perform high-dimensional mapping on the previous memory cell state data and the time interval between the current sampling time and the previous sampling time, fuse the high-dimensional mapping data of the previous memory cell state data and the high-dimensional mapping data of the time interval between the current sampling time and the previous sampling time to obtain the fused data of the previous memory cell state data, perform dimensionality reduction on the fused data of the previous memory cell state data to obtain the fused data of the previous memory cell state data after dimensionality reduction, where the fused data of the previous memory cell state data after dimensionality reduction is the same as the dimensionality of the previous memory cell state data:
Figure BDA0002282688730000141
wherein,
Figure BDA0002282688730000142
the feature vector of the fusion data of the last memory cell state data after dimension reduction; tan h is a hyperbolic tangent function; c. Ct-1Is the feature vector corresponding to the previous cell memory state data; w is aHFor training the resulting row vector, wHFor pair ct-1Performing a high-dimensional mapping, BH、WR、BRAnd BDA matrix obtained for training; Δ t is the time interval between the current sampling instant t and the last sampling instant t-1; w is aLFor training the resulting row vectors, bLColumn vectors obtained for training ⊙ Hadamard multiplication, WRFor high-dimensional mapping of Δ t to WRAnd BHHaving the same dimension, wLUsed for reducing the dimension of the fusion data.
In particular, feature vectors
Figure BDA0002282688730000151
And a feature vector ct-1Column vectors of the same dimension; w is aHFor training the resulting row vector, wHFor pair ct-1Performing high-dimensional mapping, i.e. column vectors ct-1And a row vector wHMultiplying to obtain a matrix ct-1wHI.e. up-scaling the one-dimensional data to two-dimensionalAnd (4) matrix. For matrix ct-1wHAdding a bias matrix BHPerforming tanh operation to obtain matrix Ct-1=tanh(ct-1wH+BH). Matrix WRFor high-dimensional mapping of Δ t such that WRAnd BHHaving the same dimension, the sampling matrix is raised to the constant Δ t, i.e. WRΔ t, plus bias matrix BRAnd performing tanh to obtain a power exponent, wherein the power exponent is a natural base number e power exponent, and obtaining a matrix
Figure BDA0002282688730000152
Matrix array
Figure BDA0002282688730000153
Is a conversion factor. C is to bet-1=tanh(ct-1wH+BH) And prepared conversion factor
Figure BDA0002282688730000154
Multiply and add an offset matrix BDPerforming tanh operation to obtain
Figure BDA0002282688730000155
The conversion factor is used for the pair C in the high-dimensional spacet-1=tanh(ct-1wH+BH) Is converted. Matrix array
Figure BDA0002282688730000156
And a row vector wLMultiplying to obtain a column vector, adding b to the column vectorLAnd performing tanh operation to obtain
Figure BDA0002282688730000157
Because different data sets in the low-dimensional space have a cross phenomenon, before data is converted, the data is mapped to the high-dimensional space, so that the data crossed in the low-dimensional space presents a data non-intersection phenomenon in the high-dimensional space, and the purpose of data splitting is achieved. B isH、WR、BRAnd BDFor training the resulting matrix, where BH、BRAnd BDIs a bias matrix for adding non-linear features; bLAnd training the obtained bias vector to add nonlinear features, wherein the addition of the nonlinear features can enrich the features. And the dimensionality of the data after the dimensionality is reduced to the dimensionality before the dimensionality of the data, so that the consistency of the dimensionality of the data is ensured, and the calculation is facilitated.
Wherein in the expression in the present embodiment
Figure BDA0002282688730000158
For the discount function, WRIs obtained based on training samples pre-training, which may specifically reflect the impact of time intervals on future behavior. In one embodiment, when WRWhen the value is positive, the discount function is presented
Figure BDA0002282688730000161
Is a monotonically increasing function of at, i.e. the longer the time interval,
Figure BDA0002282688730000162
the larger the value of (c), for example, in predicting the probability of loan default, the cumulative increase in the future impact of each default amount that occurred previously is a function of the future. When W isRWhen the value is negative, the discount function
Figure BDA0002282688730000163
Is a monotonically decreasing function of at, i.e. the longer the time interval,
Figure BDA0002282688730000164
the smaller the value of (a), for example, the influence of the amount of each consumption occurred before on the future is a cumulative decreasing process when predicting the consumption capacity, i.e., the longer the time interval, the less the previous consumption capacity can represent the current consumption capacity.
Step S303, the feature data corresponding to the current sampling time is input to the forgetting module 410.
In this embodiment, the forgetting module 410 determines and outputs the data to be discarded from the feature data and the history encoded data corresponding to the current sampling time.
The historical encoded data is the output result of the hidden state module 440 in the last predetermined neuron. Specifically, the internal structure of the forgetting module in this embodiment may include a forgetting gate sigmoid, so as to selectively perform data filtering on the feature data and the history encoded data corresponding to the current sampling time, and determine the data to be discarded.
In one embodiment, the forgetting module 410 may determine the data to be discarded from the feature data corresponding to the current sampling time and the historical encoding data corresponding to the historical time series data based on the following formula:
ft=σ(Wfxt+Ufht-1+bf)
wherein f istA data vector corresponding to the data to be discarded; x is the number oftA feature vector corresponding to feature data corresponding to the current sampling moment t; h ist-1Historical encoding data corresponding to the historical time series data; wfAnd UfThe forgetting weight matrixes are obtained by pre-training according to training samples; bfIs a forgetting offset vector obtained by pre-training according to a training sample; σ is Sigmoid growth curve function.
Specifically, in this embodiment, the forgetting module 410 performs a linear transformation on the feature data and the history encoded data corresponding to the current sampling time, and then performs Sigmoid activation, so as to determine the to-be-discarded data f in the feature data and the history encoded data corresponding to the current sampling timetAt this time, f is outputtedtIs a data between 0 and 1, where "1" means "fully reserved"; "0" means "completely discarded".
In step S304, the feature data corresponding to the current sampling time is input to the input module 420.
In this embodiment, the data to be added and the memory state data of the candidate cells are determined and output from the feature data and the historical encoding data corresponding to the current sampling time through the input module 420.
Specifically, the internal structure of the input module 420 in this embodiment may include an input gate sigmoid and a tanh layer, where the input gate sigmoid may selectively perform data update on the feature data and the historical encoded data corresponding to the current sampling time, and determine data to be added; a new candidate cell memory state data can be created by the tanh layer to be added to the cell memory state data.
In one embodiment, the input module 420 may determine the data to be added and the candidate cell memory state data from the feature data corresponding to the current sampling time and the historical encoding data corresponding to the historical time series data based on the following formula:
it=σ(Wixt+Uiht-1+bi)
Figure BDA0002282688730000171
wherein itA data vector corresponding to the data to be added;
Figure BDA0002282688730000172
the characteristic vector corresponding to the memory state data of the candidate cells; x is the number oftThe feature vector corresponding to the feature data corresponding to the current sampling moment t; h ist-1Historical encoding data corresponding to the historical time series data; wiAnd UiThe input weight matrixes are obtained by pre-training according to training samples; biIs an input offset vector obtained by pre-training according to a training sample; wcAnd UcAll are memory weight matrixes obtained by pre-training according to training samples; bcIs a memory offset vector obtained by pre-training according to a training sample; sigma is Sigmoid growth curve function; tan h is the hyperbolic tangent function.
Specifically, in this embodiment, the input module 420 performs a linear transformation on the feature data and the historical encoded data corresponding to the current sampling time, and then performs Sigmoid activation, so as to determine the data to be added in the feature data and the historical encoded data corresponding to the current sampling timeitI outputted at this timetIs a data between 0 and 1, where "1" means "increase"; "0" means "not increased". The input module 420 further performs a linear transformation on the feature data and the historical encoding data corresponding to the current sampling time, and then performs tanh activation, thereby obtaining a candidate cell memory state data.
Step S305, discarding the data to be discarded from the fused data of the last cell memory state data after dimensionality reduction through the cell memory state module 430, adding data according to the data to be added and the candidate cell memory state data to obtain the current cell memory state data, and outputting the current cell memory state data.
In one embodiment, the cell memory state module 430 may discard the data to be discarded from the updated previous cell memory state data based on the following formula, and perform data addition according to the data to be added and the candidate cell memory state data to obtain the current cell memory state data:
Figure BDA0002282688730000181
wherein, ctThe characteristic vector corresponding to the current cell memory state data corresponding to the current sampling time t; f. oftA data vector corresponding to the data to be discarded; c. Ct-1 *The updated characteristic vector corresponding to the previous cell memory state data; i.e. itA data vector corresponding to the data to be added;
Figure BDA0002282688730000182
corresponding feature vectors of the candidate cell memory state data, ⊙ Hadamard multiplication.
Specifically, in the cell memory state module 430, the data to be discarded is multiplied by the updated previous cell memory state data ft⊙ct-1 *Discarding the data to be discarded, and multiplying the data to be added by the memory state data of the candidate cells
Figure BDA0002282688730000183
Adding the data to be added, and finally adding the two calculation results to obtain the current cell memory state data.
Step S306, inputting the feature data corresponding to the current sampling time into the hidden state module 440.
In the present embodiment, the hidden state module 440 determines data to be output according to the feature data and the historical encoded data corresponding to the current sampling time, and determines current encoded data corresponding to the current time series data according to the data to be output and the current cell memory state data.
The hidden state module 440 includes an output gate sigmoid to selectively perform data screening on the feature data and the historical encoded data corresponding to the current sampling time to determine the data to be output.
In one embodiment, the hidden state module 440 may determine data to be output according to historical encoding data corresponding to historical time-series data and feature data corresponding to the current sampling time, and determine current encoding data corresponding to current time-series data according to the data to be output and the current cell memory state data based on the following formula:
ot=σ(Woxt+Uoht-1+bo)
ht=ot⊙tanh(ct)
wherein h istCurrent coding data corresponding to the current time sequence data; otA data vector corresponding to the data to be output; x is the number oftA feature vector corresponding to feature data corresponding to the current sampling moment t; h ist-1Historical encoding data corresponding to the historical time series data; woAnd UoAll are hidden state weight matrixes obtained by pre-training according to training samples; boIs a hidden state offset vector obtained by pre-training according to a training sample; c. CtThe characteristic vector corresponding to the current cell memory state data corresponding to the current sampling time t, tanh is a hyperbolic tangent function, and ⊙ is Hadamard adataAnd (4) carrying out the multiplication of the codes.
Specifically, in this embodiment, the hidden state module 440 first performs a linear transformation on the feature data and the historical encoded data corresponding to the current sampling time, and then performs Sigmoid activation, so as to determine the data o to be output in the feature data and the historical encoded data corresponding to the current sampling timetO output at this timetIs a data between 0 and 1, where "1" represents "output"; "0" means "not output". Current cell memory state data ctProcessing is carried out by tanh to obtain a value between-1 and 1, and the value is multiplied by the output of the Sigmoid gate, so that only useful data h can be outputt. The characteristic data respectively corresponding to the current sampling time and the previous sampling time are all coded into the current coded data htThe current coded data h at this timetIs the data after a time interval has acted on the characteristic data.
Step S307, determining output data corresponding to the target behavior at the current sampling time according to the current encoded data through the output module 450.
Specifically, the internal structure of the output module 450 may be preset according to the service scenario and the actual situation. In an embodiment, when predicting the loan default probability of the future lending behavior, the output module 450 may perform processing operations such as multiplying the output weight obtained by pre-training according to the training sample by the current encoded data, and output the predicted loan default probability corresponding to the lending behavior, so as to obtain the prediction result corresponding to the target behavior at the current sampling time according to the output data.
According to the technical scheme of the embodiment, the function operation is performed on the time interval input between the current sampling time and the previous sampling time by using the discount function in the preset time interval sensing module 460, and the Hadamard multiplication operation is performed on the operation result and the previous cell memory state data, so that the obtained result is the updated previous cell memory state data, the influence of the time interval on the feature data can be more accurately considered, and the accuracy of the prediction result is further improved.
At the upper partOn the basis of the technical scheme, the matrix WREither positive or negative. Matrix W in the present embodimentR
The parameter is determined by learning from training sample data, and indicates WRWhether this parameter takes a positive or negative value is determined by the data itself, whereby WrThe positive and negative values of (c) may indicate whether the time interval has an effect on a certain statistic in the feature data as a cumulative increasing effect or a cumulative decreasing effect. Matrix W of the present embodimentROutput is performed so as to be according to WrThe positive and negative values of (a) can directly show the influence of the time interval on the cumulative increasing or decreasing of the feature data, so that the user can more clearly and intuitively obtain the influence result of the time interval on the feature data.
In one embodiment, as shown in fig. 7, there is provided a behavior prediction apparatus 200, including:
the existing time series data acquiring module 201 is configured to acquire existing time series data corresponding to a target behavior, where the existing time series data includes feature data acquired at least two sampling moments.
The data input module 202 is configured to input each feature data and a time interval between every two adjacent sampling moments into a preset time recurrent neural network model, where the preset time recurrent neural network model is obtained by pre-training according to a training sample; the preset time recursive neural network model comprises a preset time interval sensing module, wherein the preset time interval sensing module is used for respectively carrying out high-dimensional mapping on the feature data and the time interval, fusing the high-dimensional mapping data of the feature data and the high-dimensional mapping data of the time interval to obtain feature fusion data, and reducing the dimensions of the feature fusion data to obtain dimension reduction data, wherein the dimensions of the dimension reduction data are the same as the dimensions of the feature data.
And the prediction result determining module 203 is configured to determine a prediction result corresponding to the target behavior according to the output of the recurrent neural network model in the preset time.
In one embodiment, the preset time recurrent neural network model comprises at least two preset neurons, and each preset neuron comprises a forgetting module, an input module, a cell memory state module, a hidden state module, an output module and a preset time interval sensing module; wherein,
the forgetting module is used for determining data to be discarded from the feature data corresponding to the current sampling moment and the historical encoding data corresponding to the historical time sequence data, wherein the historical time sequence data comprise feature data corresponding to each historical sampling moment before the current sampling moment; the historical coded data is an output result of a hidden state module in a last preset neuron;
the input module is used for determining data to be added and candidate cell memory state data from the characteristic data and the historical encoding data corresponding to the current sampling moment;
the preset time interval sensing module is specifically configured to: respectively carrying out high-dimensional mapping on the last memory cell state data and the time interval between the current sampling moment and the last sampling moment, fusing the high-dimensional mapping data of the last memory cell state data and the high-dimensional mapping data of the time interval between the current sampling moment and the last sampling moment to obtain fused data of the last memory cell state data, carrying out dimensionality reduction on the fused data of the last memory cell state data to obtain fused data of the last memory cell state data after dimensionality reduction, wherein the dimensionality of the fused data of the last memory cell state data after dimensionality reduction is the same as that of the last memory cell state data;
the cell memory state module is used for discarding the data to be discarded from the fusion data of the last memory cell state data after dimensionality reduction, adding data according to the data to be added and the candidate cell memory state data to obtain the current cell memory state data and outputting the current cell memory state data;
the hidden state module is used for determining data to be output according to the characteristic data and the historical encoding data corresponding to the current sampling moment, and determining current encoding data corresponding to the current time sequence data according to the data to be output and the current cell memory state data; the current time sequence data comprises characteristic data corresponding to the current sampling time and each historical sampling time;
the output module is used for determining output data corresponding to the target behavior at the current sampling moment according to the current encoding data.
In one embodiment, the number of the preset neurons is equal to the number of the feature data; the first input end of a preset time interval sensing module in a current preset neuron is connected with the output end of a cell memory state module in a last preset neuron; the input end of the forgetting module, the input end of the input module and the first input end of the hidden state module in the current preset neuron are all connected with the output end of the hidden state module in the previous preset neuron;
in the current preset neuron, a first input end of a cell memory state module is connected with an output end of a preset time interval sensing module; the second input end of the cell memory state module is connected with the output end of the forgetting module; the third input end of the cell memory state module is connected with the output end of the input module; the output end of the cell memory state module is connected with the second input end of the hidden state module; the output end of the hidden state module is connected with the input end of the output module.
In an embodiment, the data input module 202 is specifically configured to: inputting the time interval between the current sampling moment and the last sampling moment to a second input end of a preset time interval sensing module in a current preset neuron; and inputting the characteristic data corresponding to the current sampling moment into the input end of the forgetting module, the input end of the input module and the second input end of the hidden state module in the current preset neuron.
In one embodiment, the preset time interval sensing module performs high-dimensional mapping on the previous memory cell state data and the time interval between the current sampling time and the previous sampling time respectively based on the following formula, fuses the high-dimensional mapping data of the previous memory cell state data and the high-dimensional mapping data of the time interval between the current sampling time and the previous sampling time to obtain fusion data of the previous memory cell state data, and performs dimensionality reduction on the fusion data of the previous memory cell state data to obtain fusion data of the previous memory cell state data after dimensionality reduction:
Figure BDA0002282688730000231
Figure BDA0002282688730000232
wherein,
Figure BDA0002282688730000233
the feature vector of the fusion data of the last memory cell state data after dimension reduction; tan h is a hyperbolic tangent function; c. Ct-1Is the feature vector corresponding to the previous cell memory state data; w is aHFor training the resulting row vector, wHFor c is used for ct-1Performing a high-dimensional mapping, BH、WR、BRAnd BDA matrix obtained for training; Δ t is the time interval between the current sampling instant t and the last sampling instant t-1; w is aLFor training the resulting row vectors, bLColumn vectors obtained for training ⊙ Hadamard multiplication, WRFor high-dimensional mapping of Δ t to WRAnd BHHaving the same dimension, wLUsed for reducing the dimension of the fusion data.
In one embodiment, W in the preset time interval sensing moduleREither positive or negative.
In one implementation, the forgetting module determines the data to be discarded from the feature data corresponding to the current sampling time and the historical encoding data corresponding to the historical time series data based on the following formula:
ft=σ(Wfxt+Ufht-1+bf)
wherein f istA data vector corresponding to the data to be discarded; x is the number oftA feature vector corresponding to feature data corresponding to the current sampling moment t; h ist-1Historical encoding data corresponding to the historical time series data; wfAnd UfThe forgetting weight matrixes are obtained by pre-training according to training samples; bfIs based on training samplesThe forgetting offset vector obtained by the pre-training is obtained; σ is Sigmoid growth curve function.
In one embodiment, the input module determines data to be added and candidate cell memory state data from historical encoding data corresponding to the feature data and the historical time series data corresponding to the current sampling moment based on the following formula:
it=σ(Wixt+Uiht-1+bi)
Figure BDA0002282688730000241
wherein itA data vector corresponding to the data to be added;
Figure BDA0002282688730000242
the characteristic vector corresponding to the memory state data of the candidate cells; x is the number oftThe feature vector corresponding to the feature data corresponding to the current sampling moment t; h ist-1Historical encoding data corresponding to the historical time series data; wiAnd UiThe input weight matrixes are obtained by pre-training according to training samples; biIs an input offset vector obtained by pre-training according to a training sample; wcAnd UcAll are memory weight matrixes obtained by pre-training according to training samples; bcIs a memory offset vector obtained by pre-training according to a training sample; sigma is Sigmoid growth curve function; tan h is the hyperbolic tangent function.
In one embodiment, the cell memory state module discards data to be discarded from fused data of last memory cell state data after dimensionality reduction based on the following formula, and performs data addition according to data to be added and candidate cell memory state data to obtain current cell memory state data:
Figure BDA0002282688730000243
wherein, ctFor the current cell memory state corresponding to the current sampling time tFeature vectors corresponding to the data; f. oftA data vector corresponding to the data to be discarded; c. Ct-1 *The feature vector corresponding to the fusion data of the last memory cell state data after dimensionality reduction; i.e. itA data vector corresponding to the data to be added;
Figure BDA0002282688730000251
⊙ is Hadamard multiplication.
In one embodiment, the hidden state module determines data to be output according to historical encoding data corresponding to the historical time-series data and feature data corresponding to the current sampling time, and determines current encoding data corresponding to the current time-series data according to the data to be output and the current cell memory state data, based on the following formula:
ot=σ(Woxt+Uoht-1+bo)
ht=ot⊙tanh(ct)
wherein h istCurrent coding data corresponding to the current time sequence data; otA data vector corresponding to the data to be output; x is the number oftA feature vector corresponding to feature data corresponding to the current sampling moment t; h ist-1Historical encoding data corresponding to the historical time series data; woAnd UoAll are hidden state weight matrixes obtained by pre-training according to training samples; boIs a hidden state offset vector obtained by pre-training according to a training sample; c. CtThe cell memory state data corresponding to the current sampling time t is the corresponding characteristic vector, tanh is a hyperbolic tangent function, and ⊙ is Hadamard multiplication.
The behavior prediction device provided by the embodiment of the application can execute the behavior prediction method provided by any embodiment of the application, and has the corresponding functional module and beneficial effect of executing the behavior prediction method.
FIG. 8 is a diagram illustrating an internal structure of a computer device in one embodiment. The computer device may specifically be the terminal 110 (or the server 120) in fig. 1. As shown in fig. 8, the computer apparatus includes a processor, a memory, a network interface, an input device, and a display screen connected via a system bus. Wherein the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program that, when executed by the processor, causes the processor to implement the behavior prediction method. The internal memory may also have stored therein a computer program that, when executed by the processor, causes the processor to perform the behavior prediction method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 8 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, the behavior prediction apparatus provided in the present application may be implemented in the form of a computer program, and the computer program may be run on a computer device as shown in fig. 8. The memory of the computer device may store therein various program modules constituting the behavior prediction apparatus, such as an existing time-series data acquisition module 201, a data input module 202, and a prediction result determination module 203 shown in fig. 7. The respective program modules constitute computer programs that cause the processors to execute the steps in the behavior prediction methods of the embodiments of the present application described in the present specification.
For example, the computer device shown in fig. 8 may execute, by the existing time-series data acquisition module 201 in the behavior prediction apparatus shown in fig. 7, acquiring existing time-series data corresponding to the target behavior, where the existing time-series data includes feature data acquired at least two sampling times. The computer device can input each feature data and the time interval between every two adjacent sampling moments into a preset time recurrent neural network model through the data input module 202, wherein the preset time recurrent neural network model is obtained by pre-training according to training samples; the preset time recursive neural network model comprises a preset time interval sensing module, wherein the preset time interval sensing module is used for respectively carrying out high-dimensional mapping on the feature data and the time interval, fusing the high-dimensional mapping data of the feature data and the high-dimensional mapping data of the time interval to obtain feature fusion data, and reducing the dimensions of the feature fusion data to obtain dimension reduction data, wherein the dimensions of the dimension reduction data are the same as the dimensions of the feature data. The computer device may determine a prediction result corresponding to the target behavior according to the output of the recurrent neural network model at a preset time by the prediction result determination module 203.
In one embodiment, a computer device is provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to perform the steps of the behavior prediction method provided in any of the embodiments of the present application.
Acquiring existing time series data corresponding to a target behavior, wherein the existing time series data comprise characteristic data acquired at least two sampling moments; inputting each feature data and a time interval between every two adjacent sampling moments into a preset time recurrent neural network model, wherein the preset time recurrent neural network model is obtained by pre-training according to a training sample; the preset time recursive neural network model comprises a preset time interval sensing module, the preset time interval sensing module is used for respectively carrying out high-dimensional mapping on the feature data and the time interval, fusing the high-dimensional mapping data of the feature data and the high-dimensional mapping data of the time interval to obtain feature fusion data, and reducing the dimensions of the feature fusion data to obtain dimension reduction data, wherein the dimensions of the dimension reduction data are the same as the dimensions of the feature data;
and determining a prediction result corresponding to the target behavior according to the output of the recurrent neural network model in the preset time.
Of course, those skilled in the art will understand that the processor may also implement the technical solution of the method for determining the reserved inventory provided in any embodiment of the present application.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, is adapted to carry out the steps of the behavior prediction method provided in any of the embodiments of the present application.
This fifth embodiment provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of the behavior prediction method as provided in any of the embodiments of the present application, the method comprising: acquiring existing time series data corresponding to a target behavior, wherein the existing time series data comprise characteristic data acquired at least two sampling moments; inputting each feature data and a time interval between every two adjacent sampling moments into a preset time recurrent neural network model, wherein the preset time recurrent neural network model is obtained by pre-training according to a training sample; the preset time recursive neural network model comprises a preset time interval sensing module, the preset time interval sensing module is used for respectively carrying out high-dimensional mapping on the feature data and the time interval, fusing the high-dimensional mapping data of the feature data and the high-dimensional mapping data of the time interval to obtain feature fusion data, and reducing the dimensions of the feature fusion data to obtain dimension reduction data, wherein the dimensions of the dimension reduction data are the same as the dimensions of the feature data; and determining a prediction result corresponding to the target behavior according to the output of the recurrent neural network model in the preset time.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (12)

1. A method of behavior prediction, comprising:
acquiring existing time series data corresponding to a target behavior, wherein the existing time series data comprise characteristic data acquired at least two sampling moments;
inputting each feature data and a time interval between every two adjacent sampling moments into a preset time recurrent neural network model, wherein the preset time recurrent neural network model is obtained by pre-training according to a training sample; the preset time recursive neural network model comprises a preset time interval sensing module, wherein the preset time interval sensing module is used for respectively carrying out high-dimensional mapping on the feature data and the time interval, fusing the high-dimensional mapping data of the feature data and the high-dimensional mapping data of the time interval to obtain feature fusion data, and reducing the dimension of the feature fusion data to obtain dimension-reduced data, wherein the dimension of the dimension-reduced data is the same as the dimension of the feature data;
and determining a prediction result corresponding to the target behavior according to the output of the preset time recurrent neural network model.
2. The method according to claim 1, wherein the predetermined time recurrent neural network model comprises at least two predetermined neurons, each of which comprises a forgetting module, an input module, a cell memory state module, a hidden state module, an output module, and the predetermined time interval perception module; wherein,
the forgetting module is used for determining data to be discarded from feature data corresponding to the current sampling time and historical encoding data corresponding to historical time series data, wherein the historical time series data comprise feature data corresponding to each historical sampling time before the current sampling time; the historical encoding data is an output result of the hidden state module in the last preset neuron;
the input module is used for determining data to be added and candidate cell memory state data from the characteristic data corresponding to the current sampling moment and the historical encoding data;
the preset time interval sensing module is specifically configured to: respectively performing high-dimensional mapping on the last memory cell state data and the time interval between the current sampling time and the last sampling time, fusing the high-dimensional mapping data of the last memory cell state data and the high-dimensional mapping data of the time interval between the current sampling time and the last sampling time to obtain fused data of the last memory cell state data, performing dimensionality reduction on the fused data of the last memory cell state data to obtain fused data of the last memory cell state data after dimensionality reduction, wherein the fused data of the last memory cell state data after dimensionality reduction is the same as the dimensionality of the last memory cell state data, and the last memory cell state data is output result data of a cell memory state module in a last preset neuron;
the cell memory state module is used for discarding the data to be discarded from the fusion data of the last memory cell state data after dimensionality reduction, adding data according to the data to be added and the candidate cell memory state data to obtain current cell memory state data, and outputting the current cell memory state data;
the hidden state module is used for determining data to be output according to the characteristic data corresponding to the current sampling moment and the historical encoding data, and determining current encoding data corresponding to current time sequence data according to the data to be output and the current cell memory state data; the current time sequence data comprises feature data corresponding to the current sampling time and each historical sampling time;
and the output module is used for determining output data corresponding to the target behavior at the current sampling moment according to the current encoding data.
3. The method of claim 2, wherein the number of said predetermined neurons is equal to the number of said feature data; wherein,
a first input end of the preset time interval perception module in the current preset neuron is connected with an output end of the cell memory state module in the last preset neuron;
the input end of the forgetting module, the input end of the input module and the first input end of the hidden state module in the current preset neuron are all connected with the output end of the hidden state module in the last preset neuron;
wherein, in the current preset neuron,
the first input end of the cell memory state module is connected with the output end of the preset time interval sensing module;
the second input end of the cell memory state module is connected with the output end of the forgetting module;
the third input end of the cell memory state module is connected with the output end of the input module;
the output end of the cell memory state module is connected with the second input end of the hidden state module;
and the output end of the hidden state module is connected with the input end of the output module.
4. The method of claim 3, wherein inputting each of the feature data and the time interval between two adjacent time instants into a predetermined time recurrent neural network model comprises:
inputting the time interval between the current sampling moment and the last memory cell state data to a second input end of the preset time interval sensing module in the current preset neuron;
and inputting the characteristic data corresponding to the current sampling moment into the input end of the forgetting module, the input end of the input module and the second input end of the hidden state module in the current preset neuron.
5. The method according to claim 2, wherein the preset time interval perception module performs high-dimensional mapping on the previous memory cell state data and the time interval between the current sampling time and the previous sampling time, respectively, and fuses the high-dimensional mapping data of the previous memory cell state data and the high-dimensional mapping data of the time interval between the current sampling time and the previous sampling time to obtain the fusion data of the previous memory cell state data, and performs dimensionality reduction on the fusion data of the previous memory cell state data to obtain the fusion data of the previous memory cell state data after dimensionality reduction, based on the following formula:
Figure FDA0002282688720000041
wherein,
Figure FDA0002282688720000042
the feature vector of the fusion data of the last memory cell state data after dimension reduction; tan h is a hyperbolic tangent function; c. Ct-1Is the feature vector corresponding to the previous cell memory state data; w is aHFor training the resulting row vector, wHFor c is used for ct-1Performing a high-dimensional mapping, BH、WR、BRAnd BDA matrix obtained for training; Δ t is the time interval between the current sampling instant t and the last sampling instant t-1; w is aLFor training the resulting row vectors, bLColumn vectors obtained for training ⊙ Hadamard multiplication, WRFor high-dimensional mapping of the Δ t to the WRAnd said BHHaving the same dimension, said wLAnd the method is used for reducing the dimension of the fusion data.
6. The method according to claim 2, wherein the forgetting module determines the data to be discarded from the feature data corresponding to the current sampling time and the historical encoding data corresponding to the historical time series data based on the following formula:
ft=σ(Wfxt+Ufht-1+bf)
wherein f istA data vector corresponding to the data to be discarded; x is the number oftIs the current sampling timeCarving a feature vector corresponding to the feature data corresponding to the t; h ist-1Historical encoding data corresponding to the historical time series data; wfAnd UfThe forgetting weight matrixes are obtained by pre-training according to training samples; bfIs a forgetting offset vector obtained by pre-training according to a training sample; σ is Sigmoid growth curve function.
7. The method according to claim 2, wherein the input module determines the data to be added and the memory state data of the candidate cell from the feature data corresponding to the current sampling time and the historical encoding data corresponding to the historical time series data based on the following formula:
it=σ(Wixt+Uiht-1+bi)
Figure FDA0002282688720000043
wherein itA data vector corresponding to the data to be added;
Figure FDA0002282688720000051
the characteristic vector corresponding to the memory state data of the candidate cells; x is the number oftThe feature vector corresponding to the feature data corresponding to the current sampling moment t; h ist-1Historical encoding data corresponding to the historical time series data; wiAnd UiThe input weight matrixes are obtained by pre-training according to training samples; biIs an input offset vector obtained by pre-training according to a training sample; wcAnd UcAll are memory weight matrixes obtained by pre-training according to training samples; bcIs a memory offset vector obtained by pre-training according to a training sample; sigma is Sigmoid growth curve function; tan h is the hyperbolic tangent function.
8. The method according to claim 2, wherein the cell memory state module discards the data to be discarded from the fused data of the last cell memory state data after dimensionality reduction based on the following formula, and performs data addition according to the data to be added and the candidate cell memory state data to obtain the current cell memory state data:
Figure FDA0002282688720000052
wherein, ctThe characteristic vector corresponding to the current cell memory state data corresponding to the current sampling time t; f. oftA data vector corresponding to the data to be discarded; c. Ct-1 *The feature vector corresponding to the fusion data of the last memory cell state data after dimensionality reduction; i.e. itA data vector corresponding to the data to be added is obtained;
Figure FDA0002282688720000053
corresponding feature vectors of the candidate cell memory state data, ⊙ Hadamard multiplication.
9. The method of claim 2, wherein the hidden state module determines data to be output according to historical encoding data corresponding to historical time-series data and feature data corresponding to current sampling time, and determines current encoding data corresponding to current time-series data according to the data to be output and the current cell memory state data based on the following formula:
ot=σ(Woxt+Uoht-1+bo)
ht=ot⊙tanh(ct)
wherein h istCurrent coding data corresponding to the current time sequence data; otA data vector corresponding to the data to be output; x is the number oftA feature vector corresponding to feature data corresponding to the current sampling moment t; h ist-1Historical encoding data corresponding to the historical time series data; woAnd UoAll are hidden state weight matrixes obtained by pre-training according to training samples; boIs a hidden state offset vector obtained by pre-training according to a training sample; c. CtThe cell memory state data corresponding to the current sampling time t is the corresponding characteristic vector, tanh is a hyperbolic tangent function, and ⊙ is Hadamard multiplication.
10. A behavior prediction apparatus, comprising:
the existing time sequence data acquisition module is used for acquiring existing time sequence data corresponding to a target behavior, wherein the existing time sequence data comprises characteristic data acquired at least two sampling moments;
the data input module is used for inputting each characteristic data and the time interval between every two adjacent sampling moments into a preset time recurrent neural network model, wherein the preset time recurrent neural network model is obtained by pre-training according to a training sample; the preset time recursive neural network model comprises a preset time interval sensing module, wherein the preset time interval sensing module is used for respectively carrying out high-dimensional mapping on the feature data and the time interval, fusing the high-dimensional mapping data of the feature data and the high-dimensional mapping data of the time interval to obtain feature fusion data, and reducing the dimension of the feature fusion data to obtain dimension-reduced data, wherein the dimension of the dimension-reduced data is the same as the dimension of the feature data;
and the prediction result determining module is used for determining a prediction result corresponding to the target behavior according to the output of the preset time recurrent neural network model.
11. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 9 are implemented when the computer program is executed by the processor.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 9.
CN201911147778.4A 2019-11-21 2019-11-21 Behavior prediction method, behavior prediction device, computer equipment and storage medium Pending CN111160600A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911147778.4A CN111160600A (en) 2019-11-21 2019-11-21 Behavior prediction method, behavior prediction device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911147778.4A CN111160600A (en) 2019-11-21 2019-11-21 Behavior prediction method, behavior prediction device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111160600A true CN111160600A (en) 2020-05-15

Family

ID=70556038

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911147778.4A Pending CN111160600A (en) 2019-11-21 2019-11-21 Behavior prediction method, behavior prediction device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111160600A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111709754A (en) * 2020-06-12 2020-09-25 中国建设银行股份有限公司 User behavior feature extraction method, device, equipment and system
CN112381595A (en) * 2021-01-11 2021-02-19 平安科技(深圳)有限公司 User value prediction method based on communication behavior and related equipment
CN113703886A (en) * 2021-07-21 2021-11-26 青岛海尔科技有限公司 User system behavior monitoring method, system, electronic equipment and storage medium
CN114880575A (en) * 2022-05-27 2022-08-09 清华大学深圳国际研究生院 User behavior prediction method, device, equipment, medium and product
CN114880575B (en) * 2022-05-27 2024-09-24 清华大学深圳国际研究生院 User behavior prediction method, device, equipment, medium and product

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111709754A (en) * 2020-06-12 2020-09-25 中国建设银行股份有限公司 User behavior feature extraction method, device, equipment and system
CN111709754B (en) * 2020-06-12 2023-08-25 中国建设银行股份有限公司 User behavior feature extraction method, device, equipment and system
CN112381595A (en) * 2021-01-11 2021-02-19 平安科技(深圳)有限公司 User value prediction method based on communication behavior and related equipment
CN112381595B (en) * 2021-01-11 2021-06-04 平安科技(深圳)有限公司 User value prediction method based on communication behavior and related equipment
CN113703886A (en) * 2021-07-21 2021-11-26 青岛海尔科技有限公司 User system behavior monitoring method, system, electronic equipment and storage medium
CN113703886B (en) * 2021-07-21 2023-06-20 青岛海尔科技有限公司 User system behavior monitoring method, system, electronic equipment and storage medium
CN114880575A (en) * 2022-05-27 2022-08-09 清华大学深圳国际研究生院 User behavior prediction method, device, equipment, medium and product
CN114880575B (en) * 2022-05-27 2024-09-24 清华大学深圳国际研究生院 User behavior prediction method, device, equipment, medium and product

Similar Documents

Publication Publication Date Title
CN109657917B (en) Risk early warning method and device for evaluation object, computer equipment and storage medium
Soleymani et al. Deep graph convolutional reinforcement learning for financial portfolio management–DeepPocket
CN110264270B (en) Behavior prediction method, behavior prediction device, behavior prediction equipment and storage medium
CN111160600A (en) Behavior prediction method, behavior prediction device, computer equipment and storage medium
CN112598111B (en) Abnormal data identification method and device
CN112598248A (en) Load prediction method, load prediction device, computer equipment and storage medium
WO2019214455A1 (en) Data sequence prediction method and computing apparatus
CN114065653A (en) Construction method of power load prediction model and power load prediction method
CN105279692A (en) Financial information technology system performance prediction method and apparatus
CN114445143A (en) Service data prediction method, device, equipment and medium
Dong et al. Research on the time-varying network structure evolution of the stock indices of the BRICS countries based on fluctuation correlation
Yeze et al. Stock price prediction based on information entropy and artificial neural network
CN116885699A (en) Power load prediction method based on dual-attention mechanism
Chen et al. Modeling repayment behavior of consumer loan in portfolio across business cycle: a triplet Markov model approach
Christoforou et al. Neural networks for cryptocurrency evaluation and price fluctuation forecasting
Liao et al. MFGCN: a multimodal fusion graph convolutional network for online car-hailing demand prediction
Wang et al. Time-series forecasting of mortality rates using transformer
CN114330837A (en) Object processing method and device, computer equipment and storage medium
CN111507461B (en) Interpretability information determining method and device
Zhang et al. Improving Stock Price Forecasting Using a Large Volume of News Headline Text.
CN117372070A (en) Method, device, computer equipment and storage medium for determining property market trend
Liu et al. A Novel Methodology for Credit Spread Prediction: Depth‐Gated Recurrent Neural Network with Self‐Attention Mechanism
CN115952928A (en) Short-term power load prediction method, device, equipment and storage medium
CN115549082A (en) Power load prediction method based on load mining and LSTM neural network
De Souza et al. Fast learning and predicting of stock returns with virtual generalized random access memory weightless neural networks

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Applicant after: Jingdong Digital Technology Holding Co.,Ltd.

Address before: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Applicant before: JINGDONG DIGITAL TECHNOLOGY HOLDINGS Co.,Ltd.

Address after: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Applicant after: Jingdong Technology Holding Co.,Ltd.

Address before: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Applicant before: Jingdong Digital Technology Holding Co.,Ltd.

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination