A Consumer Behavior Prediction Model Based on Multivariate Real-Time Sequence Analysis

With the rapid development of online finance and social networks, a large amount of behavioral data is stored on the Internet, which can fully reflect the shopping tendencies and habits of real users. Using big data to analyze consumer behavior is more scientific and accurate than the traditional sampling survey method. Internet consumption behavior data are time series data. )erefore, this paper proposes a method of analyzing behavioral sequence data, which learns personal consumption interests and habits, and finally predicts payment behavior. )e experiments compare the execution effect of different algorithms on multiple databases and verify the feasibility and effectiveness of the proposed algorithm SeqLearn.


Introduction
Internet e-commerce platforms contain a wealth of information about events, relationships, and attitudes. A series of technologies such as text mining, statistical theory, association analysis, and visualization are used to realize sentiment analysis, information extraction, and user influence analysis. Learning consumer behavior can help analyze the characteristics of consumers, the relationship between products, and so on. erefore, it is a very valuable research topic to construct consumption structures according to the consumption behavior records of different consumers. e algorithm SeqLearn proposed in this paper extracts consumers' consumption interests and habits by analyzing the behavior data of e-commerce platforms and calculates the comprehensive probability to predict the next payment behavior. Forecast results can be used for product recommendations, advertising placement, and other applications.
Online shopping is a process in which users browse and search for related products to complete shopping or other related tasks in a virtual shopping environment. Payment decision is the integration and unity of consumer demand, motivation, activity, and afterthought. By analyzing the network data, the potential connections behind a series of consumer behaviors can be mined out and the prediction function can be realized. e application of this method was quick and effective to identify and segment consumer groups and facilitated the mapping of the differences among these groups and the comparison of the consumption behavior expressed by consumers on different markets [1]. In the field of social network analysis, users are defined as nodes. Relationships between nodes can be abstractly represented by edges. Common techniques used to analyze relationships between nodes include causal inference [2][3][4] and Bayesian network [5,6]. Different strategies are used for different purposes and needs, such as emotion-oriented analysis, information extraction, and user influence analysis. For example, Bollen analyzed the sentiment in tweets and found that the creation and dissemination of online information are closely related to stock market, future commodity prices, and major social events [7]; Asur of HP LABS successfully predicted the box office using Twitter data [8]. Based on the big data of social networks, González-Bailón [9] studied the dynamics of the protest movements and revealed its influences on political trends.
e Internet has become a new media, which makes users have a great sense of participation. e convenient and efficient mode of communication is a driving force for Internet business to analyze and mine network data. A recommendation model based on statistical modelling is used to assist consumers facing choice overload by predicting their interests and consumption behaviors [22]. However, due to the complexity of network data, it is a huge challenge for any enterprise or operator to mine valuable information with commercial value efficiently and quickly. e development of the Internet has brought about tremendous changes in consumption concepts, consumption patterns, and consumer conditions.
In this paper, a large number of real network data are collected to support the analysis of consumer behavior. We study personal consumption interests and consumption habits and finally predict the next payment behaviors. Forecast results can be used for product recommendations, advertising placement, and other applications. In the experimental part, online consumer behavior data, such as Ali Data (an online shopping website in China), are used to compare the execution effects of different algorithms on different databases and verify the feasibility and effectiveness of SeqLearn. e remainder of this paper is organized as follows. Section 2 proposes the predictive model of consumer behavior. Section 3 introduces the experimental results. Section 4 states the conclusions of research achievements.

Consumer Behavior Prediction Model
Online consumption data can reflect the actual consumption trends and consumption changes of users.
is paper proposes a sequence analysis algorithm to study personal consumption preferences and consumption habits. Personal consumption preferences can be used to predict what consumers will buy over a period of time. Consumption habits reflect a time cycle, that is, how long it takes for consumers to pay attention to a certain commodity before they buy it. e behaviors of Internet users can be divided into four categories: click, collect, add-to-cart, and payment. Among these four behaviors, payment data are considered outdated data, which only reflects the user's past shopping preferences and is used as validation data to verify the accuracy of the algorithm. Add-to-cart and collect behaviors are regarded as equal.
ey have the same effect on predicting shopping behavior. e amount of browsing behavior data is huge, and its correlation with user interests is weak. Experiments show that the accuracy of our prediction algorithm will not be significantly improved by analyzing the browsing behavior data. erefore, this paper does not consider browsing behavior data and obtains accurate analysis results with as little computational effort as possible. In summary, this paper only considers purchase behavior, add-to-cart behavior, and collect behavior. In order to verify the feasibility of the algorithm, we analyze a large amount of user data. It is found that these three behaviors are strongly correlated and often appear in a logical order. is proves that using only these three behavioral data to predict consumption trends is feasible.
In order to analyze the continuously updated behavioral data sequence and prevent the impact of stale data on analysis accuracy, the length of the dynamic sequence to be analyzed is selected as n. We transform the training sequence into a fixed-length sequence s � (s 1 , s 2 ,. . ., s n ), where n represents the maximum length. If the sequence length is greater than n, then the nearest n actions are considered. If the sequence length is less than n, we will repeatedly add a "padding" item to the left until the length is n.
e most important task of sequential analysis is to learn each user's personal consumption preferences and consumption habits based on historical data. e prediction formula is shown as follows: represents the predicted next item and a ⌢ represents the predicted user action.
S u a represents the historical access record of user u. S u i represents the historical action sequence of user u. e following sections introduce the formulas for learning personal consumption interests and habits.

Personal Consumption Preference
Analysis. In a long time, the consumer's consumption trend is constantly changing, but in a short time, the consumption trend is stable. By analyzing user behavior over a period of time, we can find out consumers' consumption interests, which reflect the users' recent consumption trends. e following formula illustrates the process of quantifying user interests to predict user behaviors. P( i ⌢ | S u i ) in formula (1) reflects the consumption interest of a consumer over a period of time.
e probability function formula is as follows: where S u i represents the sequence of access items for user i. If the length of the sequence is less than n, it is automatically filled. e number of occurrences of each item in the sequence is denoted by x. x corresponds to the Poisson distribution. x is related to the number of times users use online media and the amount of information generated [23], so x～ Poisson (λ), where λ � ev × c, in which ev represents the number of times a user uses network media in time t and c represents the total amount of data generated in a certain 2 Mathematical Problems in Engineering consumer interest area within time t. From this, the following probability density formula can be derived: (2) represents the probability that i ⌢ and S u i appear at the same time. e specific formula is shown as follows: where n represents the sequence length and m represents the number of elements that appear in both S u i and the sequence being studied. Substituting formula (3) and formula (4) into formula (2), the following formula is obtained:

Consumption Habit Analysis.
e consumption habits of consumers are different, which can be roughly divided into impulse type and conservative type. Impulse consumers refer to consumers who purchase goods intuitively and impulsively under the influence of urgent purchase psychology. Conservative consumers have strict attitudes towards consumption. ey are sensitive and wait-and-see attitudes towards products and are sensitive to prices. By comparing these two types of consumers, impulsive consumers will be influenced by the first suitable product and make quick purchase decisions instead of repeated selection and comparison. However, conservative consumers have long consumption cycles and need to compare many products before buying. e consumption habits of any consumer are different. By studying historical data, the consumption habits of different consumers can be derived. e probability formula for predicting the next action of consumers is shown as follows: Formula (7) calculates the frequency of purchase behavior, where n is the length of the sequence being studied and t is the number of purchases. P(S u a ) satisfies binomial distribution B (n, p), and let y be the number of times the purchase behavior A occurs in n user actions, so y is a random variable. y is equal to 0, 1, 2, ..., n. Set P(A) � p, P(A) � 1 − p. So the distribution law of P(S u a ) is shown as follows: where k is the number of times the purchase behavior occurs in sequence S u a . en, formula (7) and formula (8) are substituted into formula (6), and the following formula can be obtained: Finally, by substituting formula (5) and formula (9) into formula (1), the following formula can be obtained:

Experiment
e parameters used in the experiment are shown in Table 1.
Datasets used in the experiment are as follows: (1) Ali data (https://tianchi.aliyun.com/dataset/ dataDetail?dataId � 46): this dataset is provided by Alibaba Group. It possesses a wealth of user data, such as user location information and access time.
is dataset contains the following attributes: user ID, item IDs, types of behaviors (including click, collect, add-to-cart, and payment; the corresponding values are 1, 2, 3, and 4, respectively), locations, the category ID, and time.
(2) EP data: it contains 15,890,209 pieces of data collected from http://www.dianping.com/ in August 2018. e dataset contains the following attributes: shop_id (unique), province, city, city_id, area, big_cate, big_cate_id, small_cate, small_cate_id, service_rating, all_remarks, very_good_remarks, good_remarks, common_remarks, bad_remarks, and very_bad_remarks. e algorithms used in the experiment are as follows: (1) Statistical learning: statistical learning techniques are the tools we use to understand data, which are divided into supervised learning and unsupervised learning. Broadly speaking, statistical learning builds statistical models based on one or more inputs to predict or estimate outputs. (2) EC-Structure [23]: this algorithm grabs consumption data of the e-commerce platform, analyzes consumption structures, and predicts consumption behaviors according to consumption structures. e algorithm integrates multiple dimensions of network data to comprehensively study consumer behavior.
In order to show the relationship between user behavior and payment behavior, describes the behavior data of an Ali Mathematical Problems in Engineering user for one month. It visually shows the sequential relationship between different user behaviors.
In Figure 1, the abscissa indicates the order of appearance of the behavior data, and the ordinate indicates the consumption category number. e dots in Figure 1 represent the behaviors of collect, add-to-car, and payment. e triangles represent the predicted payment behaviors based on historical data. It can be seen from Figure 1 that there is a certain logical connection between users' online behavior and payment behavior, and it is verified that the method of integrating consumer interests and consumption habits can accurately predict the next payment behavior. Table 2 illustrates the accuracy of the consumer behavior prediction algorithm SeqLearn (Top@N: among the results calculated by the algorithm, the first N are selected for precision analysis). e horizontal quantity represents the actual value, and the vertical quantity represents the predicted value. In order to measure the accuracy of the algorithm, the following indicators are selected for measurement: precision P � tp/(tp + fp); recall R � tp/ (tp + fn); FB parameters FB � P × R × 2/(P + R), where tp is the number of behaviors that are correctly predicted, tn is the number of the correctly predicted behaviors that will not occur, fn is the number of incorrectly predicted behaviors that will not occur, and fp is the number of incorrectly predicted consumption behaviors that will not occur. In addition, parameter ACC � tp/(tp + tn + fn + fp) is used to measure the prediction accuracy of the algorithms. Table 3 displays the performance comparison of statistical learning, EC-Structure, and SeqLearn using different datasets. According to Table 3, we can conclude that Seq-Learn has the most stable execution effect and the best results according to FB and ACC.

Conclusion
If a questionnaire survey is used for research, problems such as low sample coverage, long data survey cycle, and lagging survey results will arise. In this paper, a large number of real network data is collected to support the analysis of consumer behavior. e results of this method are accurate. Internet consumption behavior data are time series data. erefore, this paper adopts the method of time series analysis to study personal consumption interests and consumption habits and finally predicts next payment behaviors. e prediction results can be used in areas such as product recommendation and advertising push. e experiment shows the process of predicting consumer behavior and verifies the feasibility and efficiency of the SeqLearn algorithm on multiple datasets. In the future research, we hope to study the characteristics of long-term consumption and short-term consumption, so that we can accurately calculate the parameters of different types of goods in the recommendation method.

Data Availability
e data used to support the findings of this study are included within the article.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.