An online recommendation method for fresh agricultural products considering customer consumption behavior and preferences
A fresh agricultural product selection model is constructed through latent semantics and behavioral sequence utility functions combined with the gradient descent method, which solves the problem of insufficient accuracy in agricultural product recommendation in the existing technology, realizes accurate recommendation and inventory planning of agricultural products in fresh food e-commerce, and reduces operational costs. cost.
Patent Information
- Application Number
- CN202010556428.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-17
- Publication Date
- 2024-10-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing online product recommendation methods cannot effectively reflect the characteristics of agricultural products and customer consumption preferences, resulting in insufficient accuracy in the precise recommendation of agricultural products in fresh food e-commerce. Seasonal characteristics and complex supply and circulation links lead to high operating costs and slow sales.
A utility function based on latent semantics and behavior sequence is used, combined with the gradient descent method, to build a fresh agricultural product selection model. It takes into account the customer's consumption behavior and seasonal characteristics of agricultural products during the purchase cycle, integrates the latent factor vector and consumption behavior sequence utility, and optimizes the recommendation algorithm. .
It improves the accuracy of accurate recommendation of agricultural products, reduces unsalable sales and operating costs, and mines complex features of fresh products through latent semantic models, which alleviates the problem of product and user data sparseness and improves the operational efficiency of the fresh food e-commerce platform.
Smart Images

Figure CN111899063B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of fresh food e-commerce, and in particular to an online recommendation method for fresh agricultural products taking into account customer consumption behaviors and preferences. Background Art
[0002] With the development of cold chain logistics technology in the circulation of agricultural products and the continuous optimization of e-commerce models, the user stickiness and consumption habits of fresh food e-commerce have gradually been formed, and e-commerce has become an indispensable channel for purchasing fresh products. Fresh agricultural products are perishable and must be sold out within the season, otherwise a large amount of unsalable products will be wasted. At the same time, the high operating costs caused by high losses and complex supply and circulation links are also one of the bottlenecks encountered by the current development of fresh food e-commerce. Therefore, combining big data, artificial intelligence and other technologies, by analyzing user purchasing behavior within the cycle of fresh food e-commerce platforms, and predicting user needs in real time and accurately, it is of great significance for fresh food e-commerce to achieve personalized recommendations and precision marketing, reasonably plan fresh agricultural product inventory and supply, and improve the operating efficiency of fresh food e-commerce platforms.
[0003] Existing online product recommendation methods, including personalized recommendation algorithms such as collaborative filtering-based recommendation methods, content-based recommendation methods, and association rule mining-based recommendation methods, as well as online purchase prediction methods that use feature engineering and model fusion, are widely used in the e-commerce field. With the development of fresh food e-commerce, accurate recommendation of fresh agricultural products has gradually become a service focus for the development of fresh food e-commerce. To achieve accurate recommendation of fresh agricultural products, on the one hand, it is necessary to reflect the characteristic factors of agricultural products, such as origin, price, category, brand, etc., as well as customers' consumption preferences for various characteristics of fresh agricultural products. On the other hand, it is necessary to take into account the seasonal characteristics of fresh agricultural products, study the online consumption behavior of customers during the purchase cycle, and design a recommendation plan that is more suitable for agricultural products, so as to further improve the accuracy of model prediction.
[0004] When the existing commodity recommendation methods are applied to the field of fresh agricultural products, they cannot reflect the characteristics of agricultural products and customers' consumption preference factors for agricultural products. Therefore, the present invention improves the existing methods, introduces the product purchase cycle, models the customer's consumption behavior within the cycle, and integrates the latent semantic model, incorporates the prior characteristics of fresh agricultural products into the utility function, and establishes an online recommendation method for agricultural products applied to the field of fresh e-commerce. Summary of the invention
[0005] Purpose of the invention: In order to solve the problem of accurate prediction of agricultural products in fresh food e-commerce under the background of big data, the present invention provides an online recommendation method for fresh agricultural products that takes into account customer consumption behavior and preferences.
[0006] Technical solution: A method for online recommendation of fresh agricultural products considering customer consumption behavior and preferences, comprising the following steps:
[0007] (1) Data analysis and preprocessing;
[0008] (2) Constructing the utility function of fresh agricultural products based on latent semantics and behavioral sequence utility;
[0009] (3) Construct a fresh produce selection model that traverses the purchase cycle;
[0010] (4) The gradient descent method was used to solve the constructed fresh produce selection model;
[0011] (5) Use recall and precision to evaluate the prediction effect.
[0012] Specifically, the step (1) comprises the following steps:
[0013] (1.1) The user set U consisting of all users is represented by U = {u1,u2,u3,…}, and the product set I consisting of all products is represented by I = {i1,i2,i3,…}. A purchase cycle s represents the process in which a user makes a purchase after comparison and selection within a certain period of time, which is represented by a triple s = (u,sq,i b ), where u∈U represents the user in this purchase cycle; represents the user's product operation sequence in the purchase cycle, i b ∈sq represents the product that the user finally purchased after comparison and selection in this purchase cycle; the set of all purchase cycles is recorded as S = {s1, s2, s3, ...},
[0014] (1.2) Remove low-frequency fresh products and organize them into historical behavior sequences of users regarding fresh products during the purchase process;
[0015] (1.3) Use a heuristic method to divide a purchase cycle, and search forward from each user's purchase behavior as a dividing point. If the searched operation record is less than the set threshold, it is classified as a purchase cycle, and the user behavior sequence in different purchase cycles is obtained;
[0016] (1.4) Sort the frequency and rank of fresh products in each purchase cycle in descending order and conduct statistical analysis, using the frequency and rank as the basis for constructing the sequence utility function;
[0017] (1.5) The data set is divided into a training set and a test set in proportion. For the training set, a prediction model M is learned. For the test set, given u and sequence, for any prediction period s′, the prediction model is used to predict the agricultural product that is most likely to be purchased. As a result of the prediction, it is recommended to a specific user.
[0018] Furthermore, the specific method of constructing the utility function of user u purchasing commodity i in period s in step (2) is:
[0019] (2.1) Define w s,u,i It is used to quantify the user's willingness to purchase fresh products, representing the utility value of user i for fresh product i within the purchase cycle s. For the user's partial utility, it is represented as the potential factor vector p representing the user u and the latent factor vector q representing fresh products i The inner product is as follows:
[0020]
[0021] Among them, p u T Represents the matrix p u The more the user's preference fits the product's characteristics, that is, the more the product conforms to the user's choice habits, the larger its inner product w will be; on the contrary, the less the product conforms to the user's choice preferences, the smaller its utility value w will be;
[0022] (2.2) The consumer behavior sequence of users when purchasing fresh products will reflect the user's purchase preference, which is specifically manifested in two factors: the frequency of the product in the purchase cycle (frequency) and the time interval between click and purchase (recency). Therefore, the user i is designed to estimate the utility of all products in the purchase cycle s in the selection sequence utility function f(s,i). As the second part of the utility function of fresh agricultural products, the two factors of frequency and time interval are combined to give the specific expression of f(s,i):
[0023]
[0024] The operation sequence sq of the user in the purchase cycle s is sorted by time, and its length is N. The positions of sq from the beginning to the end are numbered 1, 2, ..., N. Assuming that the positions of fresh product i form a set p(si), k is the position in this purchase cycle. By calculating f(s, i) of different fresh products, the consumption behavior sequence utility function of user u about all fresh agricultural products browsed, operated, and purchased in the purchase cycle s is obtained, and sorting learning is performed as the second part of the user utility function:
[0025]
[0026] The parameter α is used to adjust the weights of the latent factor utility and the behavior sequence utility. After obtaining the utility of user u purchasing product i in period s, a sensitivity analysis of α will be performed in the embodiment:
[0027] w s,u,i=αp u T q i +(1-α)f(s,i).
[0028] Furthermore, the construction of the fresh agricultural product selection model traversing the purchase cycle described in step (3) is specifically as follows: based on the utility function of different users purchasing fresh product i in cycle s, construct all candidate products i and the user's current purchase product i b The selection model (loss function) between them has an optimization goal of traversing all purchase cycles S so that the utility difference between the final purchased fresh product and the remaining alternative products is minimized.
[0029] This model takes all alternative commodities into consideration and has better prediction accuracy.
[0030]
[0031] Substituting the utility function into the selection model, it is expanded as follows:
[0032]
[0033] in, It is a regularization term used to prevent overfitting. λ needs to be obtained through repeated experiments according to the application scenario.
[0034] Furthermore, the specific method of solving the constructed fresh agricultural product selection model by using the gradient descent method in step (4) is as follows: the fresh agricultural product selection model established in the above step is solved by using the gradient descent method, and p u and q i Perform alternating optimization to obtain the prediction result with the minimum prediction error. First, u and q i Derivatives are taken separately, and we get:
[0035]
[0036] in
[0037] P u and q i Perform alternating optimization, namely:
[0038]
[0039] Among them, η represents the step size, which can be dynamically adjusted through the experimental iteration process.
[0040] After iteration, the model obtains the feature matrix of users and fresh products (p u ,q i), the multiplication of the two can be used to obtain the user's preference (utility) for fresh products. For any user u, the utility value w of product i in the prediction period s′ is s′,u,i =αp u T q i +(1-α)f(s,i) is the product that the user is most likely to buy in this purchase cycle, and is recommended as a result of the prediction. On the one hand, this model takes into account the seasonal characteristics of fresh products, chooses to make predictions and recommendations within a specific purchase cycle, and mines the complex characteristics of fresh products through the idea of latent semantic models, which is more in line with the particularity of fresh products compared to other types of products. In addition, compared with the traditional single model, this model contains two parts: the utility based on the latent semantic model and the utility based on the user's online selection sequence. It integrates the customer's selection behavior information and product feature preferences for fresh products. On the one hand, it can alleviate the cold start problem caused by the sparsity of product data and user data. On the other hand, the model compares all products in the purchase cycle, further improving the prediction accuracy.
[0041] Furthermore, in step (5), in the test set, according to the utility value calculated by the fresh product selection model based on latent semantics and selection sequence, the top 3 fresh agricultural products with the highest product utility are selected as the recommendation results. The recall rate (Recall) and precision (Precision) in the machine learning evaluation index are selected as the indicators to measure the effect of this model, and their formulas are:
[0042]
[0043] Among them, TP is the number of fresh products predicted to be purchased, FP is the number of fresh products predicted to be purchased but not actually purchased (false positives), and FN is the number of fresh products predicted not to be purchased but actually purchased (false negatives).
[0044] In order to verify the prediction effect of the proposed model, this paper selected three methods based on user K nearest neighbor (KNN), gradient boosted decision tree (GBDT), and logistic regression (LR) for comparative experiments, and compared their recall and precision results respectively.
[0045] Beneficial effects: Compared with the existing technical methods, the present invention combines factors such as the seasonal characteristics of agricultural products, introduces the product purchase cycle, models the customer's selection behavior within the cycle, and integrates the latent semantic model to incorporate the prior characteristics of fresh agricultural products into the utility function, thereby solving the problem of customers' understanding of the real-time preference and true purchase intention of fresh agricultural products, and realizing accurate recommendation of agricultural products. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 is an implementation flow chart of the online purchase recommendation method of fresh agricultural products taking into account the consumption behavior and preferences of customers of the present invention;
[0047] Figure 2 This is a statistical analysis chart of the purchase frequency and ranking of fresh products. Figure 2 (a) is a statistical analysis chart of the purchase frequency ranking of fresh products, where Figure 2 (b) is a statistical analysis chart of the purchase ranking of fresh products;
[0048] Figure 3 This is a diagram of the user-product utility matrix based on the latent semantic model;
[0049] Figure 4 is a sensitivity analysis diagram of the parameter α related to recall and precision, where Figure 4 (a) is the analysis chart of accuracy changing with α. Figure 4 (b) is the analysis chart of recall rate changing with α;
[0050] Figure 5 is a comparison chart of the prediction results of the fresh agricultural product recommendation method of the present invention and other methods, wherein Figure 5 (a) is a comparison of the recall rates of the fresh agricultural product recommendation method of the present invention and other methods. Figure 5 (b) is a comparison of the accuracy of the recommended method for fresh agricultural products of the present invention and other methods. DETAILED DESCRIPTION
[0051] The technical solution of the present invention is described more comprehensively and in detail below in conjunction with the accompanying drawings and embodiments of the specification.
[0052] The present invention is based on the user and commodity data of fresh products on the Ali Tianchi Competition website, and constructs an embodiment of a method for online purchase recommendation of fresh agricultural products. The data set is divided into three parts: the first part is the historical behavior of users on commodities, and possible behaviors include click, buy, add-to-cart, and add-to-favorite; the second part is user feature data; and the third part is fresh agricultural product feature data.
[0053] A method for online purchase recommendation of fresh agricultural products based on customer choice behavior analysis, the implementation process is as follows Figure 1 As shown in the figure. First, collect data, perform data analysis and preprocessing; second, construct a fresh agricultural product utility function based on latent semantics and behavioral sequence utility; third, build a fresh agricultural product selection model that traverses the purchase cycle; fourth, use the gradient descent method to solve the constructed fresh agricultural product selection model; fifth, use the recall rate (Recall) and precision (Precision) to evaluate the prediction effect.
[0054] Step 1: Data analysis and preprocessing
[0055] The user set U consisting of all users is expressed as U = {u1, u2, u3, ...}, and the product set I consisting of all products is expressed as I = {i1, i2, i3, ...}.
[0056] Since fresh products have seasonal characteristics, studying the purchasing behavior of users in a specific period will guide merchants to make predictions more accurately. A purchasing cycle s represents the process in which a user makes a purchase after comparison and selection within a certain period of time, which can be expressed as a triple s = (u, sq, i b ), where u∈U represents the user in this purchase cycle; represents the user's product operation sequence in the purchase cycle, i b ∈sq represents the product that the user finally purchased after comparison and selection in this purchase cycle. The set of all purchase cycles is recorded as S = {s1, s2, s3, ...}. A heuristic method is used to divide a purchase cycle, and the user's purchase behavior is used as the dividing point to search forward. If the searched operation record is less than the set threshold, it is classified as a purchase cycle, and the user behavior sequence in different purchase cycles is obtained, such as {a, b, b, b, a, c, d, a, a}.
[0057] Taking the user and product data of fresh products in the Alibaba Tianchi competition as an example, the original data sample is shown in the table below. The data analysis and processing steps include removing low-frequency data, dividing the purchase cycle of fresh products, performing statistical analysis on the frequency (Frequency) and rank (Recency) of fresh products, and dividing the data set.
[0058]
[0059] (1.1) To alleviate the cold start problem, we first remove low-frequency fresh products with a frequency of less than 100. The remaining fresh products account for about 10% and are organized into a historical behavior sequence of users for fresh products during the purchase process.
[0060] (1.2) A heuristic method is used to divide a purchase cycle. Fresh products are different from other commodities. Users generally search and select products and place orders on the day they need them. Through statistical calculations, the average purchase cycle is 2.15 hours. Therefore, the threshold is set to 2 hours. The search is forward from the user's purchase behavior point each time as the dividing point. If the search operation record is less than 2 hours, it is classified as a purchase cycle. This method can obtain user behavior sequences in different purchase cycles. In order to make the model more accurate, purchase cycles with less than 5 user behavior records are removed. Some examples of processed data are as follows:
[0061]
[0062] (1.3) The frequency and recency of fresh products in each purchase cycle are sorted in descending order and statistically analyzed. The analysis results are as follows: Figure 2 The results show that the purchased fresh products are mostly at the top of the frequency and ranking, which verifies the feasibility of using frequency and ranking as influencing factors for constructing a sequential utility function.
[0063] (1.4) The data set is divided into a training set and a test set at a ratio of 70% and 30%. For the training set, the prediction model M is learned; for the test set, when u and sequence are known, for any prediction period s′, the prediction model is used to predict the most likely agricultural product to be purchased, and as the prediction result, it is recommended to a specific user.
[0064] Step 2: Construct a utility function for fresh agricultural products based on latent semantic functions and behavior sequence utility.
[0065] First, define w s,u,i It is used to quantify the user's willingness to purchase fresh products, and represents the utility value of user i for fresh product i within the purchase cycle s. Drawing on the idea of latent factor model, the partial utility of the product to the user is represented as the latent factor vector p representing the user. u and the potential factors (category, origin, brand, price, etc.) representing fresh products. i The inner product is as follows:
[0066]
[0067] The more the user's preferences match the product characteristics, that is, the more the product conforms to the user's selection habits, the larger the inner product w; conversely, the less the product conforms to the user's selection preferences, the smaller the utility value w.
[0068] Secondly, the sequence of users' consumption behaviors when purchasing fresh products will reflect their purchasing preferences, which are specifically manifested in two factors: the frequency of the product in the purchase cycle and the time interval between clicks and purchases. Therefore, the user selection sequence utility function f(s,i) is designed to estimate the utility of all products in the purchase cycle s as the second part of the fresh agricultural product utility function. The specific analysis is as follows.
[0069] (2.1) The frequency of a product in the purchase cycle. The more times a product appears in a purchase cycle sequence, the more likely it is to be purchased. For example, if the product click sequence in the purchase cycle is {a, a, b, b, a, a, a, a}, then the user is more likely to buy product a than product b.
[0070] (2.2) The time interval between click and purchase (recency). In a purchase cycle, the product that the user clicked most recently is more likely to be selected. Assuming that the click sequence of a purchase cycle is {a, a, a, b, c, a, b, b, b, b}, then the purchase probability of product b should be higher than that of product a. This is because after comparing a, b, and c, the user focuses on product b.
[0071] Combining the two factors of frequency and time interval, the specific form of f(s,i) is given:
[0072]
[0073] The operation sequence sq of the user in the purchase cycle s is sorted by time, and its length is N. The positions of sq from the beginning to the end are numbered 1, 2, ..., N. It is assumed that the positions of fresh product i form a set p(si), and k is the position in this purchase cycle. By calculating f(s,i) of different fresh products, the consumption behavior sequence utility function of user u in the purchase cycle s regarding all fresh agricultural products that he browses, operates, and purchases will be obtained, and sorting learning will be performed as the second part of the user utility function.
[0074]
[0075] The parameter α is used to adjust the weights of the latent factor utility and the behavior sequence utility. After obtaining the utility of user u purchasing product i in period s, a sensitivity analysis will be performed on α in the embodiment.
[0076] w s,u,i =αp u T q i +(1-α)f(s,i)
[0077] According to the method for constructing the utility function of fresh agricultural products in step (2) of the invention, the utility function w is constructed by drawing on the idea of latent semantic model (LFM) and integrating the utility of user historical behavior sequence. s,u,i =αp u T q i +(1-α)f(s,i), and the α values were set to 0, 0.2, 0.4, 0.6, 0.8, and 1.0 respectively for the experiments. Figure 3 The schematic diagram of the LFM model is given in Figure 1. The user preference matrix R (user-class) for commodities can be obtained by multiplying the P (user-class) matrix and the Q (class-item) matrix. The larger the product, the more the fresh product meets the user's preference.
[0078] Step 3: Build a fresh produce selection model that traverses the purchase cycle.
[0079] In order to take all alternative products into account in the model, after obtaining the utility functions of different users purchasing fresh product i in period s, a selection model (optimization loss function) between all alternative products and the user's current purchased product is constructed. Its optimization goal is to traverse all purchase cycles and minimize the utility difference between the purchased product and the remaining alternative products:
[0080]
[0081] This model is a selection model established between all candidate products and the current purchased product in the user's purchase cycle, which can be expanded as follows:
[0082]
[0083] in, It is a regularization term used to prevent overfitting. λ needs to be obtained through repeated experiments according to the application scenario.
[0084] Step 4: Use the gradient descent method to solve the constructed fresh agricultural product selection model.
[0085] The gradient descent method is used to solve p u and q i Perform alternating optimization and get:
[0086]
[0087] Among them, η represents the step size, indicating the function
[0088] After iteration, the model obtains the feature matrix of users and fresh products (p u ,q i), the multiplication of the two can be used to obtain the user's preference (utility) for fresh products. For any user u, the utility value w of product i in the prediction period s′ is s′,u,i =αp u T q i +(1-α)f(s,i) is the product that the user is most likely to buy in this purchase cycle, and is recommended as a result of the prediction. On the one hand, this model takes into account the seasonal characteristics of fresh products, chooses to make predictions and recommendations within a specific purchase cycle, and mines the complex characteristics of fresh products through the idea of latent semantic models, which is more in line with the particularity of fresh products compared to other types of products. In addition, compared with the traditional single model, this model contains two parts: the utility based on the latent semantic model and the utility based on the user's online selection sequence. It integrates the customer's selection behavior information and product feature preferences for fresh products. On the one hand, it can alleviate the cold start problem caused by the sparsity of product data and user data. On the other hand, the model compares all products in the purchase cycle, further improving the prediction accuracy.
[0089] According to the method of step (4) of the invention, the step size η is selected to be 0.02, and the regularization parameter λ is set to u =λ i =0.01, the experimental running environment is Intel(R) Core(TM) i5-5200U CPU@2.20GHz RAM:8G, and the gradient descent algorithm is used in the Anaconda environment to solve the unconstrained nonlinear programming model using the python3.7 programming language and the Numpy toolkit. According to the utility value calculated by the fresh product selection model based on latent semantics and selection sequence, the top 3 fresh products with the highest product utility are selected as the prediction results and recommended to specific users.
[0090] Step 5: Use recall and precision to evaluate the prediction effect.
[0091] In the test set, according to the utility value calculated by the fresh product selection model based on latent semantics and selection sequence, the top 3 fresh agricultural products with the highest product utility are selected as the recommendation results. The recall rate (Recall) and precision (Precision) in the machine learning evaluation index are selected as the indicators to measure the effect of this model. The formulas are:
[0092]
[0093] Among them, TP is the number of fresh products predicted to be purchased, FP is the number of fresh products predicted to be purchased but not actually purchased (false positives), and FN is the number of fresh products predicted not to be purchased but actually purchased (false negatives).
[0094] First, we conduct a sensitivity analysis on the parameter α of the utility function, and conduct a purchase prediction experiment on the top 3 fresh products when α takes values of 0, 0.2, 0.4, 0.6, 0.8, and 1.0. The experimental results are shown in the figure. Figure 4 As shown, it can be seen that when α=0.6, the precision and recall rate are the highest and the prediction effect is the best. Therefore, α is set to 0.6 in the comparative experiment.
[0095] The following three machine learning methods are selected to compare with the fresh agricultural product recommendation method proposed in the present invention, and the evaluation indicators proposed in step (5) of the present invention are used for comparison. The specific introduction is as follows:
[0096] (1) User-based K-nearest neighbor (KNN). First, we use the collaborative filtering method to calculate the similarity between customers based on the products they purchased. Then, based on the customer similarity in the test set, we infer the probability of each fresh product being purchased, and measure the likelihood of the product being purchased according to the probability.
[0097] (2) Gradient boosted decision tree (GBDT). The idea of GBDT is to use the information of the negative gradient direction of the loss function to update the current model in each iteration, so as to minimize the loss function and obtain the best prediction result, which can be used for classification and regression. In order to make an effective comparison with the method proposed in this experiment, frequency and recency are used as features, and the fresh products with the highest probability calculated in the purchase cycle are selected as the most predicted products.
[0098] (3) Logistic Regression. Logistic regression is also a machine learning method for solving binary classification problems. This experiment uses frequency and recency as features. Specifically, purchase frequency and relative purchase frequency are used as frequency features, and the last position and relative position of the product in the user selection sequence are used as recency features. The product with the highest probability in the purchase cycle is used as the predicted product.
[0099] By comparing the established fresh produce selection model (FPCM) with the selected comparison methods (KNN, GBDT, LR), the three comparison models of KNN, GBDT, and LR were implemented using python3.7 language and Sklearn toolkit in the Anaconda environment, and the prediction accuracy comparison results were obtained as follows: Figure 5As shown in the figure, it can be seen that the prediction effect of KNN is poor, which may be due to the high similarity of fresh products in the same purchase cycle; using frequency and recency as features, LR and GBDT have relatively good prediction effects; the method proposed in this invention combines the fresh agricultural product selection model of the sequence utility function and the latent semantic utility function, and has the best performance among all indicators because it considers the commodities in all cycles and the two factors of operation frequency and time interval.
[0100] Technical personnel should note that although the present invention has been described according to the above specific implementation methods, the inventive concept of the present invention is not limited to this invention, and any modification using the inventive concept will be included in the scope of protection of this patent.
Claims
1. A method for online recommendation of fresh agricultural products taking into account customer consumption behavior and preferences, characterized in that: The steps include: (1) Data analysis and preprocessing; (2) Constructing the utility function of fresh agricultural products based on latent semantics and behavioral sequence utility; The specific method of constructing the utility function of user u purchasing commodity i in period s in step (2) is: (2.1) Define w s,u,i It is used to quantify the user's willingness to purchase fresh products, representing the utility value of user i for fresh product i within the purchase cycle s. For the user's partial utility, it is represented as the potential factor vector p representing the user u and the latent factor vector q representing fresh products i The inner product is as follows: Among them, p u T Represents the matrix p u The more the user's preference fits the product characteristics, that is, the more the product conforms to the user's choice habits, the larger the inner product w; on the contrary, the less the product conforms to the user's choice preference, the smaller the utility value w; (2.2) The consumer behavior sequence of users when purchasing fresh products will reflect the user's purchase preference, which is specifically manifested in two factors: the frequency of the product in the purchase cycle (frequency) and the time interval between click and purchase (recency). Therefore, the user i is designed to estimate the utility of all products in the purchase cycle s in the selection sequence utility function f(s,i). As the second part of the utility function of fresh agricultural products, the two factors of frequency and time interval are combined to give the specific expression of f(s,i): The operation sequence sq of the user in the purchase cycle s is sorted by time, and its length is N. The positions of sq from the beginning to the end are numbered 1, 2, ..., N. Assuming that the positions of fresh product i form a set p(si), k is the position in this purchase cycle. By calculating f(s, i) of different fresh products, the consumption behavior sequence utility function of user u about all fresh agricultural products browsed, operated, and purchased in the purchase cycle s is obtained, and sorting learning is performed as the second part of the user utility function: The parameter α is used to adjust the weights of the latent factor utility and the behavior sequence utility. After obtaining the utility of user u purchasing product i in period s, a sensitivity analysis of α will be performed in the embodiment: w s,u,i =αp u T q i +(1-α)f(s,i); (3) Constructing a fresh agricultural product selection model that traverses the purchase cycle; the construction of the fresh agricultural product selection model that traverses the purchase cycle in step (3) is specifically as follows: in order to take all alternative commodities into consideration in the model, after obtaining the utility function of different users purchasing fresh product i in cycle s, construct a selection model between all alternative commodities and the user's current purchased commodity, that is, optimize the loss function, and its optimization goal is to traverse all purchase cycles and minimize the utility difference between the purchased commodity and the remaining alternative commodities: This model is a selection model established between all candidate products and the current purchased product in the user's purchase cycle, which can be expanded as follows: in, It is a regularization term used to prevent overfitting. λ needs to be obtained through repeated experiments based on the application scenario. (4) The gradient descent method was used to solve the constructed fresh produce selection model; (5) Use recall and precision to evaluate the prediction effect.
2. The online recommendation method for fresh agricultural products considering customer consumption behavior and preferences according to claim 1 is characterized in that: The step (1) specifically comprises the following steps: (1.1) The user set U consisting of all users is represented by U = {u1,u2,u3,…}, and the product set I consisting of all products is represented by I = {i1,i2,i3,…}. A purchase cycle s represents the process in which a user makes a purchase after comparison and selection within a certain period of time, which is represented by a triple s = (u,sq,i b ), where u∈U represents the user in this purchase cycle; represents the user's product operation sequence in the purchase cycle, i b ∈sq represents the product that the user finally purchased after comparison and selection in this purchase cycle; the set of all purchase cycles is recorded as S = {s1, s2, s3, ...}, (1.2) Remove low-frequency fresh products and organize them into historical behavior sequences of users regarding fresh products during the purchase process; (1.3) Use a heuristic method to divide a purchase cycle, and search forward from each user's purchase behavior as a dividing point. If the searched operation record is less than the set threshold, it is classified as a purchase cycle, and the user behavior sequence in different purchase cycles is obtained; (1.4) Sort the frequency and rank of fresh products in each purchase cycle in descending order and conduct statistical analysis, using the frequency and rank as the basis for constructing the sequence utility function; (1.5) The data set is divided into a training set and a test set in proportion. For the training set, a prediction model M is learned. For the test set, given u and sequence, for any prediction period s′, the prediction model is used to predict the agricultural product that is most likely to be purchased. As a result of the prediction, it is recommended to a specific user.
3. The online recommendation method for fresh agricultural products considering customer consumption behavior and preferences according to claim 1 is characterized in that: The specific method of using the gradient descent method to solve the constructed fresh agricultural product selection model in step (4) is as follows: the fresh agricultural product selection model established in the above step is solved by the gradient descent method, and p u and q i Perform alternating optimization and get: Among them, η represents the step size, indicating the function After iteration, the model obtains the feature matrix of users and fresh products (p u ,q i ), the multiplication of the two can be used to obtain the user's preference (utility) for fresh products; for any user u, the utility value w of product i in the prediction period s′ s′,u,i =αp u T q i The product with the highest +(1-α)f(s,i) is the product that the user is most likely to purchase during this purchase cycle and is recommended as the prediction result.
4. The online recommendation method for fresh agricultural products considering customer consumption behavior and preferences according to claim 1 is characterized in that: In step (5), in the test set, according to the utility value calculated by the fresh product selection model based on latent semantics and selection sequence, the top 3 fresh agricultural products with the highest product utility are selected as the recommendation results; The recall rate (Recall) and precision (Precision) in the machine learning evaluation index are selected as indicators to measure the effect of this model. The formulas are: Among them, TP is the number of fresh products predicted to be purchased, FP is the number of fresh products predicted to be purchased but not actually purchased, that is, false positives, and FN is the number of fresh products predicted not to be purchased but actually purchased, that is, under-reporting.
Citation Information
Patent Citations
Fresh agricultural product recommendation method based on multi-granularity fuzzy data
CN110634051A
