E-commerce consumer preference prediction method and system based on machine learning
By adopting machine learning-based methods on e-commerce platforms, integrating multi-source data and using GBDT models for joint training, the problem of traditional prediction models being difficult to accurately predict consumers' multiple preferences is solved, and higher prediction accuracy and personalized recommendation effects are achieved.
Patent Information
- Application Number
- CN202510026891.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-05-09
- Estimated Expiration
- Not applicable · inactive patent
Smart Images

Figure CN119963284A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of e-commerce, and more specifically to an e-commerce consumer preference prediction method and system based on machine learning. Background Art
[0002] In e-commerce, understanding consumers' shopping preferences and making personalized recommendations based on these preferences has become an important means for e-commerce platforms to improve conversion rates and enhance consumer satisfaction. However, due to the large number of products on e-commerce platforms and the complexity of consumer behavior, it is not easy to accurately predict consumers' shopping preferences.
[0003] In order to predict consumers' shopping preferences, traditional prediction models mainly rely on structured data, such as star shares (i.e., users' purchasing behavior data on this platform), product attribute values, etc. However, this type of data cannot cover all user behaviors and product information, so the prediction accuracy is limited. Moreover, this prediction method often ignores consumers' behaviors on other social platforms and consumers' subjective feelings about products (such as consumers' comments and ratings). In addition, traditional prediction models can usually only predict a single shopping preference, and cannot handle and predict multiple shopping preferences.
[0004] In recent years, due to the rapid development of deep learning and machine learning technologies, deep learning technologies including word vector representation, convolutional neural network (CNN), long short-term memory network (LSTM) and recurrent neural network (RNN) have achieved remarkable prediction performance on various complex problems. However, in the problem of predicting consumer shopping preferences, these technologies often still have some challenges, such as efficient processing of large amounts of unstructured data and the construction of multi-task prediction models.
[0005] Therefore, under the above background technology, it is of profound significance to propose a method and system for predicting e-commerce consumer preferences based on machine learning. The present invention processes a large amount of unstructured data through machine learning technology, predicts multiple shopping preferences through joint training, effectively improves the accuracy of prediction, and provides more accurate personalized recommendations for e-commerce platforms. Summary of the invention
[0006] The main technical problem solved by the present invention is how to effectively integrate and process multi-source complex data such as consumers' shopping history data, social media behavior data, product reviews and ratings data, and use machine learning algorithms to build prediction models to accurately predict the various shopping preferences of e-commerce consumers and reveal the correlation between preferences, thereby improving the efficiency and effectiveness of personalized recommendations on e-commerce platforms. At the same time, the present invention also solves the problem of evaluating the performance of prediction models by introducing innovative evaluation indicators such as commercial value and consumer satisfaction to more comprehensively evaluate the pros and cons of prediction models.
[0007] In order to achieve the above object, the present invention adopts the following technical solution: the method comprises:
[0008] Data collection: Collect consumers’ shopping history data, social media behavior data, product reviews and ratings data, and page dwell time data;
[0009] Data preprocessing and feature engineering: Use natural language processing techniques to process and standardize unstructured data;
[0010] Build a prediction model: Use machine learning algorithms to conduct joint training to simultaneously predict the various preferences of e-commerce consumers and reveal the correlation between preferences;
[0011] Use innovative indicators to evaluate models: In addition to conventional model evaluation indicators such as accuracy and recall, add innovative indicators from the perspectives of commercial value, consumer satisfaction, etc.
[0012] In one embodiment, the social media behavior data includes consumers' likes, shares, and comments on social platforms.
[0013] In one embodiment, the data preprocessing and feature engineering steps include: word segmentation, stop word removal, and word form restoration.
[0014] In one embodiment, the data preprocessing and feature engineering steps use TF-IDF technology to convert text into numerical features.
[0015] In one embodiment, the prediction model is a Gradient Boosting Decision Trees (GBDT) model;
[0016] (1) Initialize the model: First, use a simple model to initialize the prediction value; select the mean of the target value of the training data as the initial prediction:
[0017]
[0018] Where N is the number of samples, y i is the true value of the i-th sample;
[0019] (2) Iterative training: GBDT gradually approaches the true value through iteration. In each round of iteration, the model trains a new decision tree based on the current prediction error (residual).
[0020] Compute the residual:
[0021] r im =y i -F m-1 (x i)
[0022] Among them, r im is the residual of the i-th sample in the m-th round, Fm- 1 (xi) is the prediction value of the first m-1 trees.
[0023] Fit a new tree: use the current residual r im As the target value, train a new decision tree h m (x);
[0024] (3) Update the model and update the predicted value of the model:
[0025] F m (x) = F m-1 (x)+η·h m (x)
[0026] Here, η is the learning rate, which is used to control the contribution of each tree to the final prediction.
[0027] In one solution, the innovation evaluation indicators include: conversion rate improvement, average order value (AOV), net promoter score (NPS) and user retention rate.
[0028] In one scheme, the joint training has n tasks, the input feature is x, and the output of each task is y i , build a shared base network and add output layers for different tasks on it;
[0029] (1) Shared layers: These layers extract common features of the input, as follows:
[0030] h=f(W·X+b)
[0031] Where W and b are the weights and biases of the shared layer, and f is the activation function ReLU;
[0032] (2) Task-specific layer: Each task i has its own output layer, which is used to predict its specific output:
[0033] y i =g(W i ·h+b i )
[0034] Where W i and b i are the weights and biases of task i, and g is the activation function of the output layer;
[0035] (3) Joint loss function: The total loss is the weighted sum of the losses of each task, and the formula is:
[0036]
[0037] where λ i is the loss weight of task i, L i is the loss function for task i.
[0038] In another aspect, a method and system for predicting e-commerce consumer preferences based on machine learning, wherein the system is applicable to the method described above, and the system comprises:
[0039] Data collection module, data preprocessing and feature engineering module, prediction model module and model evaluation module;
[0040] The data collection module is used to collect and process consumers’ shopping history data, social media behavior data, product reviews and ratings data, and page dwell time data;
[0041] The data preprocessing and feature engineering module uses natural language processing technology to process and standardize the unstructured data collected by the above module;
[0042] The prediction model module uses a machine learning algorithm for joint training and predicts various preferences of e-commerce consumers, analyzing the correlation between preferences;
[0043] The model evaluation module evaluates the prediction model using conventional evaluation indicators such as accuracy and recall rate as well as innovative indicators such as commercial value and consumer satisfaction.
[0044] Beneficial effects of the present invention:
[0045] Improved prediction accuracy: By collecting and processing more comprehensive data, including shopping history, social media behavior, and reviews, and using machine learning algorithms to make predictions, the accuracy of predicting consumer preferences can be improved.
[0046] The method of the present invention can simultaneously predict multiple consumer preferences and reveal the relationship between preferences, providing deeper insights for the recommendation system. By accurately predicting consumer preferences, e-commerce platforms can make more specific personalized recommendations, increase user purchase rates on the platform, and increase user satisfaction. It can be used to more comprehensively evaluate the pros and cons of the prediction model.
[0047] By using the method of the present invention, the e-commerce platform can better understand consumers and improve consumers' loyalty to the platform, thereby gaining an advantage in the fierce market competition. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 is a flow chart of the method of the present invention;
[0049] Figure 2 It is a detailed implementation process flow chart of GBDT of the present invention;
[0050] Figure 3 This is a system block diagram of the present invention. DETAILED DESCRIPTION
[0051] In order to facilitate understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Typical embodiments of the present invention are provided in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described in the present invention. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
[0052] Unless otherwise defined, all technical and scientific terms used in the present invention have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used in the present invention in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Typical embodiments of the present invention are shown in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described in the present invention. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
[0053] like Figure 1 The present invention relates to an e-commerce consumer preference prediction method based on machine learning.
[0054] S1. Data collection: In addition to traditional shopping history data, more dimensional data is added, such as consumer behavior on social media, product reviews and ratings, and the time consumers stay on the page.
[0055] In the process of data collection, we first need to clarify the source and type of data. Traditional shopping history data can usually be obtained from the transaction records of e-commerce platforms, including consumers' purchase records, browsing history, shopping cart information, etc. These data provide direct evidence of consumers' past behavior and are an important basis for preference prediction.
[0056] In order to increase the dimension of data, it is necessary to integrate information from more sources. First of all, social media data is an important supplement. By connecting to the API interface of social media platforms, consumers' behavior data on these platforms, such as likes, shares, comments, etc., can be obtained. This data helps to understand consumers' interests and the influence of their social circles.
[0057] Secondly, product reviews and ratings are an important source of direct feedback from consumers on products. By crawling the review and rating data on e-commerce platforms, we can analyze consumers’ opinions and satisfaction with different products. These data are usually unstructured text and need to be further processed to extract useful information.
[0058] In addition, the time consumers spend on a page can also reflect their interests and concerns. Website analysis tools, such as Google Analytics, can track consumers' stay time on different pages, click paths, etc. These behavioral data can help identify consumers' preferences for certain products or content.
[0059] S2. Data preprocessing and feature engineering: Use natural language processing (NLP) technology to process and standardize unstructured data.
[0060] In the data preprocessing and feature engineering stage, the data collected from various sources first needs to be cleaned and standardized. For structured data, such as shopping history and page dwell time, the processing is relatively straightforward. It is necessary to check the integrity of the data, handle missing values, and normalize or standardize to ensure that different features are compared on the same scale. The commonly used standardization method is Z-score standardization, and the formula is as follows:
[0061]
[0062] Among them, x is the original data, μ is the mean, and σ is the standard deviation.
[0063] For unstructured data, such as social media behavior and product reviews, natural language processing (NLP) technology is needed to process them. First, the text data needs to go through steps such as word segmentation, stop word removal, and word form restoration in order to extract useful information. Then, methods such as Bag of Words, TF-IDF (Term Frequency-Inverse Document Frequency), or Word2Vec can be used to convert the text into numerical features. The formula for TF-IDF is:
[0064] tf-idf(t,d,D)=tf(t,d)×idf(t,D)
[0065] Among them, tf(t,d) is the frequency of term t appearing in document d,
[0066] N is the total number of documents.
[0067] Through the above steps, the data is converted into a standardized feature set, providing high-quality input for subsequent model training. This automated feature extraction method not only improves efficiency, but also enhances the predictive ability of the model.
[0068] S3. Establish a prediction model: Use appropriate machine learning algorithms and joint training to simultaneously predict multiple preferences of consumers in order to understand the correlation between different preferences of consumers. In the stage of establishing a prediction model, you first need to select Gradient Boosting Decision Trees (GBDT). Gradient Boosting Decision Trees (GBDT) is a powerful ensemble learning method that is widely used in regression and classification tasks. By building a series of decision tree models, GBDT gradually improves the prediction ability of the model. In order to have a more comprehensive understanding of the various preferences of consumers, a multi-task learning strategy can be adopted to simultaneously predict multiple related preferences through joint training. This method can not only improve the prediction accuracy, but also reveal the potential correlation between different preferences.
[0069] The following is the detailed implementation process of GBDT.
[0070] like Figure 2 As shown, S301, initialization model: First, use a simple model (such as a constant model) to initialize the prediction value. For regression problems, the mean of the target value of the training data is usually selected as the initial prediction:
[0071]
[0072] Where N is the number of samples, y i is the true value of the i-th sample.
[0073] S302, iterative training: GBDT gradually approaches the true value through iteration. In each round of iteration, the model trains a new decision tree based on the current prediction error (residual).
[0074] Compute the residual:
[0075] r im =y i -F m-1 (x i )
[0076] Among them, r im is the residual of the i-th sample in the m-th round, Fm- 1 (xi) is the prediction value of the first m-1 trees.
[0077] Fit a new tree: use the current residual r im As the target value, train a new decision tree h m (x).
[0078] S303, update the model, update the predicted value of the model:
[0079] Fm (x) = F m-1 (x)+η·h m (x)
[0080] Here, η is the learning rate, which is used to control the contribution of each tree to the final prediction.
[0081] Joint training (multi-task learning)
[0082] Multi-task learning learns multiple related tasks simultaneously by sharing some parameters of the model. Suppose there are n tasks, the input feature is x, and the output of each task is y i , we can build a shared base network and add output layers for different tasks on top of it.
[0083] 1. Shared layers: These layers extract common features of the input, the formula is:
[0084] h=f(W·X+b)
[0085] Where W and b are the weights and biases of the shared layer, and f is the activation function ReLU.
[0086] 2. Task-specific layer: Each task i has its own output layer, which is used to predict its specific output:
[0087] y i =g(W i ·h+b i )
[0088] Where W i and b i are the weights and biases of task i, and g is the activation function of the output layer.
[0089] 3. Joint loss function: The total loss is the weighted sum of the losses of each task, and the formula is:
[0090]
[0091] where λ i is the loss weight of task i, L i is the loss function for task i (such as mean squared error or cross entropy).
[0092] The model parameters are updated through the back-propagation algorithm and optimizer (such as Adam or SGD). The advantage of multi-task learning is that by sharing information, the model can better capture the correlation between tasks, thereby improving the overall prediction performance.
[0093] S4. Use innovative indicators to evaluate models: In addition to conventional evaluation indicators such as accuracy and recall, you can also innovatively evaluate prediction results from the perspectives of business value and consumer satisfaction. In the evaluation of machine learning models, traditional indicators such as accuracy, recall, F1 score, etc., although they can reflect the performance of the model, in commercial applications, relying solely on these indicators may not be able to fully measure the actual value of the model. Therefore, innovative evaluation indicators can help better understand the business impact and user satisfaction of the model. The following is a detailed implementation process and the mathematical formulas involved in how to evaluate the model from the perspectives of business value and consumer satisfaction.
[0094] Implementation process
[0095] 1. Define business value indicators: Based on specific business goals, define business-related indicators. For example, in e-commerce, the following indicators can be used:
[0096] Conversion rate lift*: Whether the prediction model improves the user’s conversion rate from browsing to purchasing.
[0097] Average Order Value (AOV): Does the model affect the amount of money users spend on purchases?
[0098]
[0099]
[0100] 2. Define consumer satisfaction indicators: Evaluate the impact of prediction results on consumer experience. For example:
[0101] Net Promoter Score (NPS): Evaluates user satisfaction with the recommendation system through user feedback questionnaires.
[0102] User retention rate: whether the model improves user retention and activity.
[0103] NPS = Percent Recommenders - Percent Detractors
[0104]
[0105] 3. Data collection and analysis: Collect data related to business value and consumer satisfaction. This may involve obtaining information from multiple sources such as sales data, user behavior logs, customer feedback, etc. Use statistical analysis and data mining techniques to analyze the relationship between the model and these indicators.
[0106] 4. Comprehensive evaluation: Combine traditional model performance indicators with innovative business and consumer indicators to form a comprehensive evaluation report. The evaluation report should include an analysis of the model's performance in different dimensions and its potential impact on business decisions. Comprehensive scoring: You can define a comprehensive scoring function that combines multiple indicators:
[0107] Overall score = w 1 Accuracy + w 2 Conversion rate + w 3 NPS+…
[0108] Among them, w 1 ,w 2 ,w 3 ,…are weights, reflecting the importance of each indicator in the overall evaluation.
[0109] In a business environment, the success of a model depends not only on technical accuracy, but also on its support for business goals and user experience. By innovatively introducing business value and consumer satisfaction indicators, the actual effect of the model can be more comprehensively evaluated. This multi-dimensional evaluation method can help companies find a balance between technology and business goals, so as to make more informed decisions.
[0110] like Figure 3 As shown, a method and system for predicting e-commerce consumer preferences based on machine learning, the system is applicable to the method described above, and the system includes:
[0111] Data collection module, data preprocessing and feature engineering module, prediction model module and model evaluation module;
[0112] The data collection module is used to collect and process consumers’ shopping history data, social media behavior data, product reviews and ratings data, and page dwell time data;
[0113] The data preprocessing and feature engineering module uses natural language processing technology to process and standardize the unstructured data collected by the above module;
[0114] The prediction model module uses a machine learning algorithm for joint training and predicts various preferences of e-commerce consumers, analyzing the correlation between preferences;
[0115] The model evaluation module evaluates the prediction model using conventional evaluation indicators such as accuracy and recall rate as well as innovative indicators such as commercial value and consumer satisfaction.
[0116] Example:
[0117] Assume that an e-commerce platform provides a consumer preference prediction system using the invented method. First, the system collects consumer shopping history data from the platform's database, such as consumer A purchased products 1, 2, and 3, his social media behavior data, such as consumer A liked and forwarded the tweet about product 1, his product comments and rating data, such as consumer A commented that product 1 was of good quality and gave it a five-star rating, and consumer A stayed on the pages of products 1, 2, and 3 for 5 minutes, 2 minutes, and 1 minute respectively.
[0118] Then, the preprocessing module uses natural language processing technology to preprocess the social media behavior data and product review data, such as word segmentation, stop word removal, word form restoration, etc., and uses TF-IDF technology to convert text into numerical features.
[0119] Next, the processed features are input into the prediction model. The GradientBoosting DecisionTrees (GBDT) algorithm is used for training. It also predicts consumers’ purchase intention, collection intention, and possible ratings for other products.
[0120] After the model training is completed, the model is evaluated using conventional evaluation indicators such as accuracy and recall, as well as innovative indicators such as conversion rate improvement, average order value (AOV), net promoter score (NPS) and user retention rate.
[0121] In actual applications, if consumer A browses the page where product 4 is located, the system can predict A's purchase intention, collection intention, and possible rating of the product based on the model, and then make personalized recommendations based on these prediction results. For example, if it is predicted that A has a high purchase intention, then product 4 can be recommended to A.
[0122] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0123] It should be understood that the detailed description of the technical solutions of the present invention by means of the preferred embodiments is illustrative rather than restrictive. A person skilled in the art may modify the technical solutions described in the embodiments, or replace some of the technical features by equivalents, based on reading the specification of the present invention; and these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for predicting e-commerce consumer preferences based on machine learning, characterized by: The method includes: Data collection: Collect consumers’ shopping history data, social media behavior data, product reviews and ratings data, and page dwell time data; Data preprocessing and feature engineering: Use natural language processing techniques to process and standardize unstructured data; Build a prediction model: Use machine learning algorithms to conduct joint training to simultaneously predict the various preferences of e-commerce consumers and reveal the correlation between preferences; Use innovative indicators to evaluate models: In addition to conventional model evaluation indicators such as accuracy and recall, add innovative indicators from the perspectives of commercial value, consumer satisfaction, etc.
2. The method for predicting e-commerce consumer preferences based on machine learning according to claim 1, characterized in that: The social media behavior data includes consumers' likes, shares, and comments on social platforms.
3. The method for predicting e-commerce consumer preferences based on machine learning according to claim 1, characterized in that: The data preprocessing and feature engineering steps include: word segmentation, stop word removal, and word form restoration.
4. The method for predicting e-commerce consumer preferences based on machine learning according to claim 1, characterized in that: The TF-IDF technology is used in the data preprocessing and feature engineering steps to convert text into numerical features.
5. The method for predicting e-commerce consumer preferences based on machine learning according to claim 1, characterized in that: The prediction model is a Gradient Boosting Decision Trees (GBDT) model; (1) Initialize the model: First, use a simple model to initialize the prediction value; select the mean of the target value of the training data as the initial prediction: Where N is the number of samples, y i is the true value of the i-th sample; (2) Iterative training: GBDT gradually approaches the true value through iteration. In each round of iteration, the model trains a new decision tree based on the current prediction error (residual). Compute the residual: r im =y i -F m-1 (x i ) Among them, r im is the residual of the ith sample in the mth round, and Fm-1(xi) is the predicted value of the first m-1 trees. Fit a new tree: use the current residual r im As the target value, train a new decision tree h m (x); (3) Update the model and update the predicted value of the model: F m (x)=F m-1 (x)+η·h m (x) Here, η is the learning rate, which is used to control the contribution of each tree to the final prediction.
6. The method for predicting e-commerce consumer preferences based on machine learning according to claim 1, characterized in that: The innovation evaluation indicators include: conversion rate improvement, average order value (AOV), net promoter score (NPS) and user retention rate.
7. The method for predicting e-commerce consumer preferences based on machine learning according to claim 1, characterized in that: The joint training described above has n tasks, the input feature is x, and the output of each task is y i , build a shared base network and add output layers for different tasks on it; (1) Shared layers: These layers extract common features of the input, as follows: h=f(W·X+b) Where W and b are the weights and biases of the shared layer, and f is the activation function ReLU; (2) Task-specific layer: Each task i has its own output layer, which is used to predict its specific output: y i =g(W i ·h+b i ) Where W i and b i are the weights and biases of task i, and g is the activation function of the output layer; (3) Joint loss function: The total loss is the weighted sum of the losses of each task, and the formula is: where λ i is the loss weight of task i, L i is the loss function for task i.
8. A method and system for predicting e-commerce consumer preferences based on machine learning, wherein the system is applicable to the method according to any one of claims 1 to 7, characterized in that: The system comprises: Data collection module, data preprocessing and feature engineering module, prediction model module and model evaluation module; The data collection module is used to collect and process consumers’ shopping history data, social media behavior data, product reviews and ratings data, and page dwell time data; The data preprocessing and feature engineering module uses natural language processing technology to process and standardize the unstructured data collected by the above module; The prediction model module uses a machine learning algorithm for joint training and predicts various preferences of e-commerce consumers, analyzing the correlation between preferences; The model evaluation module evaluates the prediction model using conventional evaluation indicators such as accuracy and recall rate as well as innovative indicators such as commercial value and consumer satisfaction.