Consumer preference prediction method, system, electronic device, storage product

By introducing cosine similarity to calculate local density and Semi-Convex Hull Tree to filter neighbor points in the DPeak algorithm, cluster centers are automatically selected, solving the problems of high computational complexity and cluster center selection error in the DPeak algorithm under large data volume and high dimensionality, and achieving more efficient and accurate consumer preference prediction.

CN114549062BActive Publication Date: 2026-01-02CHINA AGRI UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210135431.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-14
Publication Date
2026-01-02
Estimated Expiration
2042-02-14

AI Technical Summary

Technical Problem

Existing fast density peak clustering algorithms (DPeak) have high computational complexity under conditions of large data volume and high dimensionality, and there are errors in the selection of cluster centers, which affect the clustering accuracy.

Method used

The local density is calculated based on the cosine similarity between data points and their neighbors. The Semi-Convex Hull Tree algorithm is used to filter neighbor points, and the cluster center is automatically selected by multiplying the local density and the relative distance, thus optimizing the cluster center selection process.

Benefits of technology

It reduces the time complexity of clustering algorithms, improves clustering accuracy and precision, and adapts to changes in data volume and dimensions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114549062B_ABST
    Figure CN114549062B_ABST
Patent Text Reader

Abstract

The application provides a consumer preference prediction method, system, electronic device and storage product, the method comprising: obtaining a plurality of samples containing consumer personal attributes and consumer preference attributes, and taking each sample as a data point; calculating the local density and relative distance of each data point; clustering the data points based on the local density and relative distance; and predicting the corresponding consumer preference attribute based on the consumer personal attribute according to the clustering result; wherein the local density is calculated based on the cosine similarity between the data point and the neighbor point. The local density is calculated based on the cosine similarity between the data point and the neighbor point, which reduces the time complexity caused by the local density calculation of the DPeak clustering algorithm and improves the clustering accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of consumer preference prediction, and particularly relates to a consumer preference prediction method and system, an electronic device and a storage product. BACKGROUND

[0002] The domestic wine sales channel tends to develop in an online and offline combination manner, and customers hope to buy wine suitable for themselves rather than the best wine. Since the wine has rich characteristic attributes, is divided into many categories, and most Chinese consumers do not understand wine, there are problems of not being able to choose, long time consumption, and high trial and error cost when purchasing wine. Therefore, how to accurately and effectively identify the wine drinking preferences of customers and make personalized recommendations in the fierce market competition has important significance for improving customer shopping satisfaction and enterprise performance.

[0003] The analysis of consumer preferences can be achieved by using a clustering algorithm. The fast density peak clustering algorithm (density peak, DPeak) is a simple and efficient clustering algorithm. The algorithm is simple to understand and does not require iterative operations, can find clusters of any shape, is suitable for convex data sets and non-convex data sets, is not sensitive to outliers, and only requires manual input of one parameter. Therefore, the algorithm has received widespread attention due to its simplicity, robustness, wide range of applicable data, and universal characteristics in thought. However, there are two problems in practical application. First, the Euclidean distance of data point pairs needs to be calculated in the process of calculating the local density of each data point, and when the data volume and dimension continue to expand, the time complexity of the algorithm will increase accordingly. Second, there is an error in the selection of clustering centers. The DPeak algorithm selects clustering center points by decision diagram or custom threshold, and neither of these two methods has universality. Manual selection relies on rich domain expert knowledge, and not all users of the algorithm have such knowledge. Incorrect selection of the threshold value can cause non-clustering center points to be established as clustering center points, increasing the error of the algorithm.

[0004] The current method for improving the calculation speed of the DPeak algorithm can be divided into three types of methods based on grid, physics and nearest neighbor. Among them, the grid technology in the cluster method is used to calculate the distance between a small number of non-empty Cell nodes instead of calculating the Euclidean distance between each point, which has a significant computational advantage in high-dimensional sparse data. With the decrease of the degree of data sparseness, the advantage is invalid; the improvement based on physical hardware has a significant improvement in calculation speed, but the hardware investment cost is high, and the efficiency and cost need to be balanced; the method improved based on the idea of nearest neighbor considers the optimization of local density calculation, which improves the distance calculation between the sample point and all points to the distance calculation between the sample point and its neighbor points, reduces the number of distance calculations, and saves time. However, due to the increase of the number of input parameters such as the value of k and other parameters, the accuracy of the algorithm is damaged, and there is no problem of improvement failure due to large data volume in the grid improved algorithm, and there is no problem of large consumption of physical equipment funds, which provides an effective solution for the improvement of algorithm speed; in the selection of clustering center: on the one hand, the characteristics of the sample points are observed from multiple perspectives such as local density, relative distance, judgment of boundary points and error points, and the selection of clustering center is carried out, but still relies on manual screening of decision diagram; or according to the local density or relative distance, the potential clustering center points are screened out, and then the clustering center points are merged according to certain rules for optimization. As long as the rules are in line with the actual problem, the selection problem of clustering center can be optimized. Although these improved methods increase the accuracy of clustering center selection to a certain extent, they consume a certain amount of time and complexity, so the calculation efficiency and accuracy need to be balanced for specific problems, which is the key to the research and improvement of the performance of the fast density peak clustering algorithm. SUMMARY

[0005] The purpose of the present application is to provide a consumer preference prediction method, system, electronic device and storage product, some embodiments can solve the defects of large algorithm error and long time consumption in the prior art, realize the calculation of local density based on the cosine similarity between data points and neighbor points, reduce the time complexity caused by the local density calculation of the DPeak clustering algorithm, and improve the clustering accuracy.

[0006] The consumer preference prediction method provided by the present application comprises:

[0007] Obtaining a plurality of samples containing consumer personal attributes and consumer preference attributes, and taking each sample as a data point;

[0008] Calculate the local density and relative distance of each data point;

[0009] Based on the local density and relative distance, the data points are clustered;

[0010] Based on the clustering result, the corresponding consumption preference attribute is predicted through the consumer personal attribute.

[0011] The local density is calculated based on the cosine similarity of the data point and the neighbor point.

[0012] According to the consumer preference prediction method provided by the application, the neighbor point is obtained based on the Semi-Convex HullTree algorithm.

[0013] According to the consumer preference prediction method provided by the application, the relative distance is calculated based on the cosine similarity between the data point and the nearest data point with a larger local density.

[0014] According to the consumer preference prediction method provided by the application, the data points are clustered based on the local density and the relative distance, including:

[0015] All data points are sorted according to the product of the local density and the relative distance.

[0016] The inflection point is determined, and the data point with a product greater than the inflection point is taken as a clustering center.

[0017] The data points other than the clustering center are assigned to the clustering center with the nearest relative distance to form a class cluster.

[0018] The inflection point is obtained according to the following steps:

[0019] For each data point, the data point is connected with the data point with the maximum product and the data point with the minimum product respectively, and the included angle of the two connecting lines is obtained.

[0020] The data point with the minimum included angle is taken as the inflection point.

[0021] According to the consumer preference prediction method provided by the application, the data points other than the clustering center are assigned to the clustering center with the nearest relative distance before forming a class cluster, including:

[0022] For the data point with a product greater than the inflection point, when the deviation degree of the relative distance of the point to the average relative distance of all data points is greater than the overall standard deviation of the relative distances of all data points, and the local density of the point is less than the median of all local density values, the point is regarded as a noise point of the clustering center and is removed.

[0023] According to the consumer preference prediction method provided by the application, the data points other than the clustering center are assigned to the clustering center with the nearest relative distance to form a class cluster, and then including:

[0024] If the relative distances of two clustering center points are less than the minimum value of the average relative distances of the points in the two class clusters, the two class clusters are merged.

[0025] The application also provides a consumer preference prediction system, which comprises:

[0026] an acquisition module, which acquires a plurality of samples containing consumer personal attributes and consumer preference attributes, and takes each sample as a data point;

[0027] a calculation module, which calculates the local density and relative distance of each data point;

[0028] a clustering module, which clusters the data points based on the local density and relative distance;

[0029] a prediction module, which predicts the corresponding consumer preference attributes through the consumer personal attributes based on the clustering results;

[0030] The local density is calculated based on the cosine similarity between the data point and the neighbor point.

[0031] The application also provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the consumer preference prediction method according to any one of the above when executing the program.

[0032] The application also provides a non-transitory computer readable storage medium, which stores a computer program, and the computer program implements the steps of the consumer preference prediction method according to any one of the above when executed by a processor.

[0033] The application also provides a computer program product, which comprises a computer program, and the computer program implements the steps of the consumer preference prediction method according to any one of the above when executed by a processor.

[0034] The consumer preference prediction method, system, electronic device and storage product provided by the application calculate the local density based on the cosine similarity between the data point and the neighbor point, reduce the time complexity caused by the local density calculation of the DPeak clustering algorithm and improve the clustering accuracy. BRIEF DESCRIPTION OF DRAWINGS

[0035] In order to more clearly illustrate the technical solutions of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0036] Figure 1 A flowchart of a consumer preference prediction method provided by the present application;

[0037] Figure 2 A flowchart of a clustering method for data points based on local density and relative distance provided by the present application is shown in Figure 1.

[0038] Figure 3 A structural diagram of a consumer preference prediction system provided by the present application is shown in Figure 2.

[0039] Figure 4 A structural diagram of an electronic device provided by the present application is shown in Figure 3. DETAILED DESCRIPTION

[0040] To make the objectives, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described below in detail with reference to the accompanying drawings. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.

[0041] The consumer preference prediction method provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings and specific embodiments and application scenarios.

[0042] Figure 1 A flowchart of a consumer preference prediction method provided by the present application is shown in Figure 4. Figure 1 The consumer preference prediction method provided by the present application includes the following steps.

[0043] In step 100, a plurality of samples containing personal attributes and consumption preference attributes of consumers are obtained, and each sample is taken as a data point.

[0044] The data used in the present application is obtained from a survey on the consumption behavior of grape wine customers. The grape wine consumers are taken as the research objects, and the preference behavior of the consumers for grape wine is analyzed. The dispersion and randomness of the samples are fully considered, and the research objects involve different genders, ages, marital statuses, occupations, monthly disposable amounts, educations and nationalities. The sample quota indicators and characteristic values conform to the statistical gender and age distribution. According to the regional economic development situation, different sample sizes are allocated for regional places. The collected statistical data have certain representativeness and can reflect the preference characteristics of grape wine market consumers.

[0045] The effective sample size of the questionnaire is 3621, each sample contains 9 wine consumption preference attributes and 7 personal basic information attributes, the wine consumption preference attributes include 7 internal wine attributes and 2 external wine attributes, clustering modeling is carried out on the 9 sub-type wine preference attributes, the personal basic information data of the consumers in the corresponding categories is analyzed according to the clustering results, and finally the application is applied to the consumers with unknown preferences, and the preferences for the attributes of wine are predicted according to the personal basic information data. Firstly, the sub-type data needs to be preprocessed, which is specifically to carry out numerical coding on the data for the subsequent prediction of customer consumption preferences.

[0046] Step 200, calculate the local density and relative distance of each data point.

[0047] Among them, the local density is calculated based on the cosine similarity between the data points and the neighbor points.

[0048] In the embodiment of the application, the local density and the relative distance are improved and processed, and the mixed data type and the variety of concave-convex characteristics of the category existing in the preference data set of the consumers for the internal attributes and the external attributes of the wine can effectively improve the calculation speed of the classifier according to the characteristics of the consumer preference data.

[0049] The DPeak algorithm is a clustering algorithm proposed by Rodrigue in 2014 without repeated iteration calculation, which can identify any shape data, intuitively find the number of class clusters, easily find abnormal value points, is simple to use and has good robustness, and the basic idea of the algorithm includes that the density of the clustering center should be relatively large, and the clustering center should be far away from the points with larger density, therefore the algorithm proposes two features of local density and relative distance for measuring the clustering center, and after the clustering center is established, the remaining points are divided into the categories of the nearest clustering center one by one. In practical application, the DPeak algorithm also has some shortcomings: the calculation of local density needs to calculate the Euclidean distance between the target point and all the remaining points, and when the data volume is too large, the time complexity will be high; at the same time, the Euclidean distance equates the differences between different attribute indicators or variable dimensions of the sample, but sometimes it cannot meet the actual demand, and cannot well measure the similarity between users, which affects the prediction performance of the clustering algorithm.

[0050] Therefore, the application optimizes the DPeak algorithm based on the above problems.

[0051] The distance metric is optimized to better measure the distance between sample points related to consumers. The original algorithm calculates the local density and relative distance, which involves the Euclidean distance between data points. However, for a dataset related to consumer behavior, the calculation of sample point distance is essentially to better measure user similarity. Geometrically, a line segment in an n-dimensional vector space serves as the base, and the triangle formed by the origin has an uncertain top angle. That is, for two space vectors, even if the distance between two points is constant, the cosine of the angle between them can vary arbitrarily. That is, when the Euclidean distance between two points is constant, the cosine value is not necessarily the same. At this time, the larger the cosine value, the closer the two points. Therefore, in order to better measure the distance between sample points related to consumers, the cosine similarity is used to replace the Euclidean distance to optimize the distance calculation between data points. The cosine similarity can give a better solution to the similarity of data point trends. The specific calculation formula of the cosine similarity is as follows:

[0052]

[0053] where i a represents the a-th dimensional feature of data point i, j a represents the a-th dimensional feature of data point j, and m represents the total of m-dimensional features of the data point.

[0054] Further, according to the improvement of sample point distance measurement and the determination of sample point nearest neighbor, the calculation formula of local density and relative distance of the original DPeak algorithm is updated. The calculation formula of local density of the original DPeak algorithm is as follows:

[0055] p i =∑ i≠j χ(d ij -d C ) (2)

[0056]

[0057] where d ij represents the Euclidean distance from x i to x j , and d C is the specified cutoff distance. Since this formula may result in the same local density for different data points, the DPeak algorithm also sets a Gaussian kernel function to calculate the local density, with the calculation formula as follows:

[0058] The calculation formula of the relative distance of the original DPeak algorithm is as follows:

[0059]

[0060] The calculation formula of the optimized local density is as follows:

[0061]

[0062] wherein, p i denotes the local density of the i-th data point; j denotes the nearest neighbor point of the i-th data point; Sim denotes the cosine similarity between data point i and data point j; d c denotes the cut-off distance of the density peak algorithm; n denotes the number of data samples.

[0063] Step 300, clustering the data points based on the local density and the relative distance.

[0064] After the original data is calculated based on the local density and the relative distance, a selection operation of a clustering center is required. The original DPeak algorithm adopts two ways to select the clustering center, one is to draw a decision graph by taking the local density as the x-axis and the relative distance as the y-axis, and to select the point in the right upper corner of the decision graph with large local density and large relative distance as the clustering center; the other is to define a threshold value, the threshold value is a percentage of the number of sample points, and the points in the threshold value range are selected as the clustering center according to the descending order of the product of the local density and the relative distance. The two ways of selecting the clustering center point by the decision graph or the threshold value do not have universality, the decision graph selection relies on rich field expert knowledge, and the incorrect selection of the threshold value will cause the problem that the non-clustering center point is established as the clustering center point, reduces the algorithm accuracy and increases the algorithm error. The selection of the clustering center directly affects the result of the classification of the remaining points, therefore, the original DPeak algorithm is optimized based on the selection of the clustering center, and the automatic selection of the clustering center is taken as the research target.

[0065] Step 400, predicting the corresponding consumption preference attribute based on the clustering result and the personal attribute of the consumer.

[0066] Based on the clustering result with improved clustering accuracy, the prediction of the consumer's preference for wine can be realized, the prediction accuracy can be improved effectively according to the characteristics of the consumer preference data.

[0067] wherein, the local density is calculated based on the cosine similarity between the data point and the neighbor point.

[0068] In this embodiment, the local density is calculated based on the cosine similarity between the data point and the neighbor point, the time complexity caused by the calculation of the local density of the DPeak clustering algorithm is reduced, and the clustering accuracy is improved.

[0069] Further, in another embodiment, the embodiment provides a consumer preference prediction method, and the neighbor point is obtained based on the Semi-Convex Hull Tree algorithm.

[0070] The consumer behavior data often has the characteristics of multi-attribute, high dimension, large sample quantity, etc. When calculating the local density, the distance between all sample points and the remaining other points needs to be calculated. When the data quantity is larger and the dimension is higher, the time consumed is also longer. The direct calculation of the distance between the target point and all the remaining points without range causes time consumption. Therefore, the nearest neighbor of the target point is found before calculating the local density, and the judgment is made in advance. When the distance from the sample point is too far, it can be directly judged that the point is not included in the local density range of the sample point. Further, when calculating the local density of the sample point, only the K neighbor points are calculated, so as to avoid redundant calculation. Therefore, before calculating the local density of the sample point, the SC HullTree algorithm is introduced to screen the nearest neighbor of the sample point.

[0071] In the embodiment, the Semi-Convex Hull Tree algorithm is introduced to search the K nearest neighbors of the sample point with the shortest distance.

[0072] Further, in another embodiment, the embodiment provides a consumer preference prediction method. The relative distance is calculated based on the cosine similarity between the data point and the nearest data point with larger local density.

[0073]

[0074] wherein, δ i represents the relative distance of the i th data point; Sim represents the cosine similarity between the data point i and the data point j; the relative distance of the i th data point is represented as the distance between the data point i and the data point with the nearest distance to the data point i and larger local density than the data point i.

[0075] In the embodiment, the cosine similarity is introduced to replace the Euclidean distance for measuring the distance between the consumer behavior data points.

[0076] Further, in another embodiment, Figure 2 The flowchart for clustering the data points based on the local density and the relative distance provided by the embodiment is shown in Figure 2 The embodiment provides a consumer preference prediction method. The data points are clustered based on the local density and the relative distance, and the method comprises the following steps:

[0077] Step 310, sorting all the data points according to the product of the local density and the relative distance;

[0078] Step 320, establishing the inflection point, and taking the data point with the product greater than the inflection point as the clustering center;

[0079] Step 330, assigning the data points other than the clustering center to the clustering center with the nearest relative distance to form a class cluster;

[0080] Wherein, the inflection point is obtained according to the following steps:

[0081] For each data point, the data point is connected with the data point with the maximum product and the data point with the minimum product respectively, and the included angle of the two connecting lines is obtained;

[0082] The data point with the minimum included angle is taken as the inflection point.

[0083] According to the characteristics of the data points in the decision graph of the original DPeak algorithm, it can be found that the data points have some characteristics: 1) the category center point is usually located in the upper right corner of the decision graph, usually having a large local density and a large relative distance; 2) the cluster point is usually close to the ρ axis and located in the middle of the decision graph; 3) the outlier point is usually close to the δ axis and located in the upper left part of the decision graph. Therefore, according to the characteristics that the initial clustering center point has a large local density and a large relative distance, the improvement of automatic selection of clustering center is carried out.

[0084] The product of the local density and the relative distance of the clustering center is much larger than that of the cluster point. According to this characteristic, the product of the local density and the relative distance of each data point is calculated, and the product results are arranged in ascending order, and the point with a prominent change in the product value is found as the inflection point meeting the requirements of the initial clustering center. The point with a prominent change represents that the local density and the relative distance of the product increase significantly, which indicates that the inflection point and the data point to the left of the inflection point may have a large local density and a long relative distance, or may have a large local density and a small relative distance, or have a small local density and a large relative distance, and the point to the right of the inflection point does not have any of the above three characteristics. Therefore, the inflection point is an important factor for obtaining the initial clustering center point set. In the embodiment of the application, the inflection point is obtained by formula.

[0085] γ i = ρ i × δ i (8)

[0086] Wherein, γ i is the product of the local density ρ i and the relative distance δ i of the data point i;

[0087] The included angle of the inflection point and the first point γ1 and the tail point γ n is smaller than the included angle of any non-inflection point and the first point γ1 and the tail point γ n , and the corresponding supplementary angle is the largest. In the embodiment of the application, the inflection point is calculated by the following formula:

[0088]

[0089] Wherein, α represents the inflection point of selecting the initial clustering center, The calculation formula is:

[0090]

[0091] Wherein, represents the average change rate of the data point in the [i, j] interval, γ i is the product of the local density ρ i and the relative distance δ i of the data point i.

[0092] The embodiment constructs a candidate cluster center set according to the local density and the relative distance of the sample points, and realizes the automatic selection of the cluster center.

[0093] Further, in another embodiment, the embodiment provides a consumer preference prediction method, which assigns the data points other than the cluster center to the cluster center with the closest relative distance, and the previous includes:

[0094] For the data point with a product greater than the inflection point, when the deviation of the relative distance of the point from the average relative distance of all data points is greater than the overall standard deviation of the relative distances of all data points, and the local density of the point is less than the median of all local density values, the point is regarded as a noise point of the cluster center and is removed.

[0095] The initially selected initial cluster center points include three types of points with larger local density and larger relative distance, larger local density and smaller relative distance, and smaller local density and larger relative distance. The points with smaller local density and larger relative distance are cluster center noise points, so it is necessary to remove the noise points from the initial cluster center set to obtain a candidate cluster center set. It can be found from the decision graph of the original DPeak algorithm that the noise points are located in the upper left part of the graph, close to the δ axis, and these noise points often have lower local density and are located in the middle and left part of the ρ axis. Therefore, the local density and the relative distance are set respectively. When the deviation of the relative distance of the data point from the average relative distance of all data points is greater than the overall standard deviation of the relative distances of all data points, and the local density of the point is less than the median of all local density values, it can be considered that the point has smaller ρ and larger δ, and the data point is further determined as a noise point of the cluster center. The discrimination of the cluster center noise point is formula.

[0096] ρ i <M ρ (11)

[0097] Wherein, M ρ represents the median of all local density values of all data points arranged in sequence.

[0098]

[0099] wherein β represents the deviation of the relative distance of the data point from the average relative distance of the entire data;

[0100]

[0101]

[0102]

[0103] wherein, is the average value of the relative distance of all data points, represents the deviation of the relative distance of the data point i from the average relative distance of all data points, β δ represents the overall standard deviation of the relative distance of all data points.

[0104] After the noise removal operation, the remaining points are the candidate cluster center points, and then the remaining points are assigned to the class cluster of the nearest cluster center, completing the preliminary assignment of the classes.

[0105] The embodiment solves the problem of the initial selected cluster center having a cluster noise point.

[0106] Further, in another embodiment, the embodiment provides a consumer preference prediction method, wherein the data points other than the cluster centers are assigned to the nearest cluster center to form a class cluster, and then the method comprises:

[0107] If the relative distance between two cluster center points is less than the minimum value of the average relative distance of the points in the two class clusters, the two class clusters are merged.

[0108] The candidate cluster center set may include cluster centers that are very close to each other and should be classified into one cluster but are classified into two or more classes by the algorithm, resulting in over-fine classification, class cluster redundancy, and reduced clustering accuracy. Therefore, the points in the candidate cluster center set are merged. In the embodiment of the application, a self-defined constraint condition is used as the merging basis, including:

[0109] If the relative distance between two points is less than the average relative distance of the two points, the two points are defined as cluster center direct points, and the specific formula is as follows:

[0110]

[0111] wherein k represents the total number of points in the class to which the cluster center point m belongs; μ m represents the average relative distance between the point m in the cluster center set and other points in the class of the point m;

[0112] H(i,j) < min(μ i ,μ j ) (17)

[0113] wherein H(i,j) represents the relative distance between i point and j point in the candidate cluster center set; μ i is the average of the relative distance of all points in the class with i point as the cluster center, and μ j is obtained in the same way, if i point and j point in the candidate cluster center set satisfy H(i,j) < min(μ i ,μ j ), then the two points are cluster center direct points, when two cluster centers belong to cluster center direct points, it is indicated that the relative distance of the two cluster center points is less than the minimum of the average relative distance of the points in the two classes, therefore, the two cluster centers can be merged, and the overall optimization ability and optimization precision of the algorithm are improved.

[0114] In addition, there is an indirect reachable relationship between the cluster center direct points, from a cluster center point, by means of the cluster center reachable feature, a cluster maximum region containing the cluster center and other cluster centers can be obtained by constantly expanding outward, and the similarity between the data points in the region is the highest. Among them, the cluster center reachable point is defined as if there are cluster center points P1, P2...P n , P1=i, P n =j, P u is clustered by P u-1 , wherein u is in (i,j), and j is reachable by i cluster center. Further, if the two points are indirectly reachable or reachable points, the two points can be merged into the same class, and the class redundancy of clustering is reduced.

[0115] The embodiment constructs a candidate cluster center set according to the local density and relative distance features of the sample points, and adopts the cluster center direct point and cluster center reachable point rules to merge the candidate cluster centers, so that the automatic selection of the cluster centers is realized.

[0116] The consumer preference prediction system provided by the present application is described below, and the consumer preference prediction system described below can be correspondingly referred to the consumer preference prediction method described above.

[0117] Figure 3 The structure schematic diagram of the consumer preference prediction system provided by the present application is shown in FIG. 1, the consumer preference prediction system provided by the present application comprises: Figure 3

[0118] The acquisition module acquires a plurality of samples containing consumer personal attributes and consumption preference attributes, and takes each sample as a data point;

[0119] ​The calculation module calculates the local density and relative distance of each data point;

[0120] The clustering module clusters data points based on local density and relative distance.

[0121] The prediction module predicts corresponding consumption preference attributes based on clustering results and individual consumer attributes.

[0122] The calculation of local density is based on the cosine similarity between the data point and its neighboring points.

[0123] This embodiment calculates local density based on the cosine similarity between data points and their neighbors, reducing the time complexity caused by local density calculation in the DPeak clustering algorithm and improving clustering accuracy.

[0124] Figure 4 A schematic diagram of the physical structure of an electronic device provided by the present invention, such as... Figure 4 As shown, the electronic device may include: a processor 810, a communications interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communications interface 820, and the memory 830 communicate with each other via the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute a consumer preference prediction method, including:

[0125] Obtain multiple samples containing consumer personal attributes and consumption preference attributes, and treat each sample as a data point;

[0126] Calculate the local density and relative distance for each data point;

[0127] Clustering of data points is performed based on local density and relative distance;

[0128] Based on clustering results, corresponding consumption preference attributes are predicted through individual consumer attributes.

[0129] The local density is calculated based on the cosine similarity between the data point and its neighboring points.

[0130] Further, the logic instructions in the memory 830 described above can be implemented in the form of software functional units and sold or used as standalone products, and can be stored in a computer readable storage medium. Based on such an understanding, the technical solutions of the present application essentially or the parts that make contributions to the prior art, or parts of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0131] In another aspect, the present application also provides a computer program product, which comprises a computer program stored on a non-transitory computer readable storage medium, and the computer program comprises program instructions, when the program instructions are executed by a computer, the computer can execute the consumer preference prediction method provided by the above-mentioned methods, comprising:

[0132] Obtaining a plurality of samples containing consumer personal attributes and consumption preference attributes, and taking each sample as a data point;

[0133] Calculating the local density and relative distance of each data point;

[0134] Clustering the data points based on the local density and the relative distance;

[0135] Based on the clustering result, predicting the corresponding consumption preference attribute through the consumer personal attribute;

[0136] Wherein, the local density is calculated based on the cosine similarity between the data point and the neighbor point.

[0137] In another aspect, the present application also provides a non-transitory computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the consumer preference prediction method provided by the above-mentioned methods, comprising:

[0138] Obtaining a plurality of samples containing consumer personal attributes and consumption preference attributes, and taking each sample as a data point;

[0139] Calculating the local density and relative distance of each data point;

[0140] Clustering the data points based on the local density and the relative distance;

[0141] Based on the clustering result, the corresponding consumption preference attribute is predicted through the consumer personal attribute;

[0142] The local density is calculated based on the cosine similarity of the data points and the neighbor points.

[0143] The device embodiments described above are merely illustrative, wherein the units illustrated as separate components can or can not be physically separated, and the components illustrated as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment scheme according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0144] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be realized by means of software and the necessary general hardware platform, and of course, it can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0145] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A consumer preference prediction method characterized by, The method comprises: obtaining a plurality of samples containing consumer personal attributes and consumption preference attributes, each sample being taken as a data point; calculating the local density and relative distance of each data point; the calculation of the relative distance is based on the cosine similarity between the data point and the nearest data point with greater local density; clustering the data points based on the local density and the relative distance; predicting the corresponding consumption preference attributes through the consumer personal attributes based on the clustering result; wherein the local density is calculated based on the cosine similarity between the data point and the neighbor point; the clustering of the data points based on the local density and the relative distance comprises: sorting all data points according to the product of the local density and the relative distance; establishing an inflection point, and taking the data points with the product greater than the inflection point as cluster centers; assigning the data points other than the cluster centers to the cluster center with the nearest relative distance to form class clusters; wherein the inflection point is obtained according to the following steps: for each data point, connecting it with the data point with the maximum product and the data point with the minimum product respectively to obtain the included angle of the two lines; taking the data point with the minimum included angle as the inflection point; wherein for the data point with the product greater than the inflection point, when the deviation of the relative distance of the point from the average relative distance of all data points is greater than the overall standard deviation of the relative distances of all data points, and the local density of the point is less than the median of all local density values, the point is regarded as a noise point of the cluster center and is removed; after the clustering of the data points based on the local density and the relative distance, the method further comprises: if the relative distance of two cluster center points is less than the minimum value of the average relative distance of the points in the two class clusters, merging the two class clusters.

2. The consumer preference prediction method of claim 1, wherein, The neighbor point is obtained based on a Semi-Convex Hull Tree algorithm.

3. A consumer preference prediction system characterized by, The system comprises: an obtaining module that obtains a plurality of samples containing consumer personal attributes and consumption preference attributes, each sample being taken as a data point; a calculating module that calculates the local density and relative distance of each data point; the calculation of the relative distance is based on the cosine similarity between the data point and the nearest data point with greater local density; a clustering module that clusters the data points based on the local density and the relative distance; a predicting module that predicts the corresponding consumption preference attributes through the consumer personal attributes based on the clustering result; wherein the local density is calculated based on the cosine similarity between the data point and the neighbor point; the clustering of the data points based on the local density and the relative distance comprises: sorting all data points according to the product of the local density and the relative distance; establishing an inflection point, and taking the data points with the product greater than the inflection point as cluster centers; assigning the data points other than the cluster centers to the cluster center with the nearest relative distance to form class clusters; wherein the inflection point is obtained according to the following steps: for each data point, connecting it with the data point with the maximum product and the data point with the minimum product respectively to obtain the included angle of the two lines; taking the data point with the minimum included angle as the inflection point; wherein for the data point with the product greater than the inflection point, when the deviation of the relative distance of the point from the average relative distance of all data points is greater than the overall standard deviation of the relative distances of all data points, and the local density of the point is less than the median of all local density values, the point is regarded as a noise point of the cluster center and is removed; wherein, for data points with product greater than the inflection point, the data point is removed as a noise point of the cluster center when the relative distance of the point deviates from the average relative distance of all data points by more than the overall standard deviation of the relative distances of all data points, and the local density of the point is less than the median of all local densities; after clustering the data points based on the local density and the relative distance, further comprising: merging two cluster centers if the relative distance between the two cluster centers is less than the minimum of the average relative distance of the points in the two clusters.

4. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the steps of the consumer preference prediction method of any one of claims 1-2 when executing the program. 5.A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the consumer preference prediction method of any one of claims 1-2.

6. A computer program product comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the consumer preference prediction method of any one of claims 1-2.

Citation Information

Patent Citations

  • User preference prediction method and device, equipment and storage medium

    CN111784069A