Shopping behavior prediction method, device, equipment and storage medium
By acquiring user and product features and combining hidden Markov models and neural networks, the problem of low accuracy in shopping behavior prediction in existing technologies has been solved, achieving more accurate shopping behavior prediction and improving the accuracy of user behavior prediction and the effectiveness of product recommendation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TSINGHUA UNIVERSITY
- Filing Date
- 2022-07-27
- Publication Date
- 2026-06-02
AI Technical Summary
In existing technologies, the logic for predicting online shopping behavior is simple and ignores the characteristics of products and users, resulting in low accuracy of prediction results.
By acquiring historical shopping data of users to be predicted, user features, product features, and comprehensive features are extracted. Hidden Markov models and neural networks are then used to determine the feature matrix parameters to predict user shopping behavior.
It improves the accuracy of shopping behavior prediction, enabling better prediction of future user actions and enhancing the effectiveness of product recommendations and inventory management.
Smart Images

Figure CN115204985B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for predicting shopping behavior. Background Technology
[0002] Currently, online shopping has greatly facilitated people's lives. Users complete their purchases through online shopping platforms by browsing, saving, adding to cart, and placing orders. Researching these various shopping behaviors helps predict subsequent user behavior patterns, which in turn enables processes such as inventory management and online product recommendations. Existing technologies for predicting shopping behavior primarily focus on the demand for goods in the supply chain. Specifically, they perform simple analysis and mining of the time series of shopping behaviors; for example, they predict the future purchase quantity of a particular product by analyzing historical changes in the quantity purchased within a unit of time. However, this approach is computationally simplistic and ignores the influence of product characteristics and user traits on purchasing behavior, thus reducing the accuracy of the prediction results. Summary of the Invention
[0003] This invention provides a shopping behavior prediction method, apparatus, device, and storage medium to address the shortcomings of existing shopping behavior prediction processes that are simple in logic and have low accuracy in prediction results, thereby achieving more accurate shopping behavior prediction.
[0004] This invention provides a shopping behavior prediction method, comprising: acquiring historical shopping data of a user to be predicted within a preset time period, wherein the historical shopping data includes the user's operational behavior of purchasing any one item; based on the historical shopping data, acquiring user features, item features, and comprehensive features, wherein the user features are characteristics representing the user's purchase of each of the items, the item features are characteristics representing that each item is purchased by the user, and the comprehensive features are characteristics representing the user's purchase of a target item; determining feature matrix parameters of a hidden Markov model based on the user features, the item features, and the comprehensive features, wherein the hidden Markov model is pre-set based on the operational behavior and a preset hidden state; inputting the initial hidden state probability and the user's initial operational behavior into the hidden Markov model to obtain the predicted probability of at least one of the operational behaviors output by the hidden Markov model.
[0005] According to a shopping behavior prediction method provided by the present invention, the feature matrix parameters include state behavior matrix parameters and state transition matrix parameters. The step of determining the feature matrix parameters of a hidden Markov model based on the user features, the product features, and the comprehensive features includes: inputting the user features and the comprehensive features into a preset first neural network model to obtain the state behavior matrix parameters output by the first neural network model, wherein the state behavior matrix parameters are used to associate the user features with the probability calculation process of the hidden Markov model; inputting the product features and the comprehensive features into a preset second neural network model to obtain the state transition matrix parameters output by the second neural network model, wherein the state transition matrix parameters are used to associate the product features with the probability calculation process of the hidden Markov model.
[0006] According to a shopping behavior prediction method provided by the present invention, the operational behavior includes a behavior mode and a behavior time; the step of obtaining user characteristics, product characteristics, and comprehensive characteristics based on the historical shopping data includes: obtaining a time-series behavior sequence corresponding to each of the products purchased by the user to be predicted, based on the behavior time, wherein the time-series behavior sequence is obtained by arranging the behavior mode in chronological order; obtaining a product category sequence corresponding to each of the products based on the historical shopping data, wherein the product category sequence includes the product category corresponding to the product; and obtaining the user characteristics, the product characteristics, and the comprehensive characteristics based on the time-series behavior sequence and the product category sequence.
[0007] According to a shopping behavior prediction method provided by the present invention, the step of obtaining user features, product features, and comprehensive features based on the time-series behavior sequence and the product category sequence includes: obtaining at least one user feature value based on the time-series behavior sequence and the product category sequence, wherein the user feature value is a statistical value of the behavior pattern of the user to be predicted when purchasing each of the products, or a statistical value of the behavior pattern of the user to be predicted when purchasing products corresponding to each of the product categories; obtaining the user features based on the user feature value; obtaining at least one product feature value based on the time-series behavior sequence, wherein the product feature value is a statistical value of the behavior pattern of each product purchased by the user to be predicted; obtaining the product features based on the product feature value; obtaining at least one comprehensive feature value based on the time-series behavior sequence, wherein the comprehensive feature value is a statistical value of the behavior pattern of the user to be predicted when purchasing the target product; and obtaining the comprehensive feature based on the comprehensive feature value.
[0008] According to a shopping behavior prediction method provided by the present invention, the step of obtaining at least one user feature value based on the time-series behavior sequence and the product category sequence includes: defining the behavior patterns in combination to determine purchasing behavior and desired purchasing behavior, wherein the purchasing behavior corresponds to at least one of the behavior patterns, and the desired purchasing behavior corresponds to at least one of the behavior patterns; updating the purchasing behavior and the desired purchasing behavior to the time-series behavior sequence; obtaining at least one user feature value based on the product category sequence and the updated time-series behavior sequence; the step of obtaining at least one product feature value based on the time-series behavior sequence includes: obtaining at least one product feature value based on the updated time-series behavior sequence; the step of obtaining at least one comprehensive feature value based on the time-series behavior sequence includes: obtaining at least one comprehensive feature value based on the updated time-series behavior sequence.
[0009] According to a shopping behavior prediction method provided by the present invention, the step of obtaining the user features based on the user feature values includes: weighting the user feature values according to preset weights corresponding to each of the behavior modes; obtaining the user features based on the user feature values before and after weighting; the step of obtaining the product features based on the product feature values includes: weighting the product feature values according to preset weights corresponding to each of the behavior modes; obtaining the product features based on the product feature values before and after weighting; the step of obtaining the comprehensive features based on the comprehensive feature values includes: weighting the comprehensive feature values according to preset weights corresponding to each of the behavior modes; obtaining the comprehensive features based on the comprehensive feature values before and after weighting.
[0010] According to a shopping behavior prediction method provided by the present invention, the step of obtaining the user features based on the user feature values includes: standardizing each user feature value using the maximum and minimum user feature values corresponding to the user feature values; and obtaining the user features based on the standardized user feature values. The step of obtaining the product features based on the product feature values includes: standardizing each product feature value using the maximum and minimum product feature values corresponding to the product feature values; and obtaining the product features based on the standardized product feature values. The step of obtaining the comprehensive features based on the comprehensive feature values includes: standardizing each comprehensive feature value using the maximum and minimum comprehensive feature values corresponding to the comprehensive feature values; and obtaining the comprehensive features based on the standardized comprehensive feature values.
[0011] According to a shopping behavior prediction method provided by the present invention, the step of obtaining a product category sequence corresponding to each product based on the historical shopping data includes: determining each product purchased by the user to be predicted based on the historical shopping data; for each product: determining whether there is a product category corresponding to the product; if so, performing one-hot encoding on the product category to obtain a category identifier corresponding to the product category; if not, taking the product as a new product category, performing one-hot encoding on the new product category to obtain a category identifier corresponding to the product category; and obtaining a product category sequence corresponding to each product based on the category identifier.
[0012] According to a shopping behavior prediction method provided by the present invention, a first neural network model and a second neural network model are trained using sample data; wherein, the sample data includes sample shopping data of at least one sample user within a sample time period, and the sample shopping data includes the operational behavior of each sample user purchasing any sample product; the training process is as follows: based on the sample shopping data, sample user features, sample product features, and sample comprehensive features are obtained, wherein the sample user features are characteristics representing the sample user's purchase of each of the sample products, the sample product features are characteristics representing that each of the sample products is purchased by the sample user, and the sample comprehensive features are characteristics representing the sample user's purchase of a sample target product; the sample user features and the sample comprehensive features are input into a preset first original neural network model to obtain the first original neural network model. The sample state behavior matrix parameters are output by the network model; the sample product features and the sample comprehensive features are input into a preset second original neural network model to obtain the sample state transition matrix parameters output by the second original neural network model, wherein the sample state behavior matrix parameters and the sample state transition matrix parameters are the sample feature matrix parameters of the hidden Markov model; the sample prediction probability of at least one of the operation behaviors output by the hidden Markov model is obtained; based on the sample prediction probability, a training loss function is obtained; according to the training loss function, the internal parameters of the first original neural network model and the second original neural network model are adjusted respectively; the steps of obtaining sample user features, sample product features and sample comprehensive features based on the sample shopping data are repeated until the training loss function reaches its minimum value, thereby obtaining the first neural network model and the second neural network model.
[0013] The present invention also provides a shopping behavior prediction device, comprising: a data acquisition module, configured to acquire historical shopping data of a user to be predicted within a preset time period, wherein the historical shopping data includes the user's operational behavior of purchasing any one item; a feature acquisition module, configured to acquire user features, item features, and comprehensive features based on the historical shopping data, wherein the user features are features characterizing the user's purchase of each of the items, the item features are features characterizing each item purchased by the user, and the comprehensive features are features characterizing the user's purchase of a target item; a parameter acquisition module, configured to determine the feature matrix parameters of a hidden Markov model based on the user features, the item features, and the comprehensive features, wherein the hidden Markov model is pre-set based on the operational behavior and a preset hidden state; and a probability calculation module, configured to input the initial hidden state probability and the user's initial operational behavior into the hidden Markov model to obtain the predicted probability of at least one of the operational behaviors output by the hidden Markov model.
[0014] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the shopping behavior prediction method as described above.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the shopping behavior prediction method as described above.
[0016] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the shopping behavior prediction method as described above.
[0017] The shopping behavior prediction method, apparatus, device, and storage medium provided by this invention obtain user characteristics, product characteristics, and comprehensive characteristics from the historical shopping data of the user to be predicted within a preset time period. Based on the user characteristics, product characteristics, and comprehensive characteristics, the feature matrix parameters of the Hidden Markov Model (HMM) are determined. Finally, the HMM is used to derive the predicted probability of at least one operational behavior. In other words, associating user characteristics, product characteristics, and comprehensive characteristics with the HMM is equivalent to associating user characteristics, product characteristics, and comprehensive characteristics with the calculation process of prediction probability, adding multiple characteristic factors affecting shopping behavior to the prediction process, thereby improving the accuracy of shopping behavior prediction. Furthermore, since user purchasing behavior has sequential, interactive, and memoryless characteristics, using the HMM can better process this behavior, making the predicted probability of the behavior closer to the user's actual future actions, further improving the accuracy of shopping behavior prediction. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating the shopping behavior prediction method provided by the present invention;
[0020] Figure 2 This is a schematic diagram illustrating the working principle of the Hidden Markov Model embedded in a neural network provided by the present invention.
[0021] Figure 3 This is a training and testing diagram of the shopping behavior prediction provided by the present invention;
[0022] Figure 4 This is a schematic diagram of the shopping behavior prediction device provided by the present invention;
[0023] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0025] Currently, in the field of cognitive decision-making behavior research, the discovery of latent states is a crucial process for revealing the intrinsic mechanisms of behavior. In deep learning or problem-solving scenarios, latent state discovery can be used to verify cognitive disequilibrium theories. For example, while observable states include "boredom," "immersion," "confusion," "fatigue," "happiness," and "surprise," latent states can be modeled as "equilibrium," "disequilibrium," "distress," and "distraction." When facing the problem of latent state discovery, if sequential, multi-interaction behaviors exhibit a certain degree of memorylessness, they can be modeled as Hidden Markov Models (HMMs); for behavioral sequences with memory, recurrent neural networks (RNNs) and long short-term memory (LSTM) networks can be used for modeling.
[0026] In some selective scenarios, different choices lead to different outcomes. This continuous decision-making-feedback process can be modeled as a Hidden Markov Model (HMM) using EEG data, thereby revealing the biological mechanisms underlying this continuous decision-making-feedback process. Similarly, when human behavior can be represented by a behavior tree, it can also be modeled as a HMM. An HMM is a temporal probabilistic model that describes the process of generating an unobservable random sequence of states from a hidden Markov chain, and then generating an observable random sequence from those states.
[0027] In online shopping scenarios, user behaviors on shopping websites regarding a particular product include browsing, saving, adding to cart, and placing an order. These actions may be completed continuously or at intervals. Through simple data analysis, we found that user behavior sequences include tens of thousands of different forms and lengths. By reducing the dimensionality of user behavior and representing it as three different psychological states (i.e., latent states) of "interest," "intent to purchase," and "no longer interested," we can model it as a Hidden Markov Model.
[0028] In existing technologies, research on online shopping behavior in the e-commerce field mostly involves time series mining and analysis of big data, focusing on the demand for goods in the overall supply chain, and rarely starting from the behavioral characteristics of users, taking the time behavior sequence of individual users as the target, and predicting the distribution of users' subsequent behaviors and the probability of whether to make a purchase based on the user's current behavior.
[0029] This invention enables online shopping behavior sequence prediction based on hidden state mining. Targeting users' historical shopping data (consumption data), it analyzes past consumption behavior, extracts user consumption motivations, identifies user consumption characteristics, and understands users' conscious motivations in decision-making behaviors such as browsing and purchasing products. Furthermore, it combines neural networks to mine various user behavioral features (i.e., user characteristics) and product features, using these as inputs to the neural network model and outputting the feature matrix parameters of a Hidden Markov Model. This invention can be used to predict the behavior sequences of users with different behavioral characteristics, perform demand forecasting, and has a certain degree of interpretability. In sales processes such as product promotion and advertising, it allows for targeted marketing and promotion to specific user groups, increasing purchase rates.
[0030] The shopping behavior prediction method provided by this invention is achieved through data processing using a pre-set software algorithm. This software algorithm can be implemented in any device with data processing capabilities, such as a server, laptop, or smart mobile device. The following describes the method in conjunction with... Figures 1-3 The shopping behavior prediction method of the present invention is described.
[0031] In one embodiment, such as Figure 1 As shown, the shopping behavior prediction method follows these steps:
[0032] Step 101: Obtain the historical shopping data of the user to be predicted within a preset time period, wherein the historical shopping data includes the user's purchase behavior of any item.
[0033] In this embodiment, the user to be predicted refers to the user whose shopping behavior needs to be predicted. When predicting the shopping behavior of the user to be predicted, historical shopping data within a preset time period of the user's history is used to determine the feature matrix parameters of the Hidden Markov Model. Preferably, the preset time period can be a period of time from the current time, for example, historical shopping data within 24 hours from the current time. This allows for better acquisition of recent feature information of the user to be predicted.
[0034] Step 102: Based on historical shopping data, obtain user features, product features, and comprehensive features. User features are characteristics that represent the user's purchase of each product, product features are characteristics that represent the purchase of each product by the user, and comprehensive features are characteristics that represent the user's purchase of the target product.
[0035] In this embodiment, historical shopping data is preprocessed to extract user features, product features, and comprehensive features. User features are extracted from the user's perspective, representing the characteristics of the user's purchases of various products, such as the statistical value of the number of times the user browses various products. Product features are extracted from the product's perspective, representing the characteristics of a specific product being purchased by the user, such as the statistical value of the number of times product A is accessed by the user. Comprehensive features are extracted from a one-to-one user and product perspective, representing the characteristics of the user's purchase of a target product. The target product refers to any product that the user has purchased, such as the proportion of the user's browsing behavior for product A out of all the user's actions.
[0036] In one embodiment, the historical shopping data of the user to be predicted includes the user's historical purchase behavior for any item, including the behavior mode and the behavior time. The specific implementation process for obtaining user characteristics, item characteristics, and comprehensive characteristics based on historical shopping data is as follows: Based on the behavior time, obtain the time-series behavior sequence corresponding to each item purchased by the user to be predicted, wherein the time-series behavior sequence is obtained by arranging the behavior mode in chronological order; based on the historical shopping data, obtain the item category sequence corresponding to each item, wherein the item category sequence includes the item category corresponding to the item; based on the time-series behavior sequence and the item category sequence, obtain the user characteristics, item characteristics, and comprehensive characteristics.
[0037] In this embodiment, user behavior refers to visible behaviors, such as "browsing," "favoriting," "adding to cart," or "placing an order." By analyzing the timing of these behaviors, we can statistically analyze them to obtain a temporal sequence of user actions for each product.
[0038] Specifically, given the historical shopping data of the user to be predicted within a preset time period, this historical shopping data includes the user's operational behavior (including behavior mode and behavior time) on a certain online shopping website. Since the user's behavior towards products is random in the time dimension—for example, the user might browse product A multiple times within a minute, or browse product A again after half a month—to avoid data redundancy, multiple identical behavior modes within a first preset time period (e.g., one minute) are recorded as one. Furthermore, to avoid excessive data dispersion, an "interval operation" is added between behavior modes with time intervals exceeding a second preset time period (e.g., 24 hours). Again, when a user shops online, they might place an order for a product, completing a shopping action. When an "order placement" action occurs, a time-series behavior sequence is statistically analyzed, and the statistical analysis of that time-series behavior sequence ends. If the user interacts with the same product again, a new time-series behavior sequence is statistically analyzed. Meanwhile, a user may not ultimately place an order for a product. In this case, if the time interval is too long, exceeding the third preset duration (e.g., 3 days), a "stop" action is added as a marker for the end of the operation. This creates a time sequence of a user's behavior towards a particular product. The third preset duration is longer than the second preset duration.
[0039] In one specific embodiment, user actions include six types: "browse," "favorite," "add to cart," "place order," "interval," and "stop." For ease of data processing and to better suit computer processing, these actions can be pre-encoded using symbols such as numbers and / or letters. For example, the six actions can be encoded using numbers as follows:
[0040] Record "browsing" behavior as "0";
[0041] Record the "collection" action as "1";
[0042] Record the "add to cart" action as "2";
[0043] Record the "place an order" action as "3";
[0044] Record the "interval" behavior as "4";
[0045] Record the "stop" action as "5".
[0046] After processing the historical shopping data of the user to be predicted, the resulting time-series behavior sequences correspond to different arrays. For example, if the behavior of the user to be predicted in a shopping behavior for product A is sorted by behavior time as "browse, add to cart, browse, interval, browse, place order", then this shopping behavior is recorded as [020403]. As another example, if the behavior of the user to be predicted in a shopping behavior for product B is sorted by behavior time as "browse, browse, add to cart, favorite, browse, browse, stop", then this shopping behavior is recorded as [0021005].
[0047] In this embodiment, based on historical shopping data, each product that is to be predicted to have been purchased is processed to obtain the product category sequence corresponding to that product. Importantly, it is necessary to obtain the product category to which the product belongs. Specifically, for a given product, its name can be obtained through historical shopping data, thus obtaining its product identifier. This product identifier can be represented by a unique identity document (id). In a pre-stored set of product categories, the product category and category identifier corresponding to the product identifier are queried to obtain the product category sequence corresponding to that product, denoted as [product id, product name, category id, category name].
[0048] In one embodiment, when obtaining the product category sequence corresponding to each product based on historical shopping data, the specific process is as follows: Based on historical shopping data, determine each product purchased by the user to be predicted; for each product: determine whether there is a product category corresponding to the product; if so, perform one-hot encoding on the product category to obtain the category identifier corresponding to the product category; if not, treat the product as a new product category, perform one-hot encoding on the new product category to obtain the category identifier corresponding to the product category; based on the category identifier, obtain the product category sequence corresponding to each product.
[0049] In this embodiment, a specific encoding method can be used to encode the category identifiers of each product category, facilitating computer processing. Preferably, one-hot encoding is used for the category identifiers; for example, beauty and skincare, food and beverage, and electronic digital products can be encoded as 100, 010, and 001, respectively. Encoding facilitates category management and computer processing, improving the efficiency of the shopping behavior prediction process.
[0050] In this embodiment, for products whose product categories cannot be found, the products are treated as new product categories and a missing code is applied.
[0051] In one embodiment, feature values may be missing in the temporal behavior sequence and the product category sequence for various reasons. For example, after confirming the product name and product identifier, if the corresponding product category cannot be found in the product category set, it indicates that the feature value in the product category sequence is missing. Another example is that erroneous data in historical shopping data may also cause feature values to be missing in the temporal behavior sequence. In this case, the missing values can be handled by any of the following methods: deletion, interpolation prediction, numerical imputation, or missing value encoding. Specifically, when a product category query fails, the entire product category sequence is directly deleted; or, when a feature value is missing in a time-series behavior sequence, interpolation prediction is performed based on other time-series behavior sequences to fill in the missing feature value; or, when a feature value is missing in a time-series behavior sequence, the mean, median, or mode is calculated using two time-adjacent time-series behavior sequences with missing feature values, and then the mean, median, or mode is used to fill in the missing value; when a product category query fails, the product name is directly used as the product category for encoding, becoming a new product category, and the new product category is updated in the product category set.
[0052] In one embodiment, after obtaining the temporal behavior sequence and the product category sequence, the specific implementation process for obtaining user features, product features, and comprehensive features based on the temporal behavior sequence and the product category sequence is as follows: Based on the temporal behavior sequence and the product category sequence, obtain at least one user feature value, wherein the user feature value is a statistical value of the behavior pattern of the user to be predicted when purchasing each product, or a statistical value of the behavior pattern of the user to be predicted when purchasing products corresponding to each product category; Based on the user feature value, obtain user features; Based on the temporal behavior sequence, obtain at least one product feature value, wherein the product feature value is a statistical value of the behavior pattern of each product purchased by the user to be predicted; Based on the product feature value, obtain product features; Based on the temporal behavior sequence, obtain at least one comprehensive feature value, wherein the comprehensive feature value is a statistical value of the behavior pattern of the user to be predicted when purchasing the target product; Based on the comprehensive feature value, obtain comprehensive features.
[0053] In this embodiment, the time-series behavior sequences and product category sequences extracted from historical shopping data are used as initial data for feature mining, further extracting user features, product features, and comprehensive features. Specifically, user feature values, product feature values, and comprehensive feature values are statistical values of behavioral patterns. For example, the total number of purchase behaviors of the user to be predicted is counted, calculating the proportion of purchase behaviors in the total number of behaviors, calculating the proportion of purchase behaviors in desired behaviors (non-purchase behaviors can be recorded as -1, where non-purchase behavior refers to intervals or cessation), and calculating the number of times the user to be predicted has purchased or desired a certain type of product. Thus, user features can be obtained from user feature values, product features from product feature values, and comprehensive features from comprehensive feature values.
[0054] In this embodiment, to further facilitate computer processing, user characteristics, product characteristics, and comprehensive characteristics can be represented by arrays respectively.
[0055] In one embodiment, the process of predicting shopping behavior mainly aims to analyze whether a user intends to purchase various products. Therefore, the visible behavioral patterns mentioned above are further combined and defined to obtain purchasing behavior and desired purchasing behavior. Specifically, based on the time-series behavior sequence and the product category sequence, at least one user feature value is obtained. The specific process is as follows: the behavioral patterns are combined and defined to determine purchasing behavior and desired purchasing behavior, wherein purchasing behavior corresponds to at least one behavioral pattern, and desired purchasing behavior corresponds to at least one behavioral pattern; the purchasing behavior and desired purchasing behavior are updated to the time-series behavior sequence; based on the product category sequence and the updated time-series behavior sequence, at least one user feature value is obtained. Based on the time-series behavior sequence, at least one product feature value is obtained. The specific process is as follows: based on the updated time-series behavior sequence, at least one product feature value is obtained; based on the time-series behavior sequence, at least one comprehensive feature value is obtained, including: based on the updated time-series behavior sequence, at least one comprehensive feature value is obtained.
[0056] Furthermore, for the six visible behavioral patterns—browsing, favorites, adding to cart, placing an order, interval, and stopping—these are further combined and defined. Specifically, the "placing an order" behavior is defined as a "purchase" behavior, and the sum of "favorites," "adding to cart," and "placing an order" behaviors is defined as a "want to buy" behavior. Then, based on purchase and want-to-buy behaviors, user characteristic values and product characteristic values are calculated.
[0057] In one specific embodiment, user characteristics include behavioral activity, purchase behavior ratio, product category statistics for each user behavior pattern, user category repetition, and user product repetition. More specifically, the user characteristic values include at least one of the following:
[0058] User activity levels include:
[0059] The total number of times a user's behavior (browsing, favorites, adding to cart, placing an order, intermittent, stopping) is predicted.
[0060] The proportion of the number of times a certain behavior of the user to be predicted occurs in the total statistical value of the number of times all behavior occurs;
[0061] The total statistical value of the number of occurrences of all user behaviors to be predicted;
[0062] The weighted total statistical value of the number of occurrences of all user behaviors to be predicted.
[0063] Regarding the proportion of purchase behavior, including:
[0064] The ratio of the number of times a user's purchase behavior is predicted to the total number of times all behaviors occur, where not purchasing is recorded as -1, and non-purchase behavior includes stopping and intervals;
[0065] The ratio of the number of times a user's purchase behavior is predicted to the total number of times a user wants to purchase (e.g., -1 is recorded if no purchase is made).
[0066] For product category statistics of user behavior, the following are included:
[0067] Statistics on the number of product categories for which the user to be predicted has engaged in (including all behaviors);
[0068] Statistics on the number of product categories that users have purchased;
[0069] Statistics on the number of product categories that users have considered purchasing.
[0070] For user category duplication, including:
[0071] The ratio of the number of product categories for which the user to be predicted has engaged in (including all behaviors) to the total number of categories;
[0072] The ratio of the number of product categories that the predicted user has purchased to the total number of categories;
[0073] The ratio of the number of product categories that the user in question has considered purchasing to the total number of product categories.
[0074] Regarding user product repeatability, it includes:
[0075] The ratio of the number of products for which the user to be predicted has engaged in (including all behaviors) to the total number of products;
[0076] The ratio of the number of products that the user has purchased to the total number of products;
[0077] The ratio of the number of products that the user has previously considered purchasing to the total number of products;
[0078] Furthermore, product characteristics include features such as product activity level, product popularity, and product category. More specifically, product characteristics include at least one of the following features:
[0079] For product activity levels, including:
[0080] Statistics on the total number of times a particular product has been viewed, favorited, added to cart, placed an order, interrupted, or stopped by a specific action.
[0081] The ratio of the number of times a certain product has been handled by a certain behavior to the total number of times all behavior methods have occurred;
[0082] The total statistical value of the number of times all behaviors related to a certain product occur;
[0083] The weighted total statistical value of the number of occurrences of all behaviors related to a certain product.
[0084] Regarding product popularity, including:
[0085] The statistical value of the number of users who have interacted with a particular product;
[0086] The statistical value of the number of users who have made a purchase for a certain product;
[0087] Statistics on the number of users who have expressed a desire to purchase a particular product;
[0088] The ratio of the number of times a purchase of a particular product occurred to the total number of times all behaviors occurred (e.g., not purchasing is counted as -1);
[0089] The ratio of the number of times a purchase is made for a particular product to the total number of times a purchase intention is made (e.g., not making a purchase is recorded as -1).
[0090] Furthermore, the comprehensive features include the proportion of user behavior related to a particular product. More specifically, the feature values of the comprehensive features include at least one of the following:
[0091] The number of times a user's behavior is predicted for a particular product, and the proportion of that user's total number of behaviors for all products.
[0092] The number of times a user makes a purchase for a specific product, compared to the proportion of that user's total purchases across all products.
[0093] The ratio of the number of times a user intends to purchase a particular product to the total number of times that user intends to purchase all products.
[0094] In one embodiment, to characterize the different importance of each behavior mode, feature values are weighted using preset weights. Specifically, user features are obtained based on user feature values, and the process is as follows: user feature values are weighted using preset weights corresponding to each behavior mode; user features are obtained based on the user feature values before and after weighting. Product features are obtained based on product feature values, and the process is as follows: product feature values are weighted using preset weights corresponding to each behavior mode; product features are obtained based on the product feature values before and after weighting. Comprehensive features are obtained based on comprehensive feature values, and the process is as follows: comprehensive feature values are weighted using preset weights corresponding to each behavior mode; comprehensive features are obtained based on the comprehensive feature values before and after weighting.
[0095] In this embodiment, the preset weights can be set to specific weight values based on actual conditions, experience, or experimental data. For example, a weight of 1 is assigned to the "browsing" behavior, a weight of 2 is assigned to the "favoriting" behavior, a weight of 4 is assigned to the "add to cart" behavior, and a weight of 8 is assigned to the "placing an order" behavior. The interval and stop behaviors have no practical significance and are not assigned weights.
[0096] In one embodiment, to avoid excessive dispersion of feature values, user features, product features, and comprehensive features are standardized separately. Specifically, user features are obtained based on user feature values, as follows: Each user feature value is standardized using the maximum and minimum user feature values; the user feature is then obtained based on the standardized user feature values. Product features are obtained based on product feature values, as follows: Each product feature value is standardized using the maximum and minimum product feature values; the product feature is then obtained based on the standardized product feature values. Comprehensive features are obtained based on comprehensive feature values, as follows: Each comprehensive feature value is standardized using the maximum and minimum comprehensive feature values; the comprehensive feature is then obtained based on the standardized comprehensive feature values.
[0097] In this embodiment, for any user feature, the feature value with the largest numerical value is the maximum user feature value, and the feature value with the smallest numerical value is the minimum user feature value. Each user feature value in this user feature is standardized using the following formula:
[0098]
[0099] For any given product feature, the feature value with the largest numerical value is the maximum product feature value, and the feature value with the smallest numerical value is the minimum product feature value. Each product feature value within this feature is standardized using the following formula:
[0100]
[0101] For any given composite feature, the feature with the largest numerical value is the maximum composite feature value, and the feature with the smallest numerical value is the minimum composite feature value. Each composite feature value is standardized using the following formula:
[0102]
[0103] Step 103: Based on user characteristics, product characteristics, and comprehensive characteristics, determine the feature matrix parameters of the Hidden Markov Model, wherein the Hidden Markov Model is pre-set based on operational behavior and preset hidden states.
[0104] In this embodiment, a Hidden Markov Model is pre-defined based on operational behaviors and hidden states. Furthermore, when the operational behaviors include six visible behaviors such as "browse," "favorite," "add to cart," "place order," "interval," and "stop," three hidden states are defined: "interested," "intend to purchase," and "no longer interested." Thus, the temporal sequence of behaviors is treated as a memoryless sequence to construct the basic Hidden Markov Model.
[0105] When it is necessary to predict the shopping behavior of users, it is necessary to obtain the user characteristics, product characteristics and comprehensive characteristics of the users through their historical shopping data. Then, based on the user characteristics, product characteristics and comprehensive characteristics, the feature matrix parameters of the Hidden Markov Model are determined, and thus the Hidden Markov Model with known parameters is obtained, thus completing the prediction process.
[0106] In one embodiment, the feature matrix parameters of the Hidden Markov Model (HMM) include state behavior matrix parameters and state transition matrix parameters. To further improve prediction accuracy, a neural network is embedded into the calculation process of the feature matrix parameters. Specifically, based on user features, product features, and comprehensive features, the feature matrix parameters of the HMM are determined as follows: User features and comprehensive features are input into a preset first neural network model, and the state behavior matrix parameters output by the first neural network model are obtained. These state behavior matrix parameters are used to calculate the probability of associating user features with the HMM. Product features and comprehensive features are input into a preset second neural network model, and the state transition matrix parameters output by the second neural network model are obtained. These state transition matrix parameters are used to calculate the probability of associating product features with the HMM.
[0107] In this embodiment, as Figure 2 As shown, the first neural network model is used to process user features and comprehensive features. User features and comprehensive features are input into the first neural network model, which then outputs the state-behavior matrix parameters of the Hidden Markov Model. The probability calculation process from hidden states to visible behaviors is constructed and correlated with user features.
[0108] The second neural network model is used to process product features and comprehensive features. Product features and comprehensive features are input into the second neural network model, which then outputs the state transition matrix parameters of a Hidden Markov Model. The probability calculation process from hidden states to visible behaviors is constructed and correlated with product features.
[0109] After obtaining the state-behavior matrix parameters through the first neural network model and the state transition matrix parameters through the second neural network model, the initial hidden state probabilities are input into a Hidden Markov Model (HMM) with known parameters. The HMM then outputs the predicted probability of at least one operational behavior. Furthermore, the predicted probability of at least one operational behavior output by the HMM can also be represented in the form of a predicted temporal sequence of behaviors.
[0110] Furthermore, the state behavior matrix with undetermined parameters has a dimension of 3×6 and includes 7 unknown parameters, namely x1, x2, x3, x4, x5, x6 and x7, with each row of unknown parameters summing to 1.
[0111] The state behavior matrix with undetermined parameters is as follows:
[0112]
[0113] Where x1, x2, x3, x4, x5, x6 and x7 are unknown parameters in the state behavior matrix.
[0114] By using the first neural network model, the specific values of x1, x2, x3, x4, x5, x6 and x7 can be determined, thus obtaining the state behavior matrix parameters.
[0115] Furthermore, the state transition matrix with undetermined parameters has a dimension of 3×3 and includes 6 unknown parameters, namely y1, y2, y3, y4, y5 and y6, with each row of unknown parameters summing to 1.
[0116] The state transition matrix with undetermined parameters is as follows:
[0117]
[0118] Where y1, y2, y3, y4, y5, and y6 are unknown parameters in the state transition matrix.
[0119] By using the first neural network model, the specific values of y1, y2, y3, y4, y5, and y6 can be determined, thus obtaining the state transition matrix parameters.
[0120] In one embodiment, the first neural network model and the second neural network model are trained using sample data; wherein, the sample data includes sample shopping data of at least one sample user within a sample time period, and the sample shopping data includes the operational behavior of each sample user purchasing any sample product.
[0121] The training process is as follows:
[0122] Based on sample shopping data, sample user characteristics, sample product characteristics, and sample comprehensive characteristics are obtained. Among them, sample user characteristics represent the characteristics of sample users purchasing each sample product, sample product characteristics represent the characteristics of each sample product being purchased by the sample user, and sample comprehensive characteristics represent the characteristics of sample users purchasing the target sample product.
[0123] Input the sample user features and sample comprehensive features into the preset first original neural network model, and obtain the sample state behavior matrix parameters output by the first original neural network model;
[0124] Input the sample product features and sample comprehensive features into the preset second original neural network model, and obtain the sample state transition matrix parameters output by the second original neural network model. The sample state behavior matrix parameters and sample state transition matrix parameters are the sample feature matrix parameters of the hidden Markov model.
[0125] Obtain the sample prediction probability of at least one operational behavior output by the Hidden Markov Model;
[0126] Based on the sample prediction probability, obtain the training loss function;
[0127] Based on the training loss function, adjust the internal parameters of the first and second original neural network models respectively.
[0128] Repeat the steps of obtaining sample user features, sample product features, and sample comprehensive features based on sample shopping data until the training loss function reaches its minimum value, and obtain the first neural network model and the second neural network model.
[0129] In this embodiment, the original architecture of the first original neural network model and the second original neural network model can be set according to the actual situation and needs. For example, the first original neural network model includes two layers of neural networks, and the second original neural network model also includes two layers of neural networks.
[0130] In this embodiment, during neural network training, the training loss function is obtained through the sample prediction probabilities. Specifically, the training loss function is the average of the negative logarithms of the sample prediction probabilities, as shown in the following formula:
[0131]
[0132] Where, p i Let represent the predicted probability of the i-th sample obtained in this training, where i is a positive integer, N represents the total number of predicted probabilities of samples obtained in this training, and ln represents the logarithmic calculation.
[0133] In one embodiment, to prevent the first and second neural network models from overfitting during training, L2 regularization is used. An L2 regularization penalty term is added to the objective function of the neural network model. When the regularization penalty term reaches a preset threshold, some feature coefficients in the first and / or second neural network models will become 0, which can prevent overfitting.
[0134] In one embodiment, during the training process, similar to the model usage process, when obtaining sample user features, sample product features, and sample comprehensive features based on sample shopping data, it is necessary to extract the sample time-series behavior sequence corresponding to each sample user from the original shopping data. Then, the behavior patterns in the sample time-series behavior sequence are statistically analyzed to obtain sample user features, sample product features, and sample comprehensive features. Further, the sample time-series behavior sequence includes browsing, favorites, adding to cart, placing an order, interval, and stopping, as well as combined defined purchase behaviors and desired purchase behaviors, as mentioned in the above embodiments.
[0135] Furthermore, the sample user characteristics include sample behavior activity, sample purchase behavior ratio, sample product category statistics for each behavior mode, sample user category duplication, and sample user product duplication. More specifically, the sample user characteristics include at least one of the following:
[0136] For the activity level of sample users, including:
[0137] The total number of times a certain behavior (browsing, favorites, adding to cart, placing an order, interrupting, stopping) is counted for a certain sample of users.
[0138] The proportion of the number of times a particular behavior occurs among a sample of users in the total statistical value of the number of times all behavior occurs;
[0139] The total statistical value of the frequency of all behavioral patterns of a sample user;
[0140] The weighted total statistical value of the number of occurrences of all behaviors of a sample user.
[0141] The proportion of sample purchase behavior includes:
[0142] The ratio of the number of times a user in a sample made a purchase to the total number of times all behaviors occurred. Not making a purchase is recorded as -1. The non-purchase behavior includes stopping and intervals.
[0143] The ratio of the number of times a sample user made a purchase to the total number of times they wanted to make a purchase (e.g., -1 is recorded for not making a purchase).
[0144] The product category statistics for sample user behavior include:
[0145] Statistics on the number of product categories for which a sample user has engaged in any activity (including all activities);
[0146] Statistics on the number of product categories that a sample of users has purchased;
[0147] Statistics on the number of product categories that a sample of users had considered purchasing.
[0148] For the duplication of sample user categories, the following are included:
[0149] The ratio of the number of product categories in which a sample user has engaged in (including all behaviors) to the total number of product categories;
[0150] The ratio of the number of product categories that a sample user has purchased to the total number of product categories;
[0151] The ratio of the number of product categories that a sample user had considered purchasing to the total number of product categories.
[0152] For the sample user product duplication rate, it includes:
[0153] The ratio of the number of products for which a sample user has engaged in (including all engagements) to the total number of products;
[0154] The ratio of the number of products purchased by a certain sample user to the total number of products;
[0155] The ratio of the number of products that a sample user had considered purchasing to the total number of products;
[0156] Furthermore, the characteristics of the sample products include features such as product activity level, product popularity, and product category. More specifically, the feature values of the sample product characteristics include at least one of the following:
[0157] For the activity level of sample products, including:
[0158] Statistics on the total number of times a sample product has been interacted with by a specific behavior (browsing, favorites, adding to cart, placing an order, interrupted, stopped);
[0159] The ratio of the number of times a particular sample product was operated on by a certain behavior to the total number of times all behavior methods occurred;
[0160] The total statistical value of the frequency of all behavioral patterns for a particular sample product;
[0161] The weighted total statistical value of the number of occurrences of all behaviors for a particular sample product.
[0162] Regarding the popularity of sample products, including:
[0163] The statistical value of the number of sample users who have interacted with a specific sample product;
[0164] The statistical value of the number of sample users who have made a purchase for a specific sample product;
[0165] Statistics on the number of sample users who have expressed a desire to purchase a specific sample product;
[0166] The ratio of the number of times a purchase behavior occurs for a specific sample product to the total number of times all behaviors occur (e.g., not purchasing is recorded as -1);
[0167] The ratio of the number of times a purchase action occurs for a specific sample product to the total number of times a purchase action occurs (e.g., not purchasing is recorded as -1).
[0168] Furthermore, the comprehensive features include the proportion of sample users' behaviors towards a specific sample product. More specifically, the feature values of the sample comprehensive features include at least one of the following:
[0169] The number of times a sample user engages in a particular sample product, and the proportion of that sample user's total number of engagements across all sample products.
[0170] The number of times a sample user makes a purchase for a specific sample product, compared to the proportion of that sample user's total number of purchases across all products.
[0171] The proportion of a sample user's desired purchase behavior for a specific sample product to the total number of desired purchase behaviors for all products.
[0172] In this embodiment, as Figure 3The diagram illustrates the training and testing of shopping behavior prediction. Browsing is denoted as p, adding to cart as f, adding to cart as c, placing an order as o, pausing as i, stopping as x, interest state as X, no longer interested as Y, intending to buy as Z, and unknown as a question mark. In one example, during the training phase, if a user consecutively browses, adds to cart, and places an order for a particular product, it indicates that the user has purchased the product. If a user consecutively browses, pauses, browses again, and stops, it indicates that the user has not purchased the product. Browsing corresponds to the interest state, adding to cart and placing an order correspond to the intending to buy state, and pausing and stopping correspond to the no longer interested state. During the testing phase, after a user browses, adds to cart, or adds to cart for a product, the hidden state corresponding to each behavior can be determined using a trained Hidden Markov Model, and the predicted probability of the subsequent action can be calculated.
[0173] In the training set, by analyzing the temporal sequences of sample users' actions on sample items, the first and second neural network models embedded with a Hidden Markov Model (HMM) are trained to obtain the parameters of the sample state transition matrix and the sample state-behavior matrix. This reveals the implicit relationship between user features, item features, and HMM parameters. In the test set, given the user features, item features, and combined features of the user to be predicted, as well as the user's initial actions on the items, the HMM can predict the distribution of the user's subsequent behavior sequences based on the state transition matrix and state-behavior matrix parameters. This yields the predicted probability of at least one action for the user.
[0174] Step 104: Input the initial hidden state probability and the initial operation behavior of the user to be predicted into the Hidden Markov Model to obtain the predicted probability of at least one operation behavior output by the Hidden Markov Model.
[0175] In this embodiment, considering that users' online shopping behavior begins with an "interested" state, the initial hidden state probability is set to
[100] , that is, the probabilities of "interested", "willing to buy", and "no longer interested" are 1, 0, and 0, respectively. The outputs of the first neural network model and the second neural network model are combined to obtain a hidden Markov model with known feature matrix parameters, which can calculate the probability of a specific behavior sequence under the feature matrix parameters.
[0176] Furthermore, after obtaining the predicted probability of at least one action of the user to be predicted, that is, after calculating the probability of a specific action sequence under the feature matrix parameters, the obtained predicted probability can be further processed to obtain at least one of the following information: whether the user to be predicted will purchase any product; aggregate the predictions of the user to be predicted for a certain product to predict the purchase rate of the product over a period of time; and the behavioral characteristics of the user to be predicted within a period.
[0177] The shopping behavior prediction method, apparatus, device, and storage medium provided by this invention obtain user characteristics, product characteristics, and comprehensive characteristics from the historical shopping data of the user to be predicted within a preset time period. Based on the user characteristics, product characteristics, and comprehensive characteristics, the feature matrix parameters of the Hidden Markov Model (HMM) are determined. Finally, the HMM is used to derive the predicted probability of at least one operational behavior. In other words, associating user characteristics, product characteristics, and comprehensive characteristics with the HMM is equivalent to associating user characteristics, product characteristics, and comprehensive characteristics with the calculation process of prediction probability, adding multiple characteristic factors affecting shopping behavior to the prediction process, thereby improving the accuracy of shopping behavior prediction. Furthermore, since user purchasing behavior has sequential, interactive, and memoryless characteristics, using the HMM can better process this behavior, making the predicted probability of the behavior closer to the user's actual future actions, further improving the accuracy of shopping behavior prediction.
[0178] Furthermore, using the user's online shopping behavior (including browsing, favorites, adding to cart, placing an order, pausing, and stopping) as input, feature engineering and statistical methods such as data preprocessing, missing value handling, feature construction (user features, product features, and comprehensive features), and embedded selection are used to extract the user's behavioral characteristics and the features exhibited by different products during the online shopping process. These are then used as factors influencing the user's behavior at different time intervals. A behavioral decision model based on latent state mining is constructed, which can reduce the dimensionality of thousands of user behavior sequences to behavioral modalities containing only a few latent state transformations. Using neural networks, the extracted user features, product features, and comprehensive features are used as input, and the feature matrix parameters of the behavioral decision model containing latent states are used as output. The first and second neural network models are trained by maximizing the probability of the behavior sequence (i.e., minimizing the training loss function). Given the user's characteristics, product features, and comprehensive features, this allows the prediction of the probability distribution of various user behaviors for a certain product and whether the user will make a purchase. By aggregation, the probability of a certain product being purchased within a certain period and the consumption behavior of the user within a certain period can be predicted.
[0179] The shopping behavior prediction device provided by the present invention is described below. The shopping behavior prediction device described below can be referred to in correspondence with the shopping behavior prediction method described above. Figure 4 As shown, the shopping behavior prediction device includes:
[0180] The data acquisition module 401 is used to acquire the historical shopping data of the user to be predicted within a preset time period, wherein the historical shopping data includes the user's operation behavior of purchasing any item.
[0181] The feature acquisition module 402 is used to acquire user features, product features and comprehensive features based on historical shopping data. Among them, user features are the features that represent the user to be predicted to purchase each product, product features are the features that represent each product purchased by the user to be predicted, and comprehensive features are the features that represent the user to be predicted to purchase the target product.
[0182] The parameter acquisition module 403 is used to determine the feature matrix parameters of the hidden Markov model based on user features, product features and comprehensive features, wherein the hidden Markov model is pre-set based on operational behavior and preset hidden states.
[0183] The probability calculation module 404 is used to input the initial hidden state probability and the initial operation behavior of the user to be predicted into the Hidden Markov Model to obtain the predicted probability of at least one operation behavior output by the Hidden Markov Model.
[0184] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5As shown, the electronic device may include: a processor 501, a communication interface 502, a memory 503, and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504. The processor 501 can call logical instructions in the memory 503 to execute a shopping behavior prediction method. This method includes: acquiring historical shopping data of the user to be predicted within a preset time period, wherein the historical shopping data includes the user's operational behavior of purchasing any one item; based on the historical shopping data, acquiring user features, product features, and comprehensive features, wherein the user features represent the characteristics of the user purchasing each item, the product features represent the characteristics of each item being purchased by the user, and the comprehensive features represent the characteristics of the user purchasing the target item; based on the user features, product features, and comprehensive features, determining the feature matrix parameters of a hidden Markov model, wherein the hidden Markov model is pre-set based on operational behavior and a preset hidden state; and inputting the initial hidden state probability and the initial operational behavior of the user to be predicted into the hidden Markov model to obtain the predicted probability of at least one operational behavior output by the hidden Markov model.
[0185] Furthermore, the logical instructions in the aforementioned memory 503 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0186] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the shopping behavior prediction method provided by the above methods. The method includes: acquiring historical shopping data of the user to be predicted within a preset time period, wherein the historical shopping data includes the user's operation behavior of purchasing any one item; acquiring user features, product features, and comprehensive features based on the historical shopping data, wherein the user features are features representing the user's purchase of each item, the product features are features representing the user's purchase of each item, and the comprehensive features are features representing the user's purchase of the target item; determining the feature matrix parameters of a hidden Markov model based on the user features, product features, and comprehensive features, wherein the hidden Markov model is pre-set based on the operation behavior and a preset hidden state; and inputting the initial hidden state probability and the initial operation behavior of the user to be predicted into the hidden Markov model to obtain the prediction probability of at least one operation behavior output by the hidden Markov model.
[0187] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the shopping behavior prediction method provided by the above methods. The method includes: acquiring historical shopping data of a user to be predicted within a preset time period, wherein the historical shopping data includes the user's operational behavior of purchasing any one item; acquiring user features, product features, and comprehensive features based on the historical shopping data, wherein the user features are characteristics representing the user's purchase of each item, the product features are characteristics representing each item purchased by the user, and the comprehensive features are characteristics representing the user's purchase of a target item; determining the feature matrix parameters of a hidden Markov model based on the user features, product features, and comprehensive features, wherein the hidden Markov model is pre-set based on operational behavior and a preset hidden state; and inputting the initial hidden state probability and the initial operational behavior of the user to be predicted into the hidden Markov model to obtain the predicted probability of at least one operational behavior output by the hidden Markov model.
[0188] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0189] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0190] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for predicting shopping behavior, characterized in that, include: Obtain the historical shopping data of the user to be predicted within a preset time period, wherein the historical shopping data includes the user's purchase behavior of any item; Based on the historical shopping data, user characteristics, product characteristics, and comprehensive characteristics are obtained. The user characteristics are those that represent the characteristics of the user to be predicted purchasing each of the products. The product characteristics are those that represent the characteristics of each product being purchased by the user to be predicted. The comprehensive characteristics are those that represent the characteristics of the user to be predicted purchasing the target product. Based on the user characteristics, the product characteristics, and the comprehensive characteristics, the feature matrix parameters of the hidden Markov model are determined, wherein the hidden Markov model is pre-set based on the operation behavior and the preset hidden state; The initial hidden state probability and the initial operation behavior of the user to be predicted are input into the Hidden Markov Model to obtain the predicted probability of at least one of the operation behaviors output by the Hidden Markov Model. The operational behavior includes the behavior method and the behavior time; The process of obtaining user characteristics, product characteristics, and comprehensive characteristics based on the historical shopping data includes: Based on the behavior time, obtain the time-series behavior sequence corresponding to each of the products purchased by the user to be predicted, wherein the time-series behavior sequence is obtained by arranging the behavior in chronological order; Based on the historical shopping data, obtain the product category sequence corresponding to each product, wherein the product category sequence includes the product category corresponding to the product; Based on the time-series behavior sequence and the product category sequence, the user characteristics, the product characteristics, and the comprehensive characteristics are obtained; The user features, product features, and comprehensive features are generated based on feature values obtained by statistically analyzing the behavioral patterns in the time-series behavior sequence. The feature matrix parameters include state behavior matrix parameters and state transition matrix parameters; The step of determining the feature matrix parameters of the Hidden Markov Model based on the user features, the product features, and the comprehensive features includes: The user features and the comprehensive features are input into a preset first neural network model to obtain the state behavior matrix parameters output by the first neural network model. The state behavior matrix parameters are used to associate the user features with the probability calculation process of the hidden Markov model. The product features and the comprehensive features are input into a preset second neural network model, and the state transition matrix parameters output by the second neural network model are obtained. The state transition matrix parameters are used to associate the product features with the probability calculation process of the hidden Markov model.
2. The shopping behavior prediction method according to claim 1, characterized in that, The step of obtaining the user features, the product features, and the comprehensive features based on the time-series behavior sequence and the product category sequence includes: Based on the time-series behavior sequence and the product category sequence, at least one user feature value is obtained, wherein the user feature value is a statistical value of the behavior pattern of the user to be predicted when purchasing each of the products, or a statistical value of the behavior pattern of the user to be predicted when purchasing the products corresponding to each of the product categories; Based on the user feature values, the user features are obtained; Based on the time-series behavior sequence, at least one product feature value is obtained, wherein the product feature value is a statistical value of the behavior pattern that occurs when each product is purchased by the user to be predicted; Based on the product feature values, the product features are obtained; Based on the time-series behavior sequence, at least one comprehensive feature value is obtained, wherein the comprehensive feature value is a statistical value of the behavior pattern that occurs when the user to be predicted purchases the target product; Based on the comprehensive feature value, the comprehensive feature is obtained.
3. The shopping behavior prediction method according to claim 2, characterized in that, The step of obtaining at least one user feature value based on the time-series behavior sequence and the product category sequence includes: The behavioral patterns are combined and defined to determine the purchasing behavior and the desired purchasing behavior, wherein the purchasing behavior corresponds to at least one of the behavioral patterns, and the desired purchasing behavior corresponds to at least one of the behavioral patterns. Update the purchase behavior and the desired purchase behavior to the time-series behavior sequence; Based on the product category sequence and the updated time-series behavior sequence, at least one user feature value is obtained; The step of obtaining at least one product feature value based on the time-series behavior sequence includes: Based on the updated temporal behavior sequence, at least one of the product feature values is obtained; The step of obtaining at least one comprehensive feature value based on the time-series behavior sequence includes: Based on the updated temporal behavior sequence, at least one of the comprehensive feature values is obtained.
4. The shopping behavior prediction method according to claim 2, characterized in that, The step of obtaining the user features based on the user feature values includes: The user feature values are weighted by a preset weight corresponding to each of the aforementioned behaviors. The user features are obtained based on the user feature values before and after weighting, respectively. The step of obtaining the product features based on the product feature values includes: The product feature values are weighted by a preset weight corresponding to each of the aforementioned behaviors. The product features are obtained based on the product feature values before and after weighting, respectively. The process of obtaining the comprehensive features based on the comprehensive feature values includes: The comprehensive feature value is weighted by a preset weight corresponding to each of the aforementioned behaviors. The comprehensive feature is obtained based on the comprehensive feature values before and after weighting.
5. The shopping behavior prediction method according to claim 2, characterized in that, The step of obtaining the user features based on the user feature values includes: Each user feature value is standardized using the maximum and minimum user feature values corresponding to the user feature values; The user features are obtained based on the standardized user feature values; The step of obtaining the product features based on the product feature values includes: Each product feature value is standardized using the maximum and minimum product feature values corresponding to the product feature values; Based on the standardized product feature values, the product features are obtained; The process of obtaining the comprehensive features based on the comprehensive feature values includes: Each of the comprehensive feature values is standardized using the maximum and minimum comprehensive feature values corresponding to the comprehensive feature values; The comprehensive features are obtained based on the standardized comprehensive feature values.
6. The shopping behavior prediction method according to claim 1, characterized in that, The step of obtaining the product category sequence corresponding to each product based on the historical shopping data includes: Based on the historical shopping data, determine each of the items purchased by the user to be predicted; For each product: determine whether there is a product category corresponding to the product; if yes, perform one-hot encoding on the product category to obtain the category identifier corresponding to the product category; if no, treat the product as a new product category, perform one-hot encoding on the new product category to obtain the category identifier corresponding to the product category; Based on the category identifier, obtain the product category sequence corresponding to each product.
7. The shopping behavior prediction method according to claim 1, characterized in that, The first neural network model and the second neural network model are trained using sample data; wherein, the sample data includes sample shopping data of at least one sample user within a sample time period, and the sample shopping data includes the operational behavior of each sample user purchasing any sample product; The training process is as follows: Based on the sample shopping data, sample user features, sample product features, and sample comprehensive features are obtained. The sample user features are characteristics of the sample user purchasing each of the sample products. The sample product features are characteristics of each of the sample products being purchased by the sample user. The sample comprehensive features are characteristics of the sample user purchasing the target sample product. The sample user features and the sample comprehensive features are input into a preset first original neural network model to obtain the sample state behavior matrix parameters output by the first original neural network model; The sample product features and the sample comprehensive features are input into a preset second original neural network model to obtain the sample state transition matrix parameters output by the second original neural network model, wherein the sample state behavior matrix parameters and the sample state transition matrix parameters are the sample feature matrix parameters of the hidden Markov model. Obtain the sample prediction probability of at least one of the operation behaviors output by the Hidden Markov Model; Based on the predicted probability of the samples, obtain the training loss function; Based on the training loss function, adjust the internal parameters of the first original neural network model and the second original neural network model respectively; Repeat the steps of obtaining sample user features, sample product features, and sample comprehensive features based on the sample shopping data until the training loss function reaches its minimum value, thereby obtaining the first neural network model and the second neural network model.
8. A shopping behavior prediction device, characterized in that, include: The data acquisition module is used to acquire the historical shopping data of the user to be predicted within a preset time period, wherein the historical shopping data includes the user's operation behavior of purchasing any item; The feature acquisition module is used to acquire user features, product features and comprehensive features based on the historical shopping data. The user features are features that characterize the user to be predicted to purchase each of the products. The product features are features that characterize each product purchased by the user to be predicted. The comprehensive features are features that characterize the user to be predicted to purchase the target product. The parameter acquisition module is used to determine the feature matrix parameters of the hidden Markov model based on the user features, the product features and the comprehensive features, wherein the hidden Markov model is pre-set based on the operation behavior and the preset hidden state; The probability calculation module is used to input the initial hidden state probability and the initial operation behavior of the user to be predicted into the hidden Markov model to obtain the predicted probability of at least one of the operation behaviors output by the hidden Markov model. The operational behavior includes the behavior method and the behavior time; The feature acquisition module is specifically used for: Based on the behavior time, obtain the time-series behavior sequence corresponding to each of the products purchased by the user to be predicted, wherein the time-series behavior sequence is obtained by arranging the behavior in chronological order; Based on the historical shopping data, obtain the product category sequence corresponding to each product, wherein the product category sequence includes the product category corresponding to the product; Based on the time-series behavior sequence and the product category sequence, the user characteristics, the product characteristics, and the comprehensive characteristics are obtained; The user features, product features, and comprehensive features are generated based on feature values obtained by statistically analyzing the behavioral patterns in the time-series behavior sequence. The feature matrix parameters include state behavior matrix parameters and state transition matrix parameters; The parameter acquisition module is specifically used for: The user features and the comprehensive features are input into a preset first neural network model to obtain the state behavior matrix parameters output by the first neural network model. The state behavior matrix parameters are used to associate the user features with the probability calculation process of the hidden Markov model. The product features and the comprehensive features are input into a preset second neural network model, and the state transition matrix parameters output by the second neural network model are obtained. The state transition matrix parameters are used to associate the product features with the probability calculation process of the hidden Markov model.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the shopping behavior prediction method as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the shopping behavior prediction method as described in any one of claims 1 to 7.