A model and method for analyzing online shopping user data
By building a multi-level and multi-module deep learning network, the problems of insufficient comprehensive extraction of user data analysis and feature generalization in the existing technology are solved, and multi-dimensional analysis and real-time recommendation of online shopping user behavior are realized, which improves user experience and business value.
Patent Information
- Application Number
- CN202411884552.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-08
AI Technical Summary
The existing technology has problems in the analysis of online shopping user data, which is not comprehensive enough feature extraction and insufficient generalization capabilities, making it difficult to meet the merchant's needs for precise marketing and personalized recommendations.
Using multi-level and multi-module deep learning networks, including convolutional neural networks (CNN), recurrent neural networks (RNN), long and short-term memory networks (LSTM) and attention mechanisms, a model that can perform multi-dimensional user behavior analysis through data preprocessing, feature engineering and model optimization is built.
It realizes multi-dimensional analysis of user behavior, updates user portraits and recommendation systems in real time, improves user experience and business value, avoids overfitting, and improves the generalization ability and stability of the model.
Smart Images

Figure CN119784412A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of user analysis, and in particular to an online shopping user data analysis model and method. Background Art
[0002] With the rapid development of e-commerce, the number of online shopping users has increased dramatically, and user behavior data has shown the characteristics of high dimensionality, large scale and dynamic changes. Traditional data analysis methods can no longer meet the needs of merchants for precision marketing and personalized recommendations. Therefore, how to better process complex data, extract valuable user behavior features, and make accurate predictions and recommendations is an issue that needs to be considered.
[0003] After searching, the application scheme of Chinese patent application No. 202410384832.1 discloses a user data analysis method and device based on big data, involving the fields of big data processing and artificial intelligence; including: Step 1: Collect UGC data from various social media platforms, news websites and forums through automated means, Step 2: Clean and organize the collected UGC data, Step 3: Use natural language processing method NLP to extract keywords, sentiment tendency features and theme features from UGC data, Step 4: Use machine learning or deep learning methods to train according to keywords, sentiment tendency features and theme features to build a user data analysis model, Step 5: Use the user data analysis model to classify, sentimentally analyze and extract themes of new UGC data to obtain user data tendencies and hot topic information. The analysis method in the above patent is still insufficient in feature extraction and generalization capabilities, and the analysis of user behavior is not comprehensive enough. Summary of the invention
[0004] The purpose of the present invention is to solve the shortcomings of the prior art and to propose an online shopping user data analysis model and method.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] A data analysis model for online shopping users, the model:
[0007] Data preprocessing stage: Use methods such as data cleaning, missing value processing, and outlier detection to preprocess the original data to improve data quality;
[0008] Feature engineering stage: extract key features through statistical analysis, correlation analysis, principal component analysis (PCA) and other methods, and use one-hot encoding, normalization and other techniques to process the features;
[0009] Model building phase: Build a multi-level, multi-module deep learning network, including but not limited to convolutional neural network (CNN), recurrent neural network (RNN), long short-term memory network (LSTM) and attention mechanism;
[0010] Model training phase: Use back propagation algorithm and gradient descent method to optimize model parameters, and introduce regularization terms to prevent overfitting;
[0011] Model evaluation stage: cross-validation, accuracy, recall, F1 score and other indicators are used to evaluate model performance;
[0012] Model optimization stage: adjust hyperparameters such as network structure, learning rate, batch size, etc. according to the evaluation results, and apply early stopping method, dropout and other technologies to further improve model performance;
[0013] Application deployment phase: Deploy the trained model to the online system, process user data in real time, and output user portraits, consumption predictions, and recommendation lists.
[0014] Preferably: the construction of the model includes the following steps:
[0015] S1: Data preprocessing and feature engineering;
[0016] S11: Data preprocessing: remove irrelevant columns, fill missing values, convert non-numeric data, and ensure data quality; convert numerical features into standard normal distribution to reduce the impact of different dimensions on the model;
[0017] S12: Feature engineering, extracting key features from raw user behavior logs and using model-based feature selection methods or statistical methods to select the most relevant features;
[0018] S2: Model construction;
[0019] S21: Hybrid neural network model construction:
[0020] Input layer: accepts preprocessed feature vectors;
[0021] Multiple hidden layers: including convolutional layers, recurrent layers, and fully connected layers;
[0022] Convolutional layer: One-dimensional convolution can be used to process time series data and identify user behavior patterns;
[0023] Recurrent layer: LSTM or GRU layer, which processes variable-length sequences and captures long-term dependencies;
[0024] Output layer: For regression problems, the output layer is a single neuron, using a linear activation function; for classification problems, the number of neurons in the output layer is equal to the number of categories, and a softmax activation function is used for probability distribution output;
[0025] S3: Model training and optimization;
[0026] S31: Training strategy: Use cross entropy loss for classification problems and mean square error loss for regression problems; In the training strategy, use Adam or RMSprop adaptive learning rate optimizer;
[0027] S32: Regularization and optimization: Apply dropout to the fully connected layer to randomly shut down a certain proportion of neurons to reduce overfitting; monitor the performance of the validation set and stop training when the performance stops improving to prevent overfitting;
[0028] S4: Model evaluation and deployment;
[0029] S41: Evaluation indicators, including:
[0030] Classification tasks: including accuracy, recall, F1 score, ROC-AUC;
[0031] Regression tasks: mean square error, root mean square error, R 2 ;
[0032] S42: Deployment: Export the trained model into a standard format and deploy it to a server or cloud platform; build an API interface to achieve real-time data acquisition, processing, prediction, and result feedback.
[0033] Preferably, in S12, the Gini index in random forest is used to evaluate feature importance:
[0034]
[0035] Among them, p i is the probability of the i-th class sample appearing in node T, and c is the number of classes.
[0036] Preferably: the analysis method based on the online shopping user data analysis model comprises the following steps:
[0037] Step 1: Data preprocessing: Use the sliding window method to smooth user behavior data, reduce the impact of noise, use mean filling or K-nearest neighbor-based methods to handle missing values, and identify and handle outliers through box plots or Z-Score methods;
[0038] Step 2: Feature engineering, using the Pearson correlation coefficient to analyze the correlation between features, select the feature combination with high correlation, apply PCA dimensionality reduction to reduce the computational complexity while retaining important information, perform one-hot encoding on categorical features, and standardize or normalize numerical features;
[0039] Step 3: Model construction: design a hybrid network structure that includes a CNN layer for automatically extracting local features and an RNN layer for capturing sequence information. LSTM units are introduced to solve the problem of long-term dependencies, and the attention mechanism is used to enhance the model's focus on key information.
[0040] Step 4: Model training, using the Adam optimizer to update parameters, setting an appropriate learning rate decay strategy, introducing the L2 regularization term to avoid overfitting, and randomly inactivating some neurons through dropout to improve the generalization ability of the model;
[0041] Step 5: Model evaluation: Use 5-fold cross validation to evaluate model stability and generalization ability, and calculate precision, recall, and F1 score indicators to measure model performance;
[0042] Step 6: Model optimization: adjust the number of network layers and neuron structure parameters according to the cross-validation results, optimize the learning rate and batch size hyperparameters, and terminate the training in time using the early stopping method;
[0043] Step 7: Application deployment: Integrate the trained model into the data system of the e-commerce platform, analyze user behavior data in real time, update user portraits based on model output, adjust the recommendation algorithm, and provide personalized product recommendation services.
[0044] Preferably: in step 1, the mean filling formula is:
[0045]
[0046] Among them, x imputed is the filled value, n is the total number of data points, and m is the number of data points with missing values.
[0047] Preferably: in step 1, outliers are identified by using quartiles and interquartile range (IQR) using a box plot method, specifically:
[0048] Any value less than Q1-1.5×IQR or greater than Q3+1.5×IQR is considered an outlier;
[0049] Q1 = first quartile, Q3 = third quartile, IQR = Q3-Q1
[0050] The lower limit of abnormality = Q1-1.5×IQR, the upper limit of abnormality = Q3+1.5×IQR.
[0051] Preferably: in step 3, the output of the convolutional layer is calculated by the following formula:
[0052]
[0053] Among them, w is the convolution kernel, b is the bias term, and f is the activation function.
[0054] Preferably: in step 3, the RNN layer formula is:
[0055] h t =σ(W hh h t-1 +W xh x t ]+b h )
[0056] y t =W hy h t +b y
[0057] Among them, h t is the hidden state at time step t, x t is the input at time step t, y t is the output at time step t.
[0058] Preferably: in step 3, the gating mechanism of the LSTM unit is:
[0059] Forget Gate:
[0060] f t =σ(W f ·[h t-1 , x t ]+b f )
[0061] Input Gate:
[0062] i t =σ(W i ·[h t-1 , x t ]+b i )
[0063] state:
[0064]
[0065] Status Update:
[0066]
[0067] Input Gate:
[0068] ot =σ(W o ·[h t-1 , x t ]+b o )
[0069] Hidden state:
[0070] h t =o t *tanh(C t )
[0071] Among them, W and b are the weight matrix and bias term respectively, σ is the sigmoid activation function, and tanh is the hyperbolic tangent activation function.
[0072] Preferably: in step 4, a term proportional to the square of the weight is added to the loss function through L2 regularization, and the formula is:
[0073]
[0074] Among them, L0 is the original loss function, w i is the weight and λ is the regularization strength.
[0075] Preferably: in step 4, Dropout randomly closes a part of neurons during training, and its formula is:
[0076] r j ~Bernoulli(p)
[0077] y j =m·(r j ·a i )
[0078] Among them, r j is a Bernoulli random variable, p is the retention probability, m is the amplification factor, a i is the original activation vector.
[0079] The beneficial effects of the present invention are:
[0080] 1. The model of the present invention can perform multi-dimensional user behavior analysis, update user portraits and recommendation systems in real time, and improve user experience and commercial value; by using mean filling, K nearest neighbor filling, box plot and Z-Score methods, it can effectively handle missing values and outliers to ensure data quality; apply PCA dimensionality reduction technology to reduce computational complexity while retaining important information, thereby improving model processing speed and efficiency.
[0081] 2. The present invention combines the hybrid network structure of CNN and RNN to automatically extract local features and capture sequence information, thereby improving the model's ability to analyze and predict complex data; the introduction of L2 regularization terms and Dropout technology effectively avoids overfitting and improves the generalization ability and stability of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] Figure 1 The present invention is a flowchart of an analysis method for an online shopping user data analysis model proposed by the present invention. DETAILED DESCRIPTION
[0083] The technical solution of the present invention is further described in detail below in conjunction with specific implementation methods.
[0084] Embodiment 1:
[0085] A data analysis model for online shopping users, the construction of which includes the following steps:
[0086] S1: Data preprocessing and feature engineering;
[0087] S11: Data preprocessing, through preprocessing operations such as removing irrelevant columns, filling missing values, converting non-numeric data, etc., to ensure data quality; converting numerical features into standard normal distribution to reduce the impact of different dimensions on the model;
[0088] S12: Feature engineering: extract key features from raw user behavior logs (such as clicks, views, favorites, add-to-cart, purchases, etc.), such as user activity, purchase frequency, average order value, etc.; use model-based feature selection methods (such as feature importance evaluation based on random forests) or statistical methods (such as correlation coefficients) to select the most relevant features;
[0089] Among them, the Gini index in random forest is used to evaluate the importance of features:
[0090]
[0091] Among them, p i is the probability of the i-th class sample appearing in node T, and c is the number of classes;
[0092] S2: Model construction;
[0093] S21: Hybrid neural network model construction:
[0094] Input layer: accepts preprocessed feature vectors;
[0095] Multiple hidden layers: including convolutional layers (for automatically learning local patterns, such as click pattern recognition), recurrent layers (for sequence data processing, capturing the time series characteristics of user behavior), and fully connected layers (for final classification or regression tasks);
[0096] Convolutional layer: One-dimensional convolution can be used to process time series data and identify user behavior patterns;
[0097] Recurrent layer: LSTM or GRU layer, which processes variable-length sequences and captures long-term dependencies;
[0098] Output layer: For regression problems (such as consumption amount prediction), the output layer is a single neuron, using a linear activation function; for classification problems (such as click or not click), the number of neurons in the output layer is equal to the number of categories, and the softmax activation function is used for probability distribution output;
[0099] S3: Model training and optimization;
[0100] S31: Training strategy: Use cross entropy loss for classification problems and mean square error loss for regression problems; in the training strategy, use adaptive learning rate optimizers such as Adam or RMSprop;
[0101] S32: Regularization and optimization: Apply dropout to the fully connected layer to randomly shut down a certain proportion of neurons to reduce overfitting; monitor the performance of the validation set and stop training when the performance stops improving to prevent overfitting; use learning rate decay strategies, such as decaying over time or adjusting according to the performance of the validation set;
[0102] S4: Model evaluation and deployment.
[0103] S41: Evaluation indicators, including:
[0104] Classification tasks: including accuracy, recall, F1 score, ROC-AUC;
[0105] Regression task: mean square error (MSE), root mean square error (RMSE), R 2 ;
[0106] S42: Deployment: Export the trained model to a standard format (such as ONNX, TensorFlow Serving) and deploy it to a server or cloud platform; build an API interface to achieve real-time data acquisition, processing, prediction, and result feedback.
[0107] The analysis method based on the online shopping user data analysis model includes the following steps:
[0108] Step 1: Data preprocessing: Use the sliding window method to smooth user behavior data, reduce the impact of noise, use mean filling or K-nearest neighbor-based methods to handle missing values, and identify and handle outliers through box plots or Z-Score methods;
[0109] The mean filling formula is:
[0110]
[0111] Among them, x imputed is the filled value, n is the total number of data points, and m is the number of data points containing missing values;
[0112] Among them, the box plot method is used to identify outliers through quartiles and interquartile range (IQR), specifically:
[0113] Any value less than Q1-1.5×IQR or greater than Q3+1.5×IQR is considered an outlier;
[0114] Q1 = first quartile, Q3 = third quartile, IQR = Q3-Q1
[0115] Abnormal lower limit = Q1-1.5×IQR, abnormal upper limit = Q3+1.5×IQR;
[0116] Step 2: Feature engineering: Use the Pearson correlation coefficient to analyze the correlation between features, select the feature combination with high correlation, apply PCA dimensionality reduction to reduce the computational complexity while retaining important information, perform one-hot encoding on categorical features, and standardize or normalize numerical features;
[0117] Step 3: Model construction: design a hybrid network structure that includes a CNN layer for automatically extracting local features and an RNN layer for capturing sequence information. LSTM units are introduced to solve the problem of long-term dependencies, and the attention mechanism is used to enhance the model's focus on key information.
[0118] Among them, the output of the convolutional layer is calculated by the following formula:
[0119]
[0120] Among them, w is the convolution kernel, b is the bias term, and f is the activation function;
[0121] Among them, the RNN layer formula adopts:
[0122] h t =σ(W hh h t-1 +W xh x t ]+b h )
[0123] y t =W hy h t +b y
[0124] Among them, h t is the hidden state at time step t, x t is the input at time step t, y t is the output at time step t;
[0125] Among them, the gating mechanism of the LSTM unit is:
[0126] Forget Gate:
[0127] f t =σ(W f ·[h t-1 , x t ]+b f )
[0128] Input Gate:
[0129] i t =σ(W i ·[h t-1 , x t ]+b i )
[0130] state:
[0131]
[0132] Status Update:
[0133]
[0134] Input Gate:
[0135] o t =σ(W o ·[h t-1 , x t ]+b o )
[0136] Hidden state:
[0137] h t =o t *tanh(C t )
[0138] Among them, W and b are weight matrix and bias term respectively, σ is sigmoid activation function, and tanh is hyperbolic tangent activation function;
[0139] Step 4: Model training, using the Adam optimizer to update parameters, setting an appropriate learning rate decay strategy, introducing the L2 regularization term to avoid overfitting, and randomly inactivating some neurons through dropout to improve the generalization ability of the model;
[0140] Among them, a term proportional to the square of the weight is added to the loss function through L2 regularization, and the formula is:
[0141]
[0142] Among them, L0 is the original loss function, w i is the weight, λ is the regularization strength;
[0143] Among them, Dropout randomly closes some neurons during the training process, and its formula is:
[0144] r j ~Bernoulli(p)
[0145] y j =m·(r j ·a i )
[0146] Among them, r j is a Bernoulli random variable, p is the retention probability, m is the amplification factor, a i is the original activation vector;
[0147] Step 5: Model evaluation: Use 5-fold cross validation to evaluate model stability and generalization ability, and calculate indicators such as precision, recall, and F1 score to measure model performance;
[0148] Step 6: Model optimization: adjust the structural parameters such as the number of network layers and the number of neurons according to the cross-validation results, optimize the hyperparameters such as the learning rate and batch size, and terminate the training in time using the early stopping method;
[0149] Step 7: Application deployment: Integrate the trained model into the data system of the e-commerce platform, analyze user behavior data in real time, update user portraits based on model output, adjust the recommendation algorithm, and provide personalized product recommendation services.
[0150] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. An online shopping user data analysis model, characterized in that: The construction of the model includes the following steps: S1: Data preprocessing and feature engineering; S11: Data preprocessing: remove irrelevant columns, fill missing values, convert non-numeric data, and ensure data quality; convert numerical features into standard normal distribution to reduce the impact of different dimensions on the model; S12: Feature engineering, extracting key features from raw user behavior logs and using model-based feature selection methods or statistical methods to select the most relevant features; S2: Model construction; S21: Hybrid neural network model construction: Input layer: accepts preprocessed feature vectors; Multiple hidden layers: including convolutional layers, recurrent layers, and fully connected layers; Convolutional layer: One-dimensional convolution can be used to process time series data and identify user behavior patterns; Recurrent layer: LSTM or GRU layer, which processes variable-length sequences and captures long-term dependencies; Output layer: For regression problems, the output layer is a single neuron, using a linear activation function; for classification problems, the number of neurons in the output layer is equal to the number of categories, and a softmax activation function is used for probability distribution output; S3: Model training and optimization; S31: Training strategy: Use cross entropy loss for classification problems and mean square error loss for regression problems; In the training strategy, use Adam or RMSprop adaptive learning rate optimizer; S32: Regularization and optimization: Apply dropout to the fully connected layer to randomly shut down a certain proportion of neurons to reduce overfitting; monitor the performance of the validation set and stop training when the performance stops improving to prevent overfitting; S4: Model evaluation and deployment; S41: Evaluation indicators, including: Classification tasks: including accuracy, recall, F1 score, ROC-AUC; Regression tasks: mean square error, root mean square error, R 2 ; S42: Deployment: Export the trained model into a standard format and deploy it to a server or cloud platform; build an API interface to achieve real-time data acquisition, processing, prediction, and result feedback.
2. The online shopping user data analysis model according to claim 1, characterized in that: In S12, the Gini index in random forest is used to evaluate the importance of features: Among them, p i is the probability of the i-th class sample appearing in node T, and c is the number of classes.
3. The online shopping user data analysis model according to claim 1, characterized in that: The analysis method based on the online shopping user data analysis model includes the following steps: Step 1: Data preprocessing: Use the sliding window method to smooth user behavior data, reduce the impact of noise, use mean filling or K-nearest neighbor-based methods to handle missing values, and identify and handle outliers through box plots or Z-Score methods; Step 2: Feature engineering, using the Pearson correlation coefficient to analyze the correlation between features, select the feature combination with high correlation, apply PCA dimensionality reduction to reduce the computational complexity while retaining important information, perform one-hot encoding on categorical features, and standardize or normalize numerical features; Step 3: Model construction: design a hybrid network structure that includes a CNN layer for automatically extracting local features and an RNN layer for capturing sequence information. LSTM units are introduced to solve the problem of long-term dependencies, and the attention mechanism is used to enhance the model's focus on key information. Step 4: Model training, using the Adam optimizer to update parameters, setting an appropriate learning rate decay strategy, introducing the L2 regularization term to avoid overfitting, and randomly inactivating some neurons through dropout to improve the generalization ability of the model; Step 5: Model evaluation: Use 5-fold cross validation to evaluate model stability and generalization ability, and calculate precision, recall, and F1 score indicators to measure model performance; Step 6: Model optimization: adjust the number of network layers and neuron structure parameters according to the cross-validation results, optimize the learning rate and batch size hyperparameters, and terminate the training in time using the early stopping method; Step 7: Application deployment: Integrate the trained model into the data system of the e-commerce platform, analyze user behavior data in real time, update user portraits based on model output, adjust the recommendation algorithm, and provide personalized product recommendation services.
4. The online shopping user data analysis model according to claim 3, characterized in that: In step 1, the mean filling formula is: Among them, x imputed is the filled value, n is the total number of data points, and m is the number of data points with missing values.
5. The online shopping user data analysis model according to claim 3, characterized in that: In step 1, outliers are identified by using quartiles and interquartile range (IQR) using a box plot method, specifically: Any value less than Q1-1.5×IQR or greater than Q3+1.5×IQR is considered an outlier; Q1 = first quartile, Q3 = third quartile, IQR = Q3-Q1 The lower limit of abnormality = Q1-1.5×IQR, the upper limit of abnormality = Q3+1.5×IQR.
6. The online shopping user data analysis model according to claim 3, characterized in that: In step 3, the output of the convolutional layer is calculated by the following formula: Among them, w is the convolution kernel, b is the bias term, and f is the activation function.
7. The online shopping user data analysis model according to claim 6, characterized in that: In step 3, the RNN layer formula is: h t =σ(W hh h t-1 +W xh x t ]+b h ) y t =W hy h t +b y Among them, h t is the hidden state at time step t, x t is the input at time step t, y t is the output at time step t.
8. The online shopping user data analysis model according to claim 3, characterized in that: In step 3, the gating mechanism of the LSTM unit is: Forget Gate: f t =σ(W f ·[h t-1 ,x t ]+b f ) Input Gate: i t =σ(W i ·[h t-1 ,x t ]+b i ) state: Status Update: Input Gate: the t =σ(W o ·[h t-1 ,x t ]+b o ) Hidden state: h t =o t *tanh(C t ) Among them, W and b are the weight matrix and bias term respectively, σ is the sigmoid activation function, and tanh is the hyperbolic tangent activation function.
9. The online shopping user data analysis model according to claim 3, characterized in that: In step 4, a term proportional to the square of the weight is added to the loss function through L2 regularization, and the formula is: Among them, L0 is the original loss function, w i is the weight and λ is the regularization strength.
10. The online shopping user data analysis model according to claim 3, characterized in that: In step 4, Dropout randomly turns off a portion of neurons during training, and its formula is: r j ~Bernoulli(p) y j =m·(r j ·a i ) Among them, r j is a Bernoulli random variable, p is the retention probability, m is the amplification factor, a i is the original activation vector.
Citation Information
Patent Citations
User data analysis method and device based on big data
CN118210921A