Article recommendation strategy determination method and device, computer equipment and storage medium
By extracting and standardizing the four-dimensional transaction behavior features of target users, and combining SOM and K-means algorithms for cluster analysis, user feature labels are determined and item recommendation strategies are matched. This solves the limitations of traditional recommendation models, achieves accurate segmentation of user groups, and improves the reliability of recommendation strategies.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA TOBACCO ZHEJIANG IND CO LTD
- Filing Date
- 2026-01-23
- Publication Date
- 2026-05-08
AI Technical Summary
Traditional item recommendation models are difficult to meet the requirements of accuracy and differentiation. The K-means algorithm is prone to getting stuck in local optima, and the clustering boundaries of the SOM neural network are fuzzy. Existing recommendation models have high computational complexity and consume a lot of resources, making them difficult to deploy quickly and run in real time.
By extracting four-dimensional transaction behavior features of target users, including the ratio of recent transaction time, transaction frequency, cumulative transaction voucher ratio, and transaction category ratio, and after standardization, a matrix is constructed. A self-organizing map neural network is trained to determine the initial cluster centroids. The K-means algorithm is then used for clustering to determine user feature labels and match item recommendation strategies.
It achieves precise segmentation of user groups, improves the personalization and reliability of item recommendation strategies, solves the problem that the K-means algorithm is sensitive to the initial centroid and is prone to getting trapped in local optima, and improves the accuracy of cluster analysis and the stability of recommendation strategies.
Smart Images

Figure CN121998738A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer device, and storage medium for determining an item recommendation strategy. Background Technology
[0002] With increasingly fierce market competition and diversified user demands for personalized recommendations, traditional experience-based recommendation models are no longer sufficient to meet the needs of accurate push and differentiated recommendation strategies. Currently, the field of item recommendation based on user segmentation faces several technical bottlenecks: the traditional K-means algorithm is sensitive to initial centroids, easily getting trapped in local optima, and its clustering accuracy drops significantly when processing high-dimensional user behavior data, directly affecting the accuracy of user segmentation; while SOM neural networks can effectively maintain the topological structure of user behavior data, the cluster boundaries are fuzzy, making it difficult to directly use for refined recommendation segmentation; existing recommendation segmentation models struggle to support accurate item recommendations; most clustering methods require pre-setting the number of clusters K, and traditional methods relying on experience or trial and error lack objective quantitative basis, resulting in poor stability and weak interpretability of segmentation results, affecting the consistency and reliability of recommendation strategies. Therefore, although existing advanced clustering algorithms have theoretical advantages, their high computational complexity and resource consumption make them difficult to deploy quickly and run in real-time within existing recommendation system architectures. Therefore, improving the accuracy and reliability of item recommendations is a problem that needs to be solved. Summary of the Invention
[0003] Therefore, it is necessary to provide a method, apparatus, computer equipment, and storage medium for determining an item recommendation strategy that can improve the accuracy and reliability of item recommendations, in order to address the aforementioned technical problems.
[0004] Firstly, this application provides a method for determining an item recommendation strategy, the method comprising:
[0005] Based on the historical transaction data of the target user who initiated the item recommendation request, the four-dimensional transaction behavior characteristics of the target user are determined; the four-dimensional transaction behavior characteristics include: the target user's recent transaction time ratio, transaction frequency ratio, cumulative transaction voucher ratio, and transaction category ratio.
[0006] The four-dimensional transaction behavior features are standardized to determine the standardized features, and a standardized matrix is constructed based on the standardized features.
[0007] The initial neural network is trained based on the standardized matrix to determine the target neural network;
[0008] Determine the initial set of cluster centroids based on the weight vector of each grid node in the output layer of the target neural network;
[0009] The initial set of cluster centroids is used as the starting point of the K-means algorithm. The K-means algorithm is used to perform K-means clustering on the normalized matrix to determine the clustering results. The clustering results include the cluster labels of the normalized matrix and the final centroid coordinates of each cluster.
[0010] Based on the clustering results, user feature tags for the target user are determined, and based on the user feature tags, an item recommendation strategy corresponding to the target user is determined.
[0011] In one embodiment, the method for determining the item recommendation strategy further includes:
[0012] The silhouette coefficient method is used to evaluate the standardized matrix and determine the optimal number of clusters;
[0013] Based on the optimal number of clusters, the output layer grid structure of the self-organizing map neural network is determined, thereby constructing the initialization neural network.
[0014] In one embodiment, the silhouette coefficient method is used to evaluate the normalization matrix and determine the optimal number of clusters, including:
[0015] Determine the intra-cluster average distance and inter-cluster minimum average distance of the normalized matrix;
[0016] Based on the average intra-cluster distance and the minimum inter-cluster average distance, determine the silhouette coefficient corresponding to the number of clusters in the normalized matrix;
[0017] The optimal number of clusters is determined based on the average coefficient value of the silhouette coefficients.
[0018] In one embodiment, training the initial neural network based on the normalized matrix to determine the target neural network includes:
[0019] Based on the feature dimensions of the standardized matrix, construct the node weight matrix for the initialization layer of the neural network.
[0020] Determine the Euclidean distance between each standardized feature in the standardized matrix and each node weight vector in the node weight matrix, and determine the target node from the node weight vector based on the Euclidean distance;
[0021] Based on the preset Gaussian neighborhood function and the adaptive learning rate of the initial neural network, the target node and the node weight vector within the neighborhood of the target node are updated to determine the candidate neural network.
[0022] Determine whether the maximum change in the node weight vector in the node weight matrix of the output layer of the candidate neural network is less than or equal to a preset change threshold.
[0023] If so, then the candidate neural network is determined to be the target neural network.
[0024] In one embodiment, the initial set of cluster centroids is used as the starting point for the K-means algorithm. The standardized matrix is then subjected to K-means clustering using the K-means algorithm to determine the clustering results, including:
[0025] The initial set of cluster centroids is used as the starting point of the K-means algorithm. The K-means algorithm is used to determine the nearest centroid of each standardized feature based on the distance between each standardized feature in the standardized matrix and the initial cluster centroid in the initial set of cluster centroids.
[0026] Based on the nearest centroid of each standardized feature, each standardized feature is assigned to the cluster to which the nearest centroid belongs, and the clustering result is determined.
[0027] In one embodiment, determining the user feature tags of the target user based on the clustering results includes:
[0028] Based on the standardized rules and the business definitions corresponding to each feature dimension of the four-dimensional transaction behavior features, the centroid values of the final centroid coordinates of each cluster in each feature dimension are analyzed.
[0029] Based on the centroid value and its absolute value, and the standardized mapping rules preset by the business definition of each feature dimension based on the four-dimensional transaction behavior characteristics, the user feature tags of the target user are determined.
[0030] In one embodiment, based on the historical transaction data of the target user who initiated the item recommendation request, the four-dimensional transaction behavior characteristics of the target user are determined, including:
[0031] Collect historical transaction data of the target user who initiated the item recommendation request, clean the historical transaction data, and determine the valid transaction data; the historical transaction data includes the target user's user identification code, transaction timestamp, name of the traded item, and user transaction voucher;
[0032] Based on valid transaction data, determine the four-dimensional transaction behavior characteristics of target users.
[0033] Secondly, this application also provides an apparatus for determining an item recommendation strategy, the apparatus comprising:
[0034] The four-dimensional feature determination module is used to determine the four-dimensional transaction behavior features of the target user based on the historical transaction data of the target user who initiated the transaction item recommendation request; the four-dimensional transaction behavior features include: the target user's recent transaction time ratio, transaction frequency ratio, cumulative transaction voucher ratio, and transaction category ratio;
[0035] The standardized matrix determination module is used to standardize the four-dimensional transaction behavior features, determine the standardized features, and construct a standardized matrix based on the standardized features.
[0036] The neural network training module is used to train the initial neural network based on the normalized matrix and determine the target neural network;
[0037] The initial cluster centroid determination module is used to determine the initial cluster centroid set based on the weight vector of each grid node in the output layer of the target neural network.
[0038] The centroid coordinate determination module is used to take the initial cluster centroid set as the starting point of the K-means algorithm, perform K-means clustering on the normalized matrix using the K-means algorithm, and determine the clustering result; the clustering result includes the cluster labels of the normalized matrix and the final centroid coordinates of each cluster;
[0039] The item recommendation strategy determination module is used to determine the user feature tags of the target user based on the clustering results, and determine the item recommendation strategy corresponding to the target user based on the user feature tags.
[0040] Thirdly, this application also provides a computer device, the computer device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0041] Based on the historical transaction data of the target user who initiated the item recommendation request, the four-dimensional transaction behavior characteristics of the target user are determined; the four-dimensional transaction behavior characteristics include: the target user's recent transaction time ratio, transaction frequency ratio, cumulative transaction voucher ratio, and transaction category ratio.
[0042] The four-dimensional transaction behavior features are standardized to determine the standardized features, and a standardized matrix is constructed based on the standardized features.
[0043] The initial neural network is trained based on the standardized matrix to determine the target neural network;
[0044] Determine the initial set of cluster centroids based on the weight vector of each grid node in the output layer of the target neural network;
[0045] The initial set of cluster centroids is used as the starting point of the K-means algorithm. The K-means algorithm is used to perform K-means clustering on the normalized matrix to determine the clustering results. The clustering results include the cluster labels of the normalized matrix and the final centroid coordinates of each cluster.
[0046] Based on the clustering results, user feature tags for the target user are determined, and based on the user feature tags, an item recommendation strategy corresponding to the target user is determined.
[0047] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0048] Based on the historical transaction data of the target user who initiated the item recommendation request, the four-dimensional transaction behavior characteristics of the target user are determined; the four-dimensional transaction behavior characteristics include: the target user's recent transaction time ratio, transaction frequency ratio, cumulative transaction voucher ratio, and transaction category ratio.
[0049] The four-dimensional transaction behavior features are standardized to determine the standardized features, and a standardized matrix is constructed based on the standardized features.
[0050] The initial neural network is trained based on the standardized matrix to determine the target neural network;
[0051] Determine the initial set of cluster centroids based on the weight vector of each grid node in the output layer of the target neural network;
[0052] The initial set of cluster centroids is used as the starting point of the K-means algorithm. The K-means algorithm is used to perform K-means clustering on the normalized matrix to determine the clustering results. The clustering results include the cluster labels of the normalized matrix and the final centroid coordinates of each cluster.
[0053] Based on the clustering results, user feature tags for the target user are determined, and based on the user feature tags, an item recommendation strategy corresponding to the target user is determined.
[0054] The method, apparatus, computer equipment, and storage medium for determining the aforementioned item recommendation strategy determine the four-dimensional transaction behavior characteristics of the target user based on their historical transaction data. These characteristics include: the target user's recent transaction time ratio, transaction frequency ratio, cumulative transaction voucher ratio, and transaction category ratio. The four-dimensional transaction behavior characteristics are standardized to determine standardized features, and a standardized matrix is constructed based on these features. An initial neural network is trained based on the standardized matrix to determine the target neural network. An initial set of cluster centroids is determined based on the weight vector of each grid node in the output layer of the target neural network. Using this initial set of centroids as the starting point for a K-means algorithm, the standardized matrix is clustered using K-means to determine the clustering results. The clustering results include the cluster labels of the standardized matrix and the final centroid coordinates of each cluster. Based on the clustering results, user feature labels for the target user are determined, and the corresponding item recommendation strategy is determined based on these user feature labels. It solves the technical bottlenecks of traditional experience-based recommendation models, which cannot meet the needs of accuracy and differentiation, have high computational complexity and high resource consumption, and are difficult to deploy quickly and run in real time. These bottlenecks directly affect the accuracy of the recommended group segmentation and the consistency and reliability of the recommendation strategy. The above scheme first extracts four-dimensional transaction behavior features from the target user's historical transaction data, including the ratio of recent transaction time, transaction frequency, cumulative transaction vouchers, and transaction category. Then, it standardizes these four-dimensional transaction behavior features and constructs a standardized matrix. Based on this standardized matrix, it trains and initializes a neural network to determine the target neural network. Subsequently, it extracts the weight vector of each grid node in the output layer of the target neural network as the initial set of cluster centroids. This set is used as the starting point for the K-means algorithm to perform cluster analysis on the standardized matrix, obtaining cluster results containing cluster labels and the final centroid coordinates of each cluster. Finally, it determines the user feature labels of the target user based on the cluster results and matches the corresponding item recommendation strategy. By extracting the target user's four-dimensional transaction behavior features and constructing a standardized matrix, combining the SOM neural network and the K-means algorithm for cluster analysis and matching recommendation strategies, it solves the problem of the K-means algorithm being sensitive to the initial centroid and prone to getting trapped in local optima, while also achieving accurate segmentation of the user group, effectively improving the personalization and reliability of the item recommendation strategy. Attached Figure Description
[0055] Figure 1 This is an application environment diagram of a method for determining an item recommendation strategy in one embodiment;
[0056] Figure 2 This is a flowchart illustrating a method for determining an item recommendation strategy in one embodiment;
[0057] Figure 3This is a flowchart illustrating a method for determining a target neural network in one embodiment;
[0058] Figure 4 This is a flowchart illustrating a method for determining clustering results in one embodiment;
[0059] Figure 5 This is a structural block diagram of a device for determining an item recommendation strategy in one embodiment;
[0060] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0062] The method for determining the item recommendation strategy provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on another network server. Server 104 determines the four-dimensional transaction behavior characteristics of the target user who initiated the item recommendation request based on the target user's historical transaction data. These characteristics include: the target user's recent transaction time ratio, transaction frequency ratio, cumulative transaction voucher ratio, and transaction category ratio. The server standardizes these characteristics to determine standardized features and constructs a standardized matrix based on these features. An initial neural network is trained based on the standardized matrix to determine the target neural network. An initial set of cluster centroids is determined based on the weight vector of each grid node in the target neural network's output layer. Using this initial set of centroids as the starting point for a K-means algorithm, the server performs K-means clustering on the standardized matrix to determine the clustering results. These results include the cluster labels of the standardized matrix and the final centroid coordinates of each cluster. Based on the clustering results, the server determines the target user's user feature labels and, based on these labels, determines the corresponding item recommendation strategy. The server then sends the corresponding item recommendation strategy to terminal 102 via a communication network. The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle systems. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0063] In one embodiment, such as Figure 2 As shown, a method for determining an item recommendation strategy is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0064] S210. Based on the historical transaction data of the target user who initiated the transaction item recommendation request, determine the four-dimensional transaction behavior characteristics of the target user.
[0065] The four-dimensional transaction behavior characteristics include: the target user's recent transaction time ratio, transaction frequency ratio, cumulative transaction voucher ratio, and transaction category ratio. There must be at least one target user.
[0066] Historical transaction data refers to raw transaction data collected from core channels such as tobacco company sales terminal systems and membership management systems after the target user initiates a transaction item recommendation request, with the target user's permission. This data includes key fields such as the target user's user identification code, transaction timestamp, transaction item name, and user transaction voucher. The user identification code can be a user membership code. The four-dimensional transaction behavior characteristics, also known as RFMI four-dimensional characteristics, include: the target user's most recent transaction time ratio (the ratio of the number of days since the target user's most recent purchase to the analysis cutoff date to the average number of days for all users); the transaction frequency ratio (the ratio of the number of transactions made by the target user during the analysis period to the average number of transactions made by all users); the cumulative transaction voucher ratio (the ratio of the target user's cumulative transaction vouchers to the average cumulative transaction vouchers made by all users); and the transaction category ratio (the ratio of the number of different product categories purchased by the target user to the average number of product categories purchased by all users).
[0067] For example, based on the historical transaction data of the target user who initiated the item recommendation request, the four-dimensional transaction behavior characteristics of the target user are determined, including:
[0068] Collect historical transaction data of target users who initiate item recommendation requests, clean the historical transaction data, and determine valid transaction data; based on the valid transaction data, determine the four-dimensional transaction behavior characteristics of target users.
[0069] Historical transaction data includes the target user's user identification code, transaction timestamp, name of the traded goods, and user transaction credentials.
[0070] Specifically, historical transaction data of target users who initiated the item recommendation request are collected. First, invalid records are removed through data cleaning to determine valid transaction data. Then, based on the valid transaction data, four-dimensional transaction behavior characteristics of the target users are calculated. These four-dimensional characteristics include: recent transaction time ratio R, transaction frequency ratio F, cumulative transaction voucher ratio M, and transaction category ratio I. This constructs a feature vector that comprehensively reflects the transaction behavior preferences of the target users, providing high-quality data and feature support for subsequent user group segmentation and accurate item recommendation based on SOM (Self-Organizing Map) and K-means algorithms. The K-means algorithm is an unsupervised learning hard clustering algorithm. Its core objective is to divide a given set of n samples into K pre-defined clusters, ensuring high similarity among samples within the same cluster and low similarity between samples in different clusters. Here, n and K are both positive integers.
[0071] The above solution, by collecting and cleaning historical transaction data of target users and constructing a four-dimensional transaction behavior feature vector covering the ratio of recent transaction time, transaction frequency, cumulative transaction voucher ratio, and transaction category ratio, provides highly adaptable data and feature support for subsequent user group segmentation and accurate item recommendation based on SOM and K-means algorithms, effectively improving the accuracy of cluster analysis and the reliability of recommendation strategies.
[0072] S220. Standardize the four-dimensional transaction behavior characteristics, determine the standardized characteristics, and construct a standardized matrix based on the standardized characteristics.
[0073] Specifically, the Z-score standardization method is used to determine the mean and standard deviation of all target user feature values across the four feature dimensions of the four-dimensional transaction behavior features. Then, based on the mean and standard deviation of the user's feature values, the single-dimensional feature values of each user are transformed to determine the standardized features. The standardization calculations for the four dimensions corresponding to the four-dimensional transaction behavior features are completed sequentially to determine the standardized features for each target user. With the target users as rows and the standardized four-dimensional features as columns, the standardized four-dimensional feature vectors of all target users are arranged sequentially to form a standardized matrix with the number of rows equal to the number of users and a fixed number of columns of 4.
[0074] S230. Train the initial neural network based on the standardized matrix to determine the target neural network.
[0075] The initialization neural network is the self-organizing map neural network after initialization.
[0076] For example, methods for determining the initialization of a neural network include:
[0077] The contour coefficient method is used to evaluate the standardization matrix and determine the optimal number of clusters. Based on the optimal number of clusters, the output layer grid structure of the self-organizing map neural network is determined, thereby constructing the initialization neural network.
[0078] Specifically, the range of values for the number of clusters K is predetermined. For each K value within the range, the silhouette coefficients of all standardized features in the standardized matrix are calculated according to formula (1). Then, the average silhouette coefficient value corresponding to each K value is determined, and the K value with the largest average silhouette coefficient is selected as the optimal number of clusters K_opt. Based on the optimal number of clusters, the output layer grid structure of the self-organizing map neural network is determined, thereby constructing the initialization neural network.
[0079] (1).
[0080] Where s(i) is the silhouette coefficient, a(i) is the average distance from normalized feature i to other normalized features in the same cluster, and b(i) is the average distance from normalized feature i to all normalized features in the nearest neighbor cluster.
[0081] For example, the output layer grid structure of the initialized neural network can be a one-dimensional grid of K_opt×1.
[0082] The above scheme ensures that the number of output layer nodes is precisely matched with the optimal clustering requirements, and that the dimension and scale of the initialized neural network weight vector are more in line with the RFMI data feature distribution. This provides a scientific and reasonable network structure foundation for the subsequent SOM training and initial centroid extraction, thereby improving the accuracy and stability of the subsequent hybrid clustering algorithm and enhancing the reliability and interpretability of the user group segmentation results.
[0083] For example, the silhouette coefficient method is used to evaluate the standardized matrix and determine the optimal number of clusters, including:
[0084] Determine the average intra-cluster distance and minimum inter-cluster distance of the normalized matrix; based on the average intra-cluster distance and minimum inter-cluster distance, determine the silhouette coefficients corresponding to the number of clusters in the normalized matrix; based on the average value of the silhouette coefficients, determine the optimal number of clusters.
[0085] The intra-cluster average distance refers to the average distance from the standardized feature to other samples in the same cluster. The inter-cluster minimum average distance refers to the average distance from the standardized feature to all samples in the nearest neighbor cluster.
[0086] Specifically, for the standardization matrix, first calculate the intra-cluster average distance and inter-cluster minimum average distance for each standardized feature in the standardization matrix. Then, based on these two distances, calculate the silhouette coefficient for each sample using the silhouette coefficient formula. After that, for each cluster number K within the preset range of cluster number values, calculate the average coefficient value of the silhouette coefficients of all standardized features under that K value. Finally, select the cluster number with the largest average coefficient value as the optimal cluster number.
[0087] The above scheme can improve the reliability of the optimal number of clusters, thereby improving the accuracy and stability of subsequent SOM and K-means algorithms, enhancing the rationality and interpretability of user group segmentation results, and laying a reliable clustering parameter foundation for accurate item recommendation.
[0088] For example, such as Figure 3 As shown, the method for determining the target neural network may include:
[0089] S2301. Based on the feature dimensions of the standardized matrix, construct the node weight matrix for the initialization of the neural network output layer.
[0090] For example, based on the SOM output layer K_opt×1 one-dimensional grid structure set by the optimal cluster number K_opt, the four-dimensional weight vectors of all nodes in the output layer can be randomly initialized. The initial values are limited to the range of [-1,1], providing initial parameters for subsequent distance calculation and weight update.
[0091] S2302. Determine the Euclidean distance between each standardized feature in the standardized matrix and each node weight vector in the node weight matrix, and determine the target node from the node weight vector based on the Euclidean distance.
[0092] Specifically, iterate through each standardized feature in the standardization matrix. Calculate the Euclidean distance between each standardized feature and the weight vectors of all nodes in the output layer. The output layer node with the smallest Euclidean distance is determined as the target node for that standardized feature. Each standardized feature corresponds to one target node.
[0093] S2303. Based on the preset Gaussian neighborhood function and the adaptive learning rate of the initialized neural network, update the target node and the node weight vector within the target node's neighborhood range to determine the candidate neural network.
[0094] Specifically, in the initial SOM training process based on the optimal clustering number K_opt, for each target node determined by standardized features, the neighborhood range of the target node is defined according to the preset Gaussian neighborhood function. At the same time, the weight update magnitude is adjusted in combination with the adaptive learning rate of the initial neural network, and the weight vectors of the target node and all nodes in its neighborhood range are iteratively updated.
[0095] S2304. Determine whether the maximum change in the node weight vector in the node weight matrix of the output layer of the candidate neural network is less than or equal to a preset change threshold.
[0096] The threshold for the amount of change can be set according to actual needs.
[0097] S2305. If so, then the candidate neural network is determined as the target neural network.
[0098] For example, if the maximum change in the node weight vector in the node weight matrix of the output layer of the candidate neural network is greater than a preset change threshold, the above weight update operation is repeated until the network converges or reaches the preset number of iterations, and finally the candidate neural network that has completed weight optimization is determined as the target neural network.
[0099] The above scheme constructs an initial weight matrix that matches the four-dimensional features of RFMI based on the feature dimensions of the standardized matrix, accurately determines the target node using Euclidean distance, iteratively updates the weights of the target node and its neighboring nodes by combining the Gaussian neighborhood function and adaptive learning rate, and uses whether the maximum change in the weight vector is lower than a threshold as the convergence criterion. This ensures that the weight vector of the trained target neural network can accurately fit the feature distribution of the standardized dataset, laying a reliable model foundation for the subsequent extraction of high-quality initial cluster centroids and improving the accuracy and stability of the SOM and K-means algorithms.
[0100] S240. Determine the initial set of cluster centroids based on the weight vector of each grid node in the output layer of the target neural network.
[0101] It should be noted that the target neural network is a SOM neural network that has undergone weight initialization, target node determination, and neighborhood weight iterative updates, ultimately satisfying the convergence condition or reaching the preset number of iterations. Its output layer grid structure is a K_opt×1 one-dimensional grid based on the optimal clustering number K_opt, with the number of nodes matching the optimal clustering number. During SOM training, the weight vector of each grid node in the output layer is iteratively updated to continuously conform to the feature distribution of the standardized RFMI dataset. After training, these weight vectors possess the ability to represent the features of the data clusters. The set formed by extracting and integrating the weight vectors of these nodes is the initial cluster centroid set C_init.
[0102] S250. Using the initial set of cluster centroids as the starting point of the K-means algorithm, the standardized matrix is clustered using the K-means algorithm to determine the clustering results.
[0103] The clustering results include cluster labels in the normalized matrix and the final centroid coordinates of each cluster.
[0104] For example, such as Figure 4 As shown, the methods for determining the clustering results by performing K-means clustering on the standardized matrix using the K-means algorithm include:
[0105] S2501. The initial set of cluster centroids is used as the starting point of the K-means algorithm. The nearest centroid of each standardized feature is determined by the distance between each standardized feature in the standardized matrix and the initial cluster centroid in the initial set of cluster centroids.
[0106] Specifically, an initial set of cluster centroids is extracted from the output layer of the target SOM neural network. The number of centroids in the initial set is equal to the optimal number of clusters, K_opt. Each centroid is a four-dimensional weight vector matching the RFMI four-dimensional features. This initial set of cluster centroids serves as the starting centroid for the K-means algorithm. Then, each standardized feature in the normalization matrix (i.e., the RFMI four-dimensional normalized feature vector for a single user) is traversed. The Euclidean distance between each standardized feature and all initial centroids in the initial set is calculated. The minimum value is selected from all Euclidean distances, and the initial centroid corresponding to this minimum value is determined as the nearest centroid of that standardized feature. One standardized feature corresponds to one nearest centroid.
[0107] S2502. Based on the nearest centroid of each standardized feature, assign each standardized feature to the cluster to which the nearest centroid belongs, and determine the clustering result.
[0108] Specifically, based on the principle of nearest centroid assignment, each standardized feature is assigned to the cluster to which its nearest centroid belongs. The total number of clusters is K_opt, and each cluster corresponds to an initial cluster centroid. After all standardized features have been assigned, an initial clustering result is formed, which clarifies the cluster labels of the standardized matrix and the final centroid coordinates of each cluster. It should be noted that after clustering, the centroid coordinates of each cluster are the average value of the standardized RFMI feature vectors of all target users in that cluster. Therefore, the value of the centroid in each feature dimension of the four-dimensional transaction behavior feature represents the position of the average level of that typical target user on that feature relative to the average level of all target users.
[0109] The above scheme uses the weight vector extracted from the output layer of the SOM neural network, which matches the optimal cluster number K_opt and conforms to the four-dimensional feature distribution of RFMI, as the initial centroid of K-means. By calculating the Euclidean distance between the standardized features and the initial centroid, the nearest centroid is determined and the sample allocation is completed. This solves the problem that the K-means algorithm is sensitive to the initial centroid and is prone to getting trapped in local optima. At the same time, it makes the clustering results accurately reflect the RFMI feature patterns of different user groups, providing a high-quality basis for subsequent user tag segmentation and personalized item recommendation strategy formulation.
[0110] S260. Based on the clustering results, determine the user feature tags of the target users, and determine the item recommendation strategy corresponding to the target users based on the user feature tags.
[0111] Specifically, based on the final results output by the SOM and K-means algorithms, the centroid coordinates of the four-dimensional transaction behavior features of each cluster are extracted, clarifying the numerical feature patterns of users in each cluster across four dimensions: recent transaction time ratio (R), transaction frequency ratio (F), cumulative transaction voucher ratio (M), and transaction category ratio (I). For example, some clusters exhibit the characteristics of "high R / F / M values and high I value," while others exhibit the characteristics of "high F / I value and moderate R / M value." According to preset labeling rules, the feature patterns of the four-dimensional transaction behavior features of each cluster are mapped one-to-one with user feature labels, assigning a corresponding label to each target user within the cluster; the labeling rules must be strongly correlated with the feature patterns. For example, clusters with "R / F / M / I values all higher than the overall mean" correspond to the "Premium User" label, clusters with "F / I values significantly higher than the mean and R / M values close to the mean" correspond to the "Exploratory User" label, and clusters with "all four-dimensional values lower than the overall mean" correspond to the "Beginner User" label. A mapping library of user feature labels and recommendation strategies can be pre-established, matching differentiated item recommendation strategies to user features with different labels. For example, a priority transaction strategy is matched for premium customers, a combination transaction strategy is matched for exploratory customers, and an entry-level transaction strategy is matched for beginner customers. Ultimately, a personalized item recommendation strategy is determined for each target user that corresponds to their tags.
[0112] For example, determining the user characteristic tags of the target user includes:
[0113] Based on standardized rules and the business definitions corresponding to each feature dimension of the four-dimensional transaction behavior features, the centroid values of the final centroid coordinates of each cluster on each feature dimension are analyzed; based on the centroid values and their absolute values, as well as the standardized mapping rules preset by the business definitions of each feature dimension of the four-dimensional transaction behavior features, the user feature tags of the target users are determined.
[0114] For example, standardized processing rules for four-dimensional transaction behavior characteristics are defined in advance, while the business meaning of each feature dimension is defined. For instance, a higher F value indicates a higher user transaction frequency, a higher M value indicates a user with more accumulated transaction vouchers, a higher R value indicates a more recent transaction time, and a higher I value indicates a more diverse range of user transactions. For each user cluster output by K-means clustering, the centroid values of its final centroid in the four dimensions of R, F, M, and I are extracted, and the absolute values of the centroid values in each dimension are calculated to determine the relative level of users in that cluster in terms of four-dimensional transaction behavior characteristics. For example, a positive value represents higher than the overall user average, a negative value represents lower than the overall user average, and the magnitude of the absolute value represents the degree of deviation from the average. Based on the pre-defined standardized mapping rules, combined with the sign, absolute value, and feature business definition of each cluster's centroid values, target users within the cluster are labeled.
[0115] For example, using the five centroids output by the SOM neural network as the initial centroids for the K-means algorithm, and setting the training parameters to a maximum of 300 iterations and a tolerance of 1e-4, clustering is performed on the standardized user RFMI feature matrix. This ultimately divides users into five groups with different characteristics, ranging in size from 125 to 4459 people, achieving refined stratification of user groups. Specifically, in the final clustering results, Class 0 includes 125 people, Class 1 includes 1067 people, Class 2 includes 4459 people, Class 3 includes 3250 people, and Class 4 includes 1099 people. Based on the RFMI four-dimensional feature centroid coordinates of each cluster, the numerical differences in the core feature dimensions are extracted, assigning precise user feature labels to each user group. For example, the user feature label for Class 0 could be core customers, for Class 1 it could be exploratory customers, for Class 2 it could be regular customers, for Class 3 it could be potential users, and for Class 4 it could be recently active users, completing the transformation from technical clustering results to business-understandable labels. Differentiated marketing strategies are developed based on the characteristic tags of each group, a marketing strategy mapping table is generated and synchronized to the CRM (Customer Relationship Management) system, and targeted product recommendation strategies are matched for users with different tags, thus realizing the connection between technical solutions and business execution.
[0116] The above solution combines standardized rules with the business definition analysis of the centroid coordinates of the clusters based on four-dimensional transaction behavior characteristics. It then determines user feature tags based on the centroid values, their absolute values, and preset standardized mapping rules. This achieves accurate conversion of clustering results into business tags, improves the interpretability of user group segmentation and the rationality of tag matching, and provides a clear and reliable basis for the formulation of differentiated item recommendation strategies.
[0117] The method for determining the above-mentioned item recommendation strategy involves identifying four-dimensional transaction behavior characteristics of the target user based on their historical transaction data. These characteristics include the target user's recent transaction time ratio, transaction frequency ratio, cumulative transaction voucher ratio, and transaction category ratio. The four-dimensional transaction behavior characteristics are then standardized to determine standardized features, and a standardized matrix is constructed based on these features. An initial neural network is trained based on the standardized matrix to determine the target neural network. An initial set of cluster centroids is determined based on the weight vector of each grid node in the output layer of the target neural network. This initial set of centroids is used as the starting point for a K-means algorithm, which performs K-means clustering on the standardized matrix to determine the clustering results. The clustering results include the cluster labels of the standardized matrix and the final centroid coordinates of each cluster. Based on the clustering results, user feature labels for the target user are determined, and the corresponding item recommendation strategy is determined based on these user feature labels. This method solves the technical bottlenecks of traditional experience-based recommendation models, which cannot meet the requirements for accuracy and differentiation, have high computational complexity and resource consumption, and are difficult to deploy quickly and run in real time. These bottlenecks directly affect the accuracy of the recommended user group segmentation and the consistency and reliability of the recommendation strategy. The above scheme first extracts four-dimensional transaction behavior features from the target user's historical transaction data, including the ratio of recent transaction time, transaction frequency, cumulative transaction vouchers, and transaction category. Then, it standardizes these four-dimensional transaction behavior features and constructs a standardized matrix. Based on this standardized matrix, it trains and initializes a neural network to determine the target neural network. Subsequently, it extracts the weight vector of each grid node in the output layer of the target neural network as the initial set of cluster centroids. This set is used as the starting point for the K-means algorithm to perform cluster analysis on the standardized matrix, obtaining cluster results containing cluster labels and the final centroid coordinates of each cluster. Finally, it determines the user feature labels of the target user based on the cluster results and matches the corresponding item recommendation strategy. By extracting the target user's four-dimensional transaction behavior features and constructing a standardized matrix, combining the SOM neural network and the K-means algorithm for cluster analysis and matching recommendation strategies, it solves the problem of the K-means algorithm being sensitive to the initial centroid and prone to getting trapped in local optima, while also achieving accurate segmentation of the user group, effectively improving the personalization and reliability of the item recommendation strategy.
[0118] For example, based on the above embodiments, the method for determining the item recommendation strategy includes:
[0119] Historical transaction data of target users who initiated the item recommendation request was collected. This data included the user's identification code, transaction timestamp, item name, and transaction voucher. First, invalid records were removed through data cleaning to determine valid transaction data. Then, based on this valid data, four-dimensional transaction behavior characteristics of the target user were calculated. These characteristics included: recent transaction time ratio (R), transaction frequency ratio (F), cumulative transaction voucher ratio (M), and transaction category ratio (I). This constructed a feature vector that comprehensively reflects the target user's transaction behavior preferences, providing high-quality data and feature support for subsequent user segmentation and accurate item recommendation based on SOM and K-means algorithms.
[0120] The Z-score standardization method is used to determine the mean and standard deviation of all target user feature values across the four feature dimensions of the four-dimensional transaction behavior features. Then, based on the mean and standard deviation of the user's feature values, the single-dimensional feature values of each user are transformed to determine the standardized features. The standardization calculations for the four dimensions corresponding to the four-dimensional transaction behavior features are completed sequentially to determine the standardized features for each target user. With the target users as rows and the standardized four-dimensional features as columns, the standardized four-dimensional feature vectors of all target users are arranged sequentially to form a standardized matrix with the number of rows equal to the number of users and a fixed number of columns of 4.
[0121] The range of values for the number of clusters K is predetermined. For the normalization matrix, the average intra-cluster distance and the minimum average inter-cluster distance of each normalized feature in the normalization matrix are calculated first. Then, the silhouette coefficient of each sample is calculated based on these two distances using the silhouette coefficient formula. After that, for each number of clusters K within the predetermined range of values for the number of clusters, the average coefficient value of the silhouette coefficients of all normalized features under that K value is calculated. Finally, the number of clusters with the largest average coefficient value is selected as the optimal number of clusters.
[0122] Based on the optimal clustering number K_opt, a K_opt×1 one-dimensional grid structure is established for the output layer of the SOM. The four-dimensional weight vectors of all nodes in the output layer are randomly initialized, with the initial values limited to the range [-1, 1], providing initial parameters for subsequent distance calculations and weight updates. Each standardized feature in the standardized matrix is traversed. The Euclidean distance between each standardized feature and the weight vectors of all nodes in the output layer is calculated, and the output layer node with the smallest Euclidean distance is determined as the target node for that standardized feature. Each standardized feature corresponds to one target node. During the training process of the initialized SOM constructed based on the optimal clustering number K_opt, for each target node determined by the standardized feature, the neighborhood range of the target node is defined according to a preset Gaussian neighborhood function. Simultaneously, the weight update magnitude is adjusted in conjunction with the adaptive learning rate of the initialized neural network, iteratively updating the weight vectors of the target node and all nodes within its neighborhood. It is then determined whether the initialized neural network has been trained successfully; if so, the target neural network is obtained.
[0123] Methods for determining whether the initialization neural network has been trained can include determining whether the number of iterations for iterative training of the initialization neural network is equal to a preset maximum number of iterations. If the number of iterations corresponding to the candidate neural network is the preset maximum number of iterations, then the candidate neural network is determined to be the target neural network.
[0124] A method for determining whether the initialization of the neural network has been completed can also include determining whether the maximum change in the node weight vector in the node weight matrix of the output layer of the candidate neural network is less than or equal to a preset change threshold. If the maximum change in the node weight vector in the node weight matrix of the output layer of the candidate neural network is less than or equal to the preset change threshold, then the candidate neural network is determined to be the target neural network; if the maximum change in the node weight vector in the node weight matrix of the output layer of the candidate neural network is greater than the preset change threshold, then the above weight update operation is repeated until the network converges or reaches the preset number of iterations, and finally the candidate neural network that has completed weight optimization is determined to be the target neural network. The grid structure of the output layer of the target neural network is a K_opt×1 one-dimensional grid based on the optimal number of clusters K_opt, and the number of nodes is consistent with the optimal number of clusters. During the SOM training process, the weight vector of each grid node in the output layer will continuously fit the feature distribution of the standardized RFMI dataset through iterative updates. After training, these weight vectors have the ability to represent the features of the data clusters. The set formed by extracting the weight vectors of these nodes and integrating them is the initial cluster centroid set C_init.
[0125] The initial set of cluster centroids is extracted from the output layer of the target SOM neural network. The number of centroids in the initial set is equal to the optimal number of clusters, K_opt. Each centroid is a four-dimensional weight vector matching the RFMI four-dimensional features. This initial set of centroids serves as the starting centroid for the K-means algorithm. Then, each standardized feature in the normalization matrix (i.e., the RFMI four-dimensional normalized feature vector for a single user) is traversed. The Euclidean distance between each standardized feature and all initial centroids in the initial set is calculated, and the minimum value is selected from all Euclidean distances. The initial centroid corresponding to this minimum value is determined as the nearest centroid of that standardized feature. One standardized feature corresponds to one nearest centroid. Based on the nearest centroid assignment principle, each standardized feature is assigned to the cluster to which its nearest centroid belongs. The total number of clusters is K_opt, and each cluster corresponds to one initial cluster centroid. After all standardized features have been assigned, the initial clustering result is formed, which clarifies the cluster labels of the normalization matrix and the final centroid coordinates of each cluster. It should be noted that after clustering, the centroid coordinates of each cluster are the average of the standardized RFMI feature vectors of all target users in that cluster. Therefore, the value of the centroid in each feature dimension of the four-dimensional transaction behavior features represents the position of the average level of that typical target user in that feature relative to the average level of all target users. Based on the final results output by the SOM and K-means algorithms, the centroid coordinates of the four-dimensional transaction behavior features of each cluster are extracted, clarifying the numerical feature patterns of users in each cluster in the four dimensions of recent transaction time ratio R, transaction frequency ratio F, cumulative transaction voucher ratio M, and transaction category ratio I. The standardization processing rules of the four-dimensional transaction behavior features are defined in advance, and the business meaning of each feature dimension is defined. For example, a higher F value indicates a higher user transaction frequency, a higher M value indicates a more accumulated user transaction voucher, a higher R value indicates a more recent user transaction time, and a higher I value indicates a more diverse range of user transaction categories. For each user cluster output by K-means clustering, the centroid values of its final centroid in the four dimensions R, F, M, and I are extracted. Simultaneously, the absolute values of the centroid values in each dimension are calculated to determine the relative level of users in that cluster in terms of four-dimensional transaction behavior characteristics. For example, a positive value represents above the overall user mean, a negative value represents below the overall user mean, and the magnitude of the absolute value represents the degree of deviation from the mean. Based on pre-defined standardized mapping rules, combined with the sign, absolute value, and feature business definition of each cluster's centroid values, target users within the cluster are labeled. The labeling rules must be strongly correlated with the feature patterns. A user feature label-recommendation strategy mapping library can be pre-established to match differentiated item recommendation strategies for user features with different labels.
[0126] The method for determining the above-mentioned item recommendation strategy involves identifying four-dimensional transaction behavior characteristics of the target user based on their historical transaction data. These characteristics include the target user's recent transaction time ratio, transaction frequency ratio, cumulative transaction voucher ratio, and transaction category ratio. The four-dimensional transaction behavior characteristics are then standardized to determine standardized features, and a standardized matrix is constructed based on these features. An initial neural network is trained based on the standardized matrix to determine the target neural network. An initial set of cluster centroids is determined based on the weight vector of each grid node in the output layer of the target neural network. This initial set of centroids is used as the starting point for a K-means algorithm, which performs K-means clustering on the standardized matrix to determine the clustering results. The clustering results include the cluster labels of the standardized matrix and the final centroid coordinates of each cluster. Based on the clustering results, user feature labels for the target user are determined, and the corresponding item recommendation strategy is determined based on these user feature labels. This method solves the technical bottlenecks of traditional experience-based recommendation models, which cannot meet the requirements for accuracy and differentiation, have high computational complexity and resource consumption, and are difficult to deploy quickly and run in real time. These bottlenecks directly affect the accuracy of the recommended user group segmentation and the consistency and reliability of the recommendation strategy. The above scheme first extracts four-dimensional transaction behavior features from the target user's historical transaction data, including the ratio of recent transaction time, transaction frequency, cumulative transaction vouchers, and transaction category. Then, it standardizes these four-dimensional transaction behavior features and constructs a standardized matrix. Based on this standardized matrix, it trains and initializes a neural network to determine the target neural network. Subsequently, it extracts the weight vector of each grid node in the output layer of the target neural network as the initial set of cluster centroids. This set is used as the starting point for the K-means algorithm to perform cluster analysis on the standardized matrix, obtaining cluster results containing cluster labels and the final centroid coordinates of each cluster. Finally, it determines the user feature labels of the target user based on the cluster results and matches the corresponding item recommendation strategy. By extracting the target user's four-dimensional transaction behavior features and constructing a standardized matrix, combining the SOM neural network and the K-means algorithm for cluster analysis and matching recommendation strategies, it solves the problem of the K-means algorithm being sensitive to the initial centroid and prone to getting trapped in local optima, while also achieving accurate segmentation of the user group, effectively improving the personalization and reliability of the item recommendation strategy.
[0127] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0128] Based on the same inventive concept, this application also provides an apparatus for determining an item recommendation strategy to implement the method for determining an item recommendation strategy described above. The solution provided by this apparatus is similar to the solution described in the above method. Therefore, the specific limitations of one or more embodiments of the apparatus for determining an item recommendation strategy provided below can be found in the limitations of the method for determining an item recommendation strategy described above, and will not be repeated here.
[0129] In one embodiment, such as Figure 5 As shown, a device for determining an item recommendation strategy is provided, comprising: a four-dimensional feature determination module 501, a normalization matrix determination module 502, a neural network training module 503, an initial cluster centroid determination module 504, a centroid coordinate determination module 505, and an item recommendation strategy determination module 506, wherein:
[0130] The four-dimensional feature determination module 501 is used to determine the four-dimensional transaction behavior features of the target user based on the historical transaction data of the target user who initiated the transaction item recommendation request; the four-dimensional transaction behavior features include: the target user's recent transaction time ratio, transaction frequency ratio, cumulative transaction voucher ratio, and transaction category ratio;
[0131] The standardization matrix determination module 502 is used to standardize the four-dimensional transaction behavior features, determine the standardized features, and construct a standardization matrix based on the standardized features.
[0132] The neural network training module 503 is used to train the initial neural network based on the standardized matrix and determine the target neural network;
[0133] The initial cluster centroid determination module 504 is used to determine the initial cluster centroid set based on the weight vector of each grid node in the output layer of the target neural network.
[0134] The centroid coordinate determination module 505 is used to take the initial cluster centroid set as the starting point of the K-means algorithm, perform K-means clustering on the normalized matrix through the K-means algorithm, and determine the clustering result; the clustering result includes the cluster labels of the normalized matrix and the final centroid coordinates of each cluster;
[0135] The item recommendation strategy determination module 506 is used to determine the user feature tags of the target user based on the clustering results, and determine the item recommendation strategy corresponding to the target user based on the user feature tags.
[0136] For example, the device for determining the above-mentioned item recommendation strategy further includes:
[0137] The optimal cluster number determination module is used to evaluate the standardization matrix using the silhouette coefficient method to determine the optimal cluster number; based on the optimal cluster number, the output layer grid structure of the self-organizing map neural network is determined, thereby constructing the initialization neural network.
[0138] For example, the above-mentioned optimal cluster number determination module is further specifically used for:
[0139] Determine the intra-cluster average distance and inter-cluster minimum average distance of the normalized matrix;
[0140] Based on the average intra-cluster distance and the minimum inter-cluster average distance, determine the silhouette coefficient corresponding to the number of clusters in the normalized matrix;
[0141] The optimal number of clusters is determined based on the average coefficient value of the silhouette coefficients.
[0142] For example, the neural network training module 503 is specifically used for:
[0143] Based on the feature dimensions of the standardized matrix, construct the node weight matrix for the initialization layer of the neural network.
[0144] Determine the Euclidean distance between each standardized feature in the standardized matrix and each node weight vector in the node weight matrix, and determine the target node from the node weight vector based on the Euclidean distance;
[0145] Based on the preset Gaussian neighborhood function and the adaptive learning rate of the initial neural network, the target node and the node weight vector within the neighborhood of the target node are updated to determine the candidate neural network.
[0146] Determine whether the maximum change in the node weight vector in the node weight matrix of the output layer of the candidate neural network is less than or equal to a preset change threshold.
[0147] If so, then the candidate neural network is determined to be the target neural network.
[0148] For example, the centroid coordinate determination module 505 is specifically used for:
[0149] The initial set of cluster centroids is used as the starting point of the K-means algorithm. The K-means algorithm is used to determine the nearest centroid of each standardized feature based on the distance between each standardized feature in the standardized matrix and the initial cluster centroid in the initial set of cluster centroids.
[0150] Based on the nearest centroid of each standardized feature, each standardized feature is assigned to the cluster to which the nearest centroid belongs, and the clustering result is determined.
[0151] For example, the item recommendation strategy determination module 506 is specifically used for:
[0152] Based on the standardized rules and the business definitions corresponding to each feature dimension of the four-dimensional transaction behavior features, the centroid values of the final centroid coordinates of each cluster in each feature dimension are analyzed.
[0153] Based on the centroid value and its absolute value, and the standardized mapping rules preset by the business definition of each feature dimension based on the four-dimensional transaction behavior characteristics, the user feature tags of the target user are determined.
[0154] For example, the four-dimensional feature determination module 501 is specifically used for:
[0155] Collect historical transaction data of the target user who initiated the item recommendation request, clean the historical transaction data, and determine the valid transaction data; the historical transaction data includes the target user's user identification code, transaction timestamp, name of the traded item, and user transaction voucher;
[0156] Based on valid transaction data, determine the four-dimensional transaction behavior characteristics of target users.
[0157] The modules in the aforementioned item recommendation strategy determination device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.
[0158] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a method for determining an item recommendation strategy. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or a key vector, trackball, or touchpad set on the computer device casing, or an external key vector disk, touchpad, or mouse, etc.
[0159] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0160] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0161] Step 1: Based on the historical transaction data of the target user who initiated the transaction item recommendation request, determine the four-dimensional transaction behavior characteristics of the target user; the four-dimensional transaction behavior characteristics include: the target user's recent transaction time ratio, transaction frequency ratio, cumulative transaction voucher ratio, and transaction category ratio;
[0162] Step 2: Standardize the four-dimensional transaction behavior features, determine the standardized features, and construct a standardized matrix based on the standardized features;
[0163] Step 3: Train the initial neural network based on the standardized matrix to determine the target neural network;
[0164] Step 4: Determine the initial set of cluster centroids based on the weight vector of each grid node in the output layer of the target neural network;
[0165] Step 5: Using the initial set of cluster centroids as the starting point of the K-means algorithm, perform K-means clustering on the normalized matrix to determine the clustering results; the clustering results include the cluster labels of the normalized matrix and the final centroid coordinates of each cluster;
[0166] Step 6: Based on the clustering results, determine the user feature tags of the target user, and determine the item recommendation strategy corresponding to the target user according to the user feature tags.
[0167] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0168] Step 1: Based on the historical transaction data of the target user who initiated the transaction item recommendation request, determine the four-dimensional transaction behavior characteristics of the target user; the four-dimensional transaction behavior characteristics include: the target user's recent transaction time ratio, transaction frequency ratio, cumulative transaction voucher ratio, and transaction category ratio;
[0169] Step 2: Standardize the four-dimensional transaction behavior features, determine the standardized features, and construct a standardized matrix based on the standardized features;
[0170] Step 3: Train the initial neural network based on the standardized matrix to determine the target neural network;
[0171] Step 4: Determine the initial set of cluster centroids based on the weight vector of each grid node in the output layer of the target neural network;
[0172] Step 5: Using the initial set of cluster centroids as the starting point of the K-means algorithm, perform K-means clustering on the normalized matrix to determine the clustering results; the clustering results include the cluster labels of the normalized matrix and the final centroid coordinates of each cluster;
[0173] Step 6: Based on the clustering results, determine the user feature tags of the target user, and determine the item recommendation strategy corresponding to the target user according to the user feature tags.
[0174] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0175] Step 1: Based on the historical transaction data of the target user who initiated the transaction item recommendation request, determine the four-dimensional transaction behavior characteristics of the target user; the four-dimensional transaction behavior characteristics include: the target user's recent transaction time ratio, transaction frequency ratio, cumulative transaction voucher ratio, and transaction category ratio;
[0176] Step 2: Standardize the four-dimensional transaction behavior features, determine the standardized features, and construct a standardized matrix based on the standardized features;
[0177] Step 3: Train the initial neural network based on the standardized matrix to determine the target neural network;
[0178] Step 4: Determine the initial set of cluster centroids based on the weight vector of each grid node in the output layer of the target neural network;
[0179] Step 5: Using the initial set of cluster centroids as the starting point of the K-means algorithm, perform K-means clustering on the normalized matrix to determine the clustering results; the clustering results include the cluster labels of the normalized matrix and the final centroid coordinates of each cluster;
[0180] Step 6: Based on the clustering results, determine the user feature tags of the target user, and determine the item recommendation strategy corresponding to the target user according to the user feature tags.
[0181] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0182] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0183] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0184] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for determining an item recommendation strategy, characterized in that, include: Based on the historical transaction data of the target user who initiated the item recommendation request, the four-dimensional transaction behavior characteristics of the target user are determined; The four-dimensional transaction behavior characteristics include: the target user's recent transaction time ratio, transaction frequency ratio, cumulative transaction voucher ratio, and transaction category ratio; The four-dimensional transaction behavior features are standardized to determine the standardized features, and a standardized matrix is constructed based on the standardized features. The initial neural network is trained based on the standardized matrix to determine the target neural network; Determine the initial set of cluster centroids based on the weight vector of each grid node in the output layer of the target neural network; The initial set of cluster centroids is used as the starting point of the K-means algorithm. The K-means algorithm is used to perform K-means clustering on the normalized matrix to determine the clustering results. The clustering results include the cluster labels of the normalized matrix and the final centroid coordinates of each cluster. Based on the clustering results, user feature tags for the target user are determined, and based on the user feature tags, an item recommendation strategy corresponding to the target user is determined.
2. The method according to claim 1, characterized in that, Also includes: The silhouette coefficient method is used to evaluate the standardized matrix and determine the optimal number of clusters; Based on the optimal number of clusters, the output layer grid structure of the self-organizing map neural network is determined, thereby constructing the initialization neural network.
3. The method according to claim 2, characterized in that, The silhouette coefficient method is used to evaluate the standardized matrix and determine the optimal number of clusters, including: Determine the intra-cluster average distance and inter-cluster minimum average distance of the normalized matrix; Based on the average intra-cluster distance and the minimum inter-cluster average distance, determine the silhouette coefficient corresponding to the number of clusters in the normalized matrix; The optimal number of clusters is determined based on the average coefficient value of the silhouette coefficients.
4. The method according to claim 2, characterized in that, The step of training the initial neural network based on the standardized matrix to determine the target neural network includes: Based on the feature dimensions of the standardized matrix, construct the node weight matrix for the initialization layer of the neural network; Determine the Euclidean distance between each standardized feature in the standardized matrix and each node weight vector in the node weight matrix, and determine the target node from the node weight vector based on the Euclidean distance; Based on the preset Gaussian neighborhood function and the adaptive learning rate of the initial neural network, the target node and the node weight vector within the neighborhood of the target node are updated to determine the candidate neural network. Determine whether the maximum change in the node weight vector in the node weight matrix of the output layer of the candidate neural network is less than or equal to a preset change threshold. If so, then the candidate neural network is determined to be the target neural network.
5. The method according to claim 1, characterized in that, The step of using the initial set of cluster centroids as the starting point for the K-means algorithm, performing K-means clustering on the standardized matrix using the K-means algorithm, and determining the clustering results includes: The initial set of cluster centroids is used as the starting point of the K-means algorithm. The K-means algorithm is used to determine the nearest centroid of each standardized feature based on the distance between each standardized feature in the standardized matrix and the initial cluster centroid in the initial set of cluster centroids. Based on the nearest centroid of each standardized feature, each standardized feature is assigned to the cluster to which the nearest centroid belongs, and the clustering result is determined.
6. The method according to claim 1, characterized in that, The step of determining the user feature tags of the target user based on the clustering results includes: Based on the standardized rules and the business definitions corresponding to each feature dimension of the four-dimensional transaction behavior features, the centroid values of the final centroid coordinates of each cluster in each feature dimension are analyzed. Based on the centroid value and its absolute value, and the standardized mapping rules preset by the business definition of each feature dimension based on the four-dimensional transaction behavior characteristics, the user feature tags of the target user are determined.
7. The method according to claim 1, characterized in that, The step of determining the four-dimensional transaction behavior characteristics of the target user based on their historical transaction data includes: Collect historical transaction data of the target user who initiated the item recommendation request, clean the historical transaction data, and determine the valid transaction data; the historical transaction data includes the target user's user identification code, transaction timestamp, name of the traded item, and user transaction voucher; Based on valid transaction data, determine the four-dimensional transaction behavior characteristics of target users.
8. A device for determining an item recommendation strategy, characterized in that, The device for determining the item recommendation strategy includes: The four-dimensional feature determination module is used to determine the four-dimensional transaction behavior features of the target user based on the historical transaction data of the target user who initiated the transaction item recommendation request; the four-dimensional transaction behavior features include: the target user's recent transaction time ratio, transaction frequency ratio, cumulative transaction voucher ratio, and transaction category ratio; The standardized matrix determination module is used to standardize the four-dimensional transaction behavior features, determine the standardized features, and construct a standardized matrix based on the standardized features. The neural network training module is used to train the initial neural network based on the normalized matrix and determine the target neural network; The initial cluster centroid determination module is used to determine the initial cluster centroid set based on the weight vector of each grid node in the output layer of the target neural network. The centroid coordinate determination module is used to take the initial cluster centroid set as the starting point of the K-means algorithm, perform K-means clustering on the normalized matrix using the K-means algorithm, and determine the clustering result; the clustering result includes the cluster labels of the normalized matrix and the final centroid coordinates of each cluster; The item recommendation strategy determination module is used to determine the user feature tags of the target user based on the clustering results, and determine the item recommendation strategy corresponding to the target user based on the user feature tags.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.