User clustering method and apparatus, computer device, and storage medium
By setting iteration termination conditions and adjusting the position of cluster centers, the inaccuracy problem caused by random selection of cluster centers in existing technologies is solved, and more accurate clustering results are achieved.
Patent Information
- Application Number
- CN202310483626.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-28
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2043-04-28
AI Technical Summary
Existing clustering algorithms randomly select initial cluster centers, leading to inaccurate clustering results.
By setting an iteration termination condition, the target cluster center to be moved is determined based on the characteristic values of the initial cluster centers. The position of the target cluster center is then adjusted using the attraction parameter value and the perturbation operator until the iteration termination condition is met, thus obtaining the optimal clustering result.
The accuracy and stability of clustering results have been improved. By continuously iterating and optimizing the cluster centers, the optimal cluster centers are determined, thereby improving the accuracy of the clustering results.
Smart Images

Figure CN116578886B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of big data, and in particular to a user clustering method and device, computer equipment and a storage medium. BACKGROUND
[0002] With the continuous improvement of people's living standards, people's demand for financial products, financial products, pension products and bond products is increasing. In the process of promoting these products to users, the users need to be clustered first, and the corresponding products are promoted to the users according to the categories of the user's customer groups. Among them, the clustering algorithm is usually used to cluster users to obtain the result of the user's customer group.
[0003] As an important branch of the technical field of big data, the clustering algorithm has been widely used in many fields. However, the existing clustering algorithm is randomly selected when selecting the initial clustering center, which is difficult to accurately obtain the clustering center, and thus will directly affect the accuracy of the final clustering result.
[0004] Therefore, how to improve the accuracy of the clustering result has become a technical problem to be solved. SUMMARY
[0005] Therefore, it is necessary to provide a user clustering method and device, computer equipment and a storage medium capable of improving the accuracy of the clustering result.
[0006] In a first aspect, the present application provides a user clustering method. The method comprises:
[0007] Based on at least two initial clustering centers, according to the user features of each user in the user set to be clustered, the user set is clustered, and the feature values of the initial clustering centers are determined;
[0008] If the feature values of the initial clustering centers do not satisfy the iteration end condition, the target clustering center that needs to be moved and the other clustering centers that do not need to be moved are determined from the initial clustering centers according to the feature values of the initial clustering centers;
[0009] According to the attraction parameter value, the perturbation operator, and the distance between the target clustering center and the other clustering centers, the target clustering center is adjusted to obtain the next clustering center corresponding to the target clustering center; wherein the perturbation operator is determined according to the current iteration number and the maximum iteration number;
[0010] The next clustering center and the other clustering centers are taken as new initial clustering centers, and the operation of clustering the user set according to the user features of each user in the user set to be clustered based on each initial clustering center is performed again until the feature values of each initial clustering center satisfy the iteration end condition, and a clustering result of the user set is output.
[0011] In one of the embodiments, the determining of the target clustering center to be moved and the other clustering centers not to be moved from the initial clustering centers according to the feature values of the initial clustering centers comprises:
[0012] Selecting at least two standby clustering centers from the initial clustering centers;
[0013] Combining the standby clustering centers two by two to obtain a clustering group;
[0014] Determining the standby clustering center to be moved in the clustering group according to a comparison result between the feature values of two standby clustering centers in the clustering group;
[0015] Taking the standby clustering center to be moved in the clustering group as the target clustering center, and taking the clustering centers other than the target clustering center in the initial clustering centers as the other clustering centers not to be moved.
[0016] In one of the embodiments, the adjusting of the target clustering center according to the attraction parameter value, the perturbation operator, and the distance between the target clustering center and the other clustering centers to obtain the next clustering center corresponding to the target clustering center comprises:
[0017] Determining a target attraction value between the target clustering center and an associated clustering center according to the attraction parameter value and the distance between the target clustering center and the associated clustering center, wherein the associated clustering center is a clustering center in the other clustering centers belonging to the same clustering group as the target clustering center;
[0018] Adjusting the target clustering center according to the target attraction value, the perturbation operator, and the distance between the target clustering center and the associated clustering center to obtain the next clustering center corresponding to the target clustering center.
[0019] In one of the embodiments, the clustering of the user set to be clustered based on the at least two initial clustering centers according to the user features of each user in the user set and the determination of the feature values of the initial clustering centers comprise:
[0020] Clustering the user set to be clustered based on the at least two initial clustering centers according to the user features of each user in the user set to obtain a clustering result corresponding to each initial clustering center;
[0021] Determine a feature value of each initial clustering center according to a distance between each user in the user set and the corresponding initial clustering center.
[0022] In one embodiment, the clustering the user set according to the user feature of each user in the user set based on the at least two initial clustering centers to obtain the clustering result corresponding to each initial clustering center comprises:
[0023] Obtain a feature weight vector corresponding to the user feature of each user in the user set; wherein the user feature of each user in the user set comprises an identity dimension feature and / or an asset dimension feature;
[0024] Determine a distance between each initial clustering center and each user according to the feature weight vector, the user feature of each user in the user set, and each initial clustering center;
[0025] Cluster the user set according to the distance between each initial clustering center and each user to obtain the clustering result corresponding to each initial clustering center.
[0026] In one embodiment, before the clustering the user set according to the user feature of each user in the user set based on the at least two initial clustering centers to obtain the clustering result corresponding to each initial clustering center, the method further comprises:
[0027] Detect the user feature of each user in the user set to be clustered to determine a user feature with a special value; wherein the special value comprises at least one of a missing value, an abnormal value, and a repeated value;
[0028] Perform data cleaning on the user feature with the special value.
[0029] In one embodiment, the iteration end condition comprises that the feature value of each initial clustering center is less than or equal to a preset threshold.
[0030] In one embodiment, the method further comprises:
[0031] Determine a difference between the current iteration number and the maximum iteration number;
[0032] Determine the perturbation operator with a constant e as a base number and a ratio between the difference and the maximum iteration number as an exponent.
[0033] In a second aspect, the present application further provides a user clustering device. The device comprises:
[0034] The clustering module is configured to cluster the user set according to the user features of each user in the user set to be clustered based on at least two initial clustering centers, and determine feature values of the initial clustering centers.
[0035] The judging module is configured to judge whether the feature values of the initial clustering centers satisfy an iteration end condition.
[0036] The iteration module is configured to, if the feature values of the initial clustering centers do not satisfy the iteration end condition, determine a target clustering center to be moved and other clustering centers not to be moved from the initial clustering centers according to the feature values of the initial clustering centers.
[0037] The iteration module is further configured to adjust the target clustering center according to an attraction parameter value, a perturbation operator, and a distance between the target clustering center and the other clustering centers, to obtain a next clustering center corresponding to the target clustering center, wherein the perturbation operator is determined according to a current iteration number and a maximum iteration number.
[0038] The iteration module is further configured to take the next clustering center and the other clustering centers as new initial clustering centers, and return to run the clustering module.
[0039] The result output module is configured to, if the feature values of the initial clustering centers satisfy the iteration end condition, output a clustering result of the user set.
[0040] In a third aspect, the present application further provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0041] The clustering module is configured to cluster the user set according to the user features of each user in the user set to be clustered based on at least two initial clustering centers, and determine feature values of the initial clustering centers.
[0042] The iteration module is configured to, if the feature values of the initial clustering centers do not satisfy the iteration end condition, determine a target clustering center to be moved and other clustering centers not to be moved from the initial clustering centers according to the feature values of the initial clustering centers.
[0043] The iteration module is further configured to adjust the target clustering center according to an attraction parameter value, a perturbation operator, and a distance between the target clustering center and the other clustering centers, to obtain a next clustering center corresponding to the target clustering center, wherein the perturbation operator is determined according to a current iteration number and a maximum iteration number.
[0044] If the characteristic values of the initial clustering centers do not satisfy the iteration end condition, then a target clustering center that needs to be moved and other clustering centers that do not need to be moved are determined from the initial clustering centers according to the characteristic values of the initial clustering centers.
[0045] In a fourth aspect, the present application further provides a computer readable storage medium. The computer readable storage medium has a computer program stored thereon, and the computer program, when executed by a processor, implements the following steps:
[0046] Clustering the user set according to the user features of each user in the user set to be clustered based on at least two initial clustering centers, and determining characteristic values of the initial clustering centers;
[0047] If the characteristic values of the initial clustering centers do not satisfy the iteration end condition, then a target clustering center that needs to be moved and other clustering centers that do not need to be moved are determined from the initial clustering centers according to the characteristic values of the initial clustering centers;
[0048] Updating the target clustering center according to the attraction parameter value, the perturbation operator, and the distance between the target clustering center and the other clustering centers, to obtain a next clustering center corresponding to the target clustering center; wherein the perturbation operator is determined according to a current iteration number and a maximum iteration number;
[0049] The next clustering center and the other clustering centers are taken as new initial clustering centers, and the operation of clustering the user set according to the user features of each user in the user set to be clustered based on the initial clustering centers is performed again until the characteristic values of the initial clustering centers satisfy the iteration end condition, and a clustering result of the user set is output.
[0050] In a fifth aspect, the present application further provides a computer program product. The computer program product comprises a computer program, and the computer program, when executed by a processor, implements the following steps:
[0051] Clustering the user set according to the user features of each user in the user set to be clustered based on at least two initial clustering centers, and determining characteristic values of the initial clustering centers;
[0052] If the characteristic values of the initial clustering centers do not satisfy the iteration end condition, then a target clustering center that needs to be moved and other clustering centers that do not need to be moved are determined from the initial clustering centers according to the characteristic values of the initial clustering centers;
[0053] adjust the target cluster center according to the attraction parameter value, the perturbation operator, and the distance between the target cluster center and the other cluster centers, to obtain a next cluster center corresponding to the target cluster center; wherein the perturbation operator is determined according to a current iteration number and a maximum iteration number;
[0054] take the next cluster center and the other cluster centers as new initial cluster centers, and return to perform the operation of clustering the user set according to the user feature of each user in the user set to be clustered based on each initial cluster center, until the eigenvalues of the initial cluster centers meet the iteration end condition, and output the clustering result of the user set.
[0055] The user clustering method, device, computer device, and storage medium described above set an iteration end condition, and in a case where the eigenvalues of the initial cluster centers do not meet the iteration end condition, iteratively optimize the positions of the initial cluster centers, that is, determine the initial cluster centers that need to be moved according to the relationship between the eigenvalues of the initial cluster centers, then determine a next cluster center corresponding to a target cluster center according to an attraction parameter value, a perturbation operator, a current position of the target cluster center, and the distance between the target cluster center and the other cluster centers, take the next cluster center and the other cluster centers as new initial cluster centers, continue to cluster the user set, and further obtain the best clustering result after clustering the user set multiple times. Compared with the prior art that clusters users by using fixed and unchanged cluster centers selected randomly, the above scheme considers the influence of the selection of the cluster center on the clustering result, iteratively optimizes the cluster center to determine the best cluster center, and further improves the accuracy of the clustering result. BRIEF DESCRIPTION OF DRAWINGS
[0056] Figure 1 a diagram of an application environment of a user clustering method in an embodiment;
[0057] Figure 2 a flowchart of a user clustering method in an embodiment;
[0058] Figure 3 a flowchart of determining the cluster centers that need to be moved in an embodiment;
[0059] Figure 4 a flowchart of updating the target cluster center in an embodiment;
[0060] Figure 5 a flowchart of clustering the user set in an embodiment;
[0061] Figure 6 a flowchart of data cleaning of the user feature in an embodiment;
[0062] Figure 7 a flowchart of a user clustering method in another embodiment;
[0063] Figure 8 a structural block diagram of a user clustering apparatus in an embodiment;
[0064] Figure 9 a structural block diagram of a user clustering apparatus in another embodiment;
[0065] Figure 10 an internal structural diagram of a computer device in an embodiment. DETAILED DESCRIPTION
[0066] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not used to limit the present application.
[0067] The user clustering method provided by the embodiments of the present application can be applied to a situation in which users need to be clustered so as to push various products to the users according to the clustering results of the users, for example, a situation in which a pension product is pushed to a user according to the clustering result of the user. The present application can be applied to, for example, a situation in which a pension product is pushed to a user according to the clustering result of the user. Figure 1The application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. For example, the server 104 clusters the user set according to the user characteristics of each user in the user set to be clustered based on at least two initial clustering centers, and determines the characteristic values of each initial clustering center; if the characteristic values of each initial clustering center do not satisfy the iteration end condition, determine the target clustering center that needs to be moved and the other clustering centers that do not need to be moved from each initial clustering center according to the characteristic values of each initial clustering center; adjust the target clustering center according to the attraction parameter value, the perturbation operator, and the distance between the target clustering center and other clustering centers to obtain the next clustering center corresponding to the target clustering center; wherein the perturbation operator is determined according to the current iteration number and the maximum iteration number; take the next clustering center and other clustering centers as new initial clustering centers, and return to execute the operation of clustering the user set according to the user characteristics of each user in the user set to be clustered based on each initial clustering center, until the characteristic values of each initial clustering center satisfy the iteration end condition, and output the clustering result of the user set to the terminal 102. The data storage system can store the data required by the server 104 to process, such as the user set to be clustered, the attraction parameter value, and the perturbation operator. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers. Among them, the terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices, Internet of Things devices can be smart speakers, smart televisions, smart air conditioners, smart car devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0068] In one embodiment, as shown in Figure 2 , a user clustering method is provided, which is applied to Figure 1 the server in the figure for illustration, including the following steps:
[0069] S202, based on at least two initial clustering centers, clustering the user set according to the user characteristics of each user in the user set to be clustered, and determining the characteristic values of each initial clustering center.
[0070] Among them, the initial clustering center is a point used to represent the position center of a certain customer group, and the initial clustering center can be obtained by random selection. Optionally, each initial clustering center can be represented by a vector of a set dimension; further, the initial clustering center and the user characteristics of each user in the user set belong to the same dimension vector.
[0071] The user features can include multiple dimensional features of the user, and the dimensional features can be identity dimensional features and / or asset dimensional features, the identity dimensional features being used to describe identity information of the user, and the asset dimensional features being used to describe holding or transaction information of assets of the user.
[0072] Optionally, the identity dimensional features can be gender code, age segment, education level code, length of banking, marital status code, occupation code, unit type code, home region and unit name, and the like. The asset dimensional features can be point-in-time assets, fund holding flag, bond holding flag, deposit balance, insurance balance, fixed deposit balance, current deposit balance, cross-bank transfer inflow amount, in-bank financing inflow amount, third-party payment inflow amount, other inflow amount, bank-card-broker-bank outflow amount, cash deposit and withdrawal outflow amount, total transaction number and total transaction amount, and the like.
[0073] For example, in the embodiment, for each user, identity information or asset information of the user is encoded according to a preset encoding manner, to obtain multiple dimensional features of the user; further, the multiple dimensional features of the user can be spliced according to a set order, to construct a feature vector; that is, the user features of each user can be represented by a feature vector.
[0074] Specifically, based on the at least two initial clustering centers, the user set is clustered according to the user features of each user in the user set to be clustered, and the feature values of the initial clustering centers are determined, including: based on the at least two initial clustering centers, the user set is clustered according to the user features of each user in the user set to be clustered, to obtain clustering results corresponding to the initial clustering centers; and the feature values of the initial clustering centers are determined according to distances between each user in the clustering results and the corresponding initial clustering center. For example, at least two initial clustering centers can be randomly selected, and each user in the user set to be clustered is divided into a corresponding customer group of an associated initial clustering center based on distances between the user features of each user in the user set to be clustered and the initial clustering centers, to obtain the clustering results corresponding to the initial clustering centers. Further, the feature values of the initial clustering centers are determined according to distances between each user in the clustering results and the corresponding initial clustering center.
[0075] The initial clustering center corresponding to the user is the initial clustering center corresponding to the clustering result to which the user belongs.
[0076] Specifically, the feature value of each initial cluster center can be determined according to the distance between each user in the clustering result corresponding to the initial cluster center and the initial cluster center. For each initial cluster center, the distance between each user in the clustering result corresponding to the initial cluster center and the initial cluster center can be calculated. Further, the ratio of the sum of the distance between each user in the clustering result corresponding to the initial cluster center and the initial cluster center to the number of users in the clustering result corresponding to the initial cluster center is taken as the feature value of the initial cluster center. That is, the feature value of the initial cluster center can be determined by the following formula (1):
[0077]
[0078] wherein C j is the clustering result of the jth initial cluster center Y j , L(Y j ) is the feature value of the initial cluster center Y j , D(X i , Y j ) is the distance between the user X i and the cluster center Y j in C j , and n j is the number of users in the clustering result C j .
[0079] In S204, it is determined whether the feature value of each initial cluster center satisfies an iteration end condition. If yes, S212 is performed; if no, S206 is performed.
[0080] The iteration end condition includes that the feature value of each initial cluster center is less than or equal to a preset threshold. That is, if the feature value of a certain initial cluster center is less than the preset threshold, the iteration step is performed, which is S206 to S210. Alternatively, in the embodiment, the maximum iteration number and the value of the preset threshold can be set arbitrarily, which is not limited in the present application.
[0081] In S206, according to the feature value of each initial cluster center, a target cluster center to be moved and other cluster centers not to be moved are determined from the initial cluster centers.
[0082] Alternatively, the target cluster center to be moved and the other cluster centers can be determined from the initial cluster centers by comparing the numerical values of the feature values of the initial cluster centers.
[0083] In S208, according to the attraction parameter value, the perturbation operator, and the distance between the target cluster center and the other cluster centers, the target cluster center is adjusted to obtain a next cluster center corresponding to the target cluster center.
[0084] The attraction parameter value can be determined by a maximum attraction value and an absorption factor, which are constant values that can be freely set.
[0085] Optionally, the distance that the target cluster center needs to move can be determined by the attraction parameter value, the perturbation operator, and the distance between the target cluster center and other cluster centers. Then, the next cluster center corresponding to the target cluster center can be determined according to the current position of the target cluster center and the distance that the target cluster center needs to move.
[0086] It should be noted that the perturbation operator is a dynamic value that can be determined according to the current iteration number and the maximum iteration number. As the current iteration number increases, the value of the perturbation operator decreases, thereby effectively solving the problem of repeated oscillation of the target cluster center around the local optimal value or global optimal value, slow convergence speed, and reduced optimization accuracy due to the random movement of the target cluster center. Global optimization is achieved, and the clustering accuracy and result stability are improved.
[0087] S210, taking the next cluster center and other cluster centers as new initial cluster centers, performing S202.
[0088] Specifically, the next cluster center and other cluster centers are taken as new initial cluster centers, and the operation of clustering the user set according to the user features of each user in the user set to be clustered is continued based on the new initial cluster centers.
[0089] S212, outputting the clustering result of the user set.
[0090] The clustering result of the user set is the final clustering result of the user set to be clustered.
[0091] In the above user clustering method, the position of the initial cluster center is iteratively optimized when the current iteration number and the feature values of the initial cluster centers do not satisfy the iteration end condition, that is, the initial cluster center that needs to be moved is determined according to the relationship between the feature values of the initial cluster centers, the next cluster center corresponding to the target cluster center is determined according to the attraction parameter value, the perturbation operator, the current position of the target cluster center, and the distance between the target cluster center and other cluster centers, the next cluster center and other cluster centers are taken as new initial cluster centers, and the user set is continuously clustered, thereby obtaining the best clustering result after multiple clustering of the user set. Considering the influence of the cluster center selection on the clustering result, the best cluster center is determined by iteratively optimizing the cluster center, thereby improving the accuracy of the clustering result.
[0092] It should be noted that in the process of updating the cluster center, determining the cluster center to be moved is a necessary means, and there are many ways to determine the cluster center to be moved. The embodiment provides one optional way of determining the cluster center to be moved, which can determine the target cluster center to be moved and other cluster centers not to be moved from the initial cluster centers according to the eigenvalues of the initial cluster centers. Figure 3 The implementation process includes the following steps:
[0093] S302, selecting at least two standby cluster centers from the initial cluster centers.
[0094] Specifically, at least two standby cluster centers can be randomly selected from all initial cluster centers. For example, there are a total of 5 initial cluster centers, which are the first initial cluster center, the second initial cluster center, the third initial cluster center, the fourth initial cluster center and the fifth initial cluster center. Three initial cluster centers are randomly selected from all initial cluster centers, which are the first initial cluster center, the third initial cluster center and the fifth initial cluster center. The first initial cluster center, the third initial cluster center and the fifth initial cluster center are used as standby cluster centers.
[0095] S304, combining the standby cluster centers two by two to obtain a cluster group.
[0096] Specifically, taking the first initial cluster center, the third initial cluster center and the fifth initial cluster center as standby cluster centers as an example, the standby cluster centers are combined two by two, which can include combining the first initial cluster center and the fifth initial cluster center, combining the first initial cluster center and the third initial cluster center, and combining the third initial cluster center and the fifth initial cluster center, thereby obtaining three cluster groups.
[0097] S306, determining the standby cluster center to be moved in the cluster group according to the comparison result between the eigenvalues of the two standby cluster centers in the cluster group.
[0098] Specifically, taking the cluster group composed of the first initial cluster center and the fifth initial cluster center as an example, the size of the eigenvalues between the first initial cluster center and the fifth initial cluster center is compared. The moving rule can be that the eigenvalue with a smaller value needs to be moved. In the case that the eigenvalue of the first initial cluster center is smaller than that of the fifth initial cluster center, the first initial cluster center is determined as the standby cluster center to be moved, and the fifth initial cluster center is determined as the standby cluster center not to be moved.
[0099] S308, taking the standby cluster center to be moved in the cluster group as the target cluster center, and taking the cluster centers in the initial cluster centers except the target cluster center as other cluster centers not to be moved.
[0100] Specifically, taking the first initial clustering center as the standby clustering center needing to be moved and the fifth initial clustering center as the standby clustering center not needing to be moved as an example, the first initial clustering center is taken as the target clustering center and the fifth initial clustering center is taken as the other clustering center.
[0101] It should be noted that the embodiment determines the initial clustering center needing to be moved by comparing the relationship between the eigenvalues of the initial clustering centers, facilitates subsequent updating of the clustering center, and improves the iteration efficiency of the clustering center.
[0102] It should be noted that the selection of the clustering center directly affects the accuracy of the clustering result, and in order to obtain a clustering result with higher accuracy, the best clustering center needs to be accurately determined. Alternatively, there are various ways to update the clustering center, and the embodiment provides one of the ways to update the clustering center, and the specific description can be referred to the following embodiments.
[0103] On the basis of the above-mentioned embodiments, the embodiment provides an optional way of updating the target clustering center, that is, further explaining S208 in detail. As shown in Figure 4 The implementation process includes the following steps:
[0104] S402, determining a target attraction value between the target clustering center and the associated clustering center according to the attraction parameter value and the distance between the target clustering center and the associated clustering center.
[0105] The associated clustering center is a clustering center in the other clustering center belonging to the same clustering group as the target clustering center, and the associated clustering center is a clustering center needed in the process of adjusting the target clustering center, used to indicate the adjustment direction in the process of adjusting the target clustering center.
[0106] Optionally, the attraction parameter value can include a maximum attraction value and an absorption factor; the target attraction value between the target clustering center and the associated clustering center can be calculated by the following formula (2):
[0107]
[0108] Wherein, γ is the absorption factor, β(0) is the maximum attraction value, β(r) is the target attraction value, r jl is the distance between the target clustering center and the associated clustering center.
[0109] Further, the distance between the target clustering center and the associated clustering center can be calculated by the following formula (3):
[0110]
[0111] Wherein, Yj Y is a target clustering center l Y is an associated clustering center jm Y is a target clustering center j is the mth feature of Y, d is the number of features in the user feature, Y lm Y is an associated clustering center l is the mth feature of Y.
[0112] S404, adjusting the target clustering center according to the target attraction value, the perturbation operator, and the distance between the target clustering center and the associated clustering center, to obtain a next clustering center corresponding to the target clustering center.
[0113] Optionally, a difference value between the current iteration number and the maximum iteration number is determined; a perturbation operator is determined by taking the difference value and the maximum iteration number as the base and the exponent, respectively.
[0114] The perturbation operator in this embodiment gradually decreases as the current iteration number increases; further, the perturbation operator can be calculated by the following formula (4):
[0115]
[0116] wherein, F is the perturbation operator, G is the current iteration number, G max is the maximum iteration number.
[0117] Further, the next clustering center corresponding to the target clustering center can be calculated by the following formula (5):
[0118] Y j+1 = Y j +F×β(r)×rand(Y j -Y l ) 2 (5)
[0119] wherein, Y j+1 is the next clustering center corresponding to the target clustering center.
[0120] It can be understood that the perturbation operator introduced in this embodiment gradually decreases as the current iteration number increases, which can meet the requirements of global search at the initial stage and local search at the later stage, thereby further optimizing the requirements for convergence speed, and avoiding the situation of entering local global optimization. Further, the global search for the best clustering center can be performed, and the accuracy of clustering can be improved.
[0121] Based on the above disclosed embodiments, the present embodiment provides an optional way of clustering a user set, which can cluster the user set according to the user features of each user in the user set based on at least two initial clustering centers, to obtain clustering results corresponding to each initial clustering center. As shown in Figure 5 The specific implementation process includes the following steps:
[0122] S502, obtaining a feature weight vector corresponding to the user features of each user in the user set.
[0123] The user features of each user in the user set include identity dimension features and / or asset dimension features, and the feature weight vector includes the weight corresponding to each feature in the user features. The feature weight vector, the initial clustering center and the user features all belong to the same dimension vector.
[0124] S504, determining the distance between each initial clustering center and each user according to the feature weight vector, the user features of each user in the user set, and each initial clustering center.
[0125] Specifically, the distance between the initial clustering center and the user can be calculated by the following formula (6):
[0126]
[0127] Wherein, W im is the mth element value of the ith weight vector W i , D(X i ,Y j ) is the distance between the ith user X i and the jth initial clustering center Y j , X im is the mth feature of the user X i , and Y jm is the mth feature of the initial clustering center Y j .
[0128] S506, clustering the user set according to the distance between each initial clustering center and each user, to obtain clustering results corresponding to each initial clustering center.
[0129] Specifically, each user can be divided into a customer group corresponding to the initial clustering center closest to the user, to obtain the clustering results corresponding to each initial clustering center.
[0130] It should be noted that, considering the influence of different features on the clustering results, the present embodiment introduces the feature weight vector to enhance the discrimination between data attributes and reduce the influence of abnormal points, thereby improving the effect of subsequent clustering.
[0131] Based on the above disclosed embodiments, the present embodiment provides an optional way of data cleaning. Before clustering the user set to be clustered based on at least two initial clustering centers according to the user features of each user in the user set to be clustered to obtain the clustering results corresponding to each initial clustering center, the user set to be clustered is cleaned. As shown in Figure 6 The specific implementation process includes the following steps:
[0132] S602, detecting the user features of each user in the user set to be clustered to determine the user features with special values.
[0133] The special values include at least one of missing values, abnormal values and repeated values.
[0134] Specifically, for the user features of each user, the values of the features in the user features can be detected in sequence to determine whether the values of the features are special values, and the features with special values in the user features are marked.
[0135] S604, data cleaning is performed on the user features with special values.
[0136] Specifically, the missing values in the user features can be filled, and different filling can be performed according to different types of features, for example, “-1” is filled for flag type features to mark missing categories; “0” is filled for transaction type features to represent no transaction; “0” is filled for asset type or contribution type features to represent no asset record or no asset. The abnormal values in the user features are replaced or deleted, and the repeated values of the same feature in the user features are deleted.
[0137] It can be understood that the present embodiment performs data cleaning on the missing values in the user features to ensure the authenticity of the user features, and further ensures the smooth progress of the clustering process.
[0138] Based on the above embodiment, the present embodiment provides an optional implementation process, as shown in Figure 7 Another flowchart of a user clustering method is shown in FIG. 7B. The process specifically includes the following steps:
[0139] S702, based on at least two initial clustering centers, clustering the user set according to the user features of each user in the user set to be clustered to obtain the clustering results corresponding to each initial clustering center.
[0140] S704, determining the feature values of each initial clustering center according to the distance between each user in each clustering result and the corresponding initial clustering center.
[0141] S706, determining whether the eigenvalues of the initial clustering centers satisfy an iteration end condition; if yes, performing S718; if no, performing S708.
[0142] S708, selecting at least two standby clustering centers from the initial clustering centers, combining the standby clustering centers two by two to obtain a clustering group, and determining the standby clustering center that needs to be moved in the clustering group according to a comparison result between the eigenvalues of the two standby clustering centers in the clustering group.
[0143] S710, taking the standby clustering center that needs to be moved in the clustering group as a target clustering center, and taking the clustering centers other than the target clustering center in the initial clustering centers as other clustering centers that do not need to be moved.
[0144] S712, determining a target attraction value between the target clustering center and an associated clustering center according to the attraction parameter value and the distance between the target clustering center and the associated clustering center; the associated clustering center is a clustering center in the other clustering centers that belongs to the same clustering group as the target clustering center.
[0145] S714, adjusting the target clustering center according to the target attraction value, the perturbation operator and the distance between the target clustering center and the associated clustering center to obtain a next clustering center corresponding to the target clustering center.
[0146] S716, taking the next clustering center and the other clustering centers as new initial clustering centers and returning to perform S702.
[0147] S718, outputting a clustering result of the user set.
[0148] The specific process of S702-S718 can be referred to the description of the method embodiments, and the implementation principle and technical effects are similar, which will not be repeated here.
[0149] It should be understood that although each step in the flowchart involved in the above embodiments is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise stated herein, the execution of these steps has no strict sequence limitation, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in the above embodiments can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.
[0150] Based on the same inventive concept, the embodiments of the present application further provide a user clustering device for implementing the above-mentioned user clustering method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above-mentioned method, and therefore the specific limitations in one or more user clustering device embodiments provided below can refer to the limitations of the user clustering method described above, which will not be repeated here.
[0151] In one embodiment, as shown in Figure 8 a user clustering device is provided, which comprises:
[0152] a clustering module 810, configured to cluster a user set based on at least two initial clustering centers according to the user features of each user in the user set to be clustered, and determine the feature values of the initial clustering centers.
[0153] a judging module 820, configured to judge whether the feature values of the initial clustering centers satisfy an iteration end condition; wherein the iteration end condition comprises that the feature values of the initial clustering centers are all less than or equal to a preset threshold.
[0154] an iteration module 830, configured to, if the feature values of the initial clustering centers do not satisfy the iteration end condition, determine a target clustering center that needs to be moved and other clustering centers that do not need to be moved from the initial clustering centers according to the feature values of the initial clustering centers.
[0155] The iteration module 830 is further configured to adjust the target clustering center according to the attraction parameter value, the perturbation operator, and the distance between the target clustering center and the other clustering centers, to obtain a next clustering center corresponding to the target clustering center; wherein the perturbation operator is determined according to a current iteration number and a maximum iteration number.
[0156] The iteration module 830 is further configured to take the next clustering center and the other clustering centers as new initial clustering centers, and return to run the clustering module 810.
[0157] a result output module 840, configured to, if the feature values of the initial clustering centers satisfy the iteration end condition, output the clustering result of the user set.
[0158] In the user clustering device, the iteration end condition is set, the positions of the initial clustering centers are iteratively optimized in a case where the eigenvalues of the initial clustering centers satisfy the iteration end condition or not, the initial clustering center that needs to be moved is determined according to the relationship between the eigenvalues of the initial clustering centers, the target clustering center is adjusted according to the attraction parameter value, the perturbation operator and the distance between the target clustering center and other clustering centers, the next clustering center corresponding to the target clustering center is obtained, the next clustering center and other clustering centers are taken as new initial clustering centers, and the user set is clustered again to obtain the best clustering result after the user set is clustered for multiple times. Considering the influence of the selection of the clustering center position on the clustering result, the best clustering center is obtained by iteratively optimizing the clustering center, and then the users in the user set are clustered by using the best clustering center, so that the accuracy of the clustering result is improved.
[0159] In one of the embodiments, the iteration module 830 includes a first determination unit 831, a second determination unit 832 and a third determination unit 833.
[0160] The first determination unit 831 is configured to select at least two standby clustering centers from the initial clustering centers, combine the standby clustering centers two by two to obtain clustering groups, determine the standby clustering center that needs to be moved in the clustering group according to the comparison result between the eigenvalues of the two standby clustering centers in the clustering group, take the standby clustering center that needs to be moved in the clustering group as the target clustering center, and take the clustering centers other than the target clustering center in the initial clustering centers as the other clustering centers that do not need to be moved.
[0161] The second determination unit 832 is configured to determine the target attraction value between the target clustering center and the associated clustering center according to the attraction parameter value and the distance between the target clustering center and the associated clustering center, wherein the associated clustering center is the clustering center in the other clustering centers that belongs to the same clustering group as the target clustering center, and adjust the target clustering center according to the target attraction value, the perturbation operator and the distance between the target clustering center and the associated clustering center to obtain the next clustering center corresponding to the target clustering center.
[0162] The third determination unit 833 is configured to take the next clustering center and the other clustering centers as new initial clustering centers and return to run the clustering module 810.
[0163] In one of the embodiments, the clustering module 810 includes:
[0164] The clustering unit is configured to cluster the user set according to the user features of each user in the user set to be clustered based on the at least two initial clustering centers, and obtain the clustering result corresponding to each initial clustering center.
[0165] The feature value determination unit is configured to determine a feature value of each initial clustering center according to a distance between each user and the corresponding initial clustering center in each clustering result.
[0166] In one of the embodiments, the clustering unit is further configured to obtain a feature weight vector corresponding to the user feature of each user in the user set; wherein the user feature of each user in the user set comprises an identity dimension feature and / or an asset dimension feature; determine the distance between each initial clustering center and each user according to the feature weight vector, the user feature of each user in the user set, and each initial clustering center; and cluster the user set according to the distance between each initial clustering center and each user to obtain the clustering result corresponding to each initial clustering center.
[0167] In one of the embodiments, the user clustering apparatus 800 further comprises a data cleaning module configured to detect the user feature of each user in the user set to be clustered, and determine the user feature with a special value; wherein the special value comprises at least one of a missing value, an abnormal value, and a duplicate value; and perform data cleaning on the user feature with the special value.
[0168] In one of the embodiments, the user clustering apparatus 800 further comprises a perturbation operator determination module configured to determine a difference value between the current iteration number and the maximum iteration number; and determine the perturbation operator with a constant e as the base number and the ratio between the difference value and the maximum iteration number as the exponent.
[0169] The modules in the user clustering apparatus described above can be all or partially implemented by software, hardware, or a combination thereof. The modules described above can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to the modules.
[0170] In one embodiment, a computer device is provided, which can be a server, and the internal structure diagram thereof can be as shown in Figure 10 The computer device comprises a processor, a memory, and a network interface connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The database of the computer device is configured to store data such as the user set to be clustered, iteration conditions, attraction parameter values, the maximum iteration number, and the perturbation operator. The network interface of the computer device is configured to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement a user clustering method.
[0171] Those skilled in the art can understand that Figure 10 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0172] In one embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:
[0173] Based on the at least two initial clustering centers, clustering the user set according to the user features of each user in the user set to be clustered, and determining feature values of the initial clustering centers;
[0174] If the feature values of the initial clustering centers do not satisfy the iteration end condition, determining a target clustering center that needs to be moved and other clustering centers that do not need to be moved from the initial clustering centers according to the feature values of the initial clustering centers; wherein the iteration end condition includes that the feature values of the initial clustering centers are all less than or equal to a preset threshold value;
[0175] Adjusting the target clustering center according to the attraction parameter value, the perturbation operator, and the distance between the target clustering center and the other clustering centers to obtain a next clustering center corresponding to the target clustering center; wherein the perturbation operator is determined according to the current iteration number and the maximum iteration number;
[0176] Taking the next clustering center and the other clustering centers as new initial clustering centers, and returning to perform the operation of clustering the user set according to the user features of each user in the user set to be clustered based on the initial clustering centers, until the feature values of the initial clustering centers satisfy the iteration end condition, and outputting the clustering result of the user set.
[0177] In one embodiment, when the processor executes the processing logic in the computer program for determining a target clustering center that needs to be moved and other clustering centers that do not need to be moved from the initial clustering centers according to the feature values of the initial clustering centers, the processor further implements the following steps: selecting at least two backup clustering centers from the initial clustering centers; combining the backup clustering centers two by two to obtain clustering groups; determining a backup clustering center that needs to be moved in a clustering group according to a comparison result between the feature values of the two backup clustering centers in the clustering group; taking the backup clustering center that needs to be moved in the clustering group as the target clustering center, and taking the clustering centers in the initial clustering centers other than the target clustering center as the other clustering centers that do not need to be moved.
[0178] In one embodiment, when the processor executes the processing logic in the computer program for adjusting the target cluster center according to the attraction parameter value, the perturbation operator, and the distance between the target cluster center and other cluster centers, to obtain the next cluster center corresponding to the target cluster center, the processor further implements the following steps: determining a target attraction value between the target cluster center and an associated cluster center according to the attraction parameter value and the distance between the target cluster center and the associated cluster center; wherein the associated cluster center is a cluster center in the other cluster centers that belongs to the same cluster group as the target cluster center; and adjusting the target cluster center according to the target attraction value, the perturbation operator, and the distance between the target cluster center and the associated cluster center, to obtain the next cluster center corresponding to the target cluster center.
[0179] In one embodiment, when the processor executes the processing logic in the computer program for clustering the user set according to the user feature of each user in the user set to be clustered based on the at least two initial cluster centers, and determining the feature value of each initial cluster center, the processor further implements the following steps: clustering the user set according to the user feature of each user in the user set to be clustered based on the at least two initial cluster centers, to obtain a clustering result corresponding to each initial cluster center; and determining the feature value of each initial cluster center according to the distance between each user in each clustering result and the corresponding initial cluster center.
[0180] In one embodiment, when the processor executes the processing logic in the computer program for clustering the user set according to the user feature of each user in the user set to be clustered based on the at least two initial cluster centers, to obtain a clustering result corresponding to each initial cluster center, the processor further implements the following steps: obtaining a feature weight vector corresponding to the user feature of each user in the user set; wherein the user feature of each user in the user set includes at least one of an identity dimension feature and an asset dimension feature; determining the distance between each initial cluster center and each user according to the feature weight vector, the user feature of each user in the user set, and each initial cluster center; and clustering the user set according to the distance between each initial cluster center and each user, to obtain a clustering result corresponding to each initial cluster center.
[0181] In one embodiment, when the processor executes the processing logic in the computer program for clustering the user set to be clustered according to the user feature of each user in the user set to be clustered based on the at least two initial cluster centers, to obtain a clustering result corresponding to each initial cluster center, the processor further implements the following steps: detecting the user feature of each user in the user set to be clustered, to determine a user feature with a special value; wherein the special value includes at least one of a missing value, an abnormal value, and a duplicate value; and performing data cleaning on the user feature with the special value.
[0182] In one embodiment, when the processor executes the processing logic in the computer program, the following steps are further implemented: the iteration end condition comprises that the eigenvalues of the initial clustering centers are all less than or equal to a preset threshold.
[0183] In one embodiment, when the processor executes the processing logic in the computer program, the following steps are further implemented: determining a difference value between the current iteration number and the maximum iteration number; determining the perturbation operator with a constant e as the base number and the ratio between the difference value and the maximum iteration number as the exponent.
[0184] In one embodiment, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the following steps:
[0185] Based on the at least two initial clustering centers, clustering the user set according to the user features of each user in the user set to be clustered, and determining eigenvalues of the initial clustering centers;
[0186] If the eigenvalues of the initial clustering centers do not satisfy the iteration end condition, determining a target clustering center to be moved and other clustering centers not to be moved from the initial clustering centers according to the eigenvalues of the initial clustering centers; wherein the iteration end condition comprises that the eigenvalues of the initial clustering centers are all less than or equal to a preset threshold;
[0187] Adjusting the target clustering center according to the attraction parameter value, the perturbation operator, and the distance between the target clustering center and the other clustering centers to obtain a next clustering center corresponding to the target clustering center; wherein the perturbation operator is determined according to the current iteration number and the maximum iteration number;
[0188] Taking the next clustering center and the other clustering centers as new initial clustering centers, and returning to execute the operation of clustering the user set according to the user features of each user in the user set to be clustered based on the initial clustering centers, until the eigenvalues of the initial clustering centers satisfy the iteration end condition, and outputting the clustering result of the user set.
[0189] In one embodiment, when the processor executes the processing logic in the computer program for determining a target clustering center to be moved and other clustering centers not to be moved from the initial clustering centers according to the eigenvalues of the initial clustering centers, the following steps are further implemented: selecting at least two standby clustering centers from the initial clustering centers; combining the standby clustering centers two by two to obtain clustering groups; determining standby clustering centers to be moved in the clustering groups according to the comparison result between the eigenvalues of the two standby clustering centers in the clustering groups; taking the standby clustering centers to be moved in the clustering groups as the target clustering center, and taking the clustering centers in the initial clustering centers except the target clustering center as the other clustering centers not to be moved.
[0190] In an embodiment, when the processing logic in the computer program for adjusting the target cluster center according to the attraction parameter value, the perturbation operator, and the distance between the target cluster center and other cluster centers to obtain the next cluster center corresponding to the target cluster center is executed by the processor, the following steps are further implemented: determining a target attraction value between the target cluster center and an associated cluster center according to the attraction parameter value and the distance between the target cluster center and the associated cluster center; wherein the associated cluster center is a cluster center belonging to the same cluster group as the target cluster center among the other cluster centers; and adjusting the target cluster center according to the target attraction value, the perturbation operator, and the distance between the target cluster center and the associated cluster center to obtain the next cluster center corresponding to the target cluster center.
[0191] In an embodiment, when the processing logic in the computer program for clustering the user set according to the user feature of each user in the user set to be clustered based on the at least two initial cluster centers and determining the feature value of each initial cluster center is executed by the processor, the following steps are further implemented: clustering the user set according to the user feature of each user in the user set to be clustered based on the at least two initial cluster centers to obtain a clustering result corresponding to each initial cluster center; and determining the feature value of each initial cluster center according to the distance between each user and the corresponding initial cluster center in each clustering result.
[0192] In an embodiment, when the processing logic in the computer program for clustering the user set according to the user feature of each user in the user set to be clustered based on the at least two initial cluster centers to obtain a clustering result corresponding to each initial cluster center is executed by the processor, the following steps are further implemented: obtaining a feature weight vector corresponding to the user feature of each user in the user set; wherein the user feature of each user in the user set includes at least one of an identity dimension feature and an asset dimension feature; determining the distance between each initial cluster center and each user according to the feature weight vector, the user feature of each user in the user set, and each initial cluster center; and clustering the user set according to the distance between each initial cluster center and each user to obtain a clustering result corresponding to each initial cluster center.
[0193] In an embodiment, when the processing logic in the computer program for clustering the user set to be clustered according to the user feature of each user in the user set to be clustered based on the at least two initial cluster centers to obtain a clustering result corresponding to each initial cluster center is executed by the processor, the following steps are further implemented: detecting the user feature of each user in the user set to be clustered to determine a user feature with a special value; wherein the special value includes at least one of a missing value, an abnormal value, and a duplicate value; and performing data cleaning on the user feature with the special value.
[0194] In one embodiment, the processing logic in the computer program, when executed by the processor, further implements the following steps: determining a difference between the current iteration number and the maximum iteration number; and determining the perturbation operator based on a ratio between the difference and the maximum iteration number with e as the base.
[0195] In one embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the following steps:
[0196] clustering the user set according to the user features of each user in the user set to be clustered based on the at least two initial clustering centers, and determining feature values of the initial clustering centers;
[0197] If the feature values of the initial clustering centers do not satisfy the iteration end condition, determining a target clustering center to be moved and other clustering centers not to be moved from the initial clustering centers according to the feature values of the initial clustering centers; wherein the iteration end condition comprises that the feature values of the initial clustering centers are all less than or equal to a preset threshold value;
[0198] adjusting the target clustering center according to the attraction parameter value, the perturbation operator, and the distance between the target clustering center and the other clustering centers to obtain a next clustering center corresponding to the target clustering center; wherein the perturbation operator is determined according to the current iteration number and the maximum iteration number;
[0199] taking the next clustering center and the other clustering centers as new initial clustering centers, and returning to implement the operation of clustering the user set according to the user features of each user in the user set to be clustered based on the initial clustering centers until the feature values of the initial clustering centers satisfy the iteration end condition, and outputting the clustering result of the user set.
[0200] In one embodiment, the processing logic in the computer program, when executed by the processor, further implements the following steps: selecting at least two backup clustering centers from the initial clustering centers; combining the backup clustering centers two by two to obtain clustering groups; determining a backup clustering center to be moved in the clustering group according to a comparison result between the feature values of the two backup clustering centers in the clustering group; taking the backup clustering center to be moved in the clustering group as the target clustering center, and taking the clustering centers in the initial clustering centers other than the target clustering center as the other clustering centers not to be moved.
[0201] In one embodiment, when the processing logic in the computer program for adjusting the target cluster center according to the attraction parameter value, the perturbation operator, and the distance between the target cluster center and other cluster centers to obtain the next cluster center corresponding to the target cluster center is executed by the processor, the following steps are further implemented: determining a target attraction value between the target cluster center and an associated cluster center according to the attraction parameter value and the distance between the target cluster center and the associated cluster center; wherein the associated cluster center is a cluster center belonging to the same cluster group as the target cluster center among the other cluster centers; and adjusting the target cluster center according to the target attraction value, the perturbation operator, and the distance between the target cluster center and the associated cluster center to obtain the next cluster center corresponding to the target cluster center.
[0202] In one embodiment, when the processing logic in the computer program for clustering the user set according to the user feature of each user in the user set to be clustered based on the at least two initial cluster centers and determining the feature value of each initial cluster center is executed by the processor, the following steps are further implemented: clustering the user set according to the user feature of each user in the user set to be clustered based on the at least two initial cluster centers to obtain a clustering result corresponding to each initial cluster center; and determining the feature value of each initial cluster center according to the distance between each user and the corresponding initial cluster center in each clustering result.
[0203] In one embodiment, when the processing logic in the computer program for clustering the user set according to the user feature of each user in the user set to be clustered based on the at least two initial cluster centers to obtain a clustering result corresponding to each initial cluster center is executed by the processor, the following steps are further implemented: obtaining a feature weight vector corresponding to the user feature of each user in the user set; wherein the user feature of each user in the user set includes at least one of an identity dimension feature and an asset dimension feature; determining the distance between each initial cluster center and each user according to the feature weight vector, the user feature of each user in the user set, and each initial cluster center; and clustering the user set according to the distance between each initial cluster center and each user to obtain a clustering result corresponding to each initial cluster center.
[0204] In one embodiment, when the processing logic in the computer program for clustering the user set to be clustered according to the user feature of each user in the user set to be clustered based on the at least two initial cluster centers to obtain a clustering result corresponding to each initial cluster center is executed by the processor, the following steps are further implemented: detecting the user feature of each user in the user set to be clustered to determine a user feature with a special value; wherein the special value includes at least one of a missing value, an abnormal value, and a duplicate value; and performing data cleaning on the user feature with the special value.
[0205] In one embodiment, the processing logic in the computer program, when executed by the processor, further implements the following steps: determining a difference between the current iteration number and the maximum iteration number; and determining the perturbation operator with a constant e as a base number and a ratio between the difference and the maximum iteration number as an index.
[0206] It should be noted that the user information (including but not limited to the user set to be clustered, user features, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties.
[0207] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments of the methods. Any reference to a memory, database or other medium used in the embodiments provided by the present application can include at least one of a non-volatile and volatile memory. The non-volatile memory can include a read-only memory (ROM), a magnetic tape, a floppy disk, a flash memory, an optical storage, a high-density embedded non-volatile memory, a resistive memory (ReRAM), a magnetoresistive random access memory (MRAM), a ferroelectric memory (FRAM), a phase change memory (PCM), a graphene memory, etc. The volatile memory can include a random access memory (RAM) or an external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as a static random access memory (SRAM) or a dynamic random access memory (DRAM), etc. The database involved in the embodiments provided by the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided by the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0208] Any technical features in the above embodiments can be combined, and for the sake of brevity, not all possible combinations are described above, however, as long as the combinations do not conflict with each other, they should be considered to be within the scope of the present disclosure.
[0209] The above embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the patent scope of the present application. It should be pointed out that for ordinary skilled persons in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A user clustering method, characterized in that, The method includes: Based on at least two initial cluster centers, the user set is clustered according to the user characteristics of each user in the user set to be clustered, and the feature values of each initial cluster center are determined. If the eigenvalues of each initial cluster center do not meet the iteration termination condition, then based on the eigenvalues of each initial cluster center, determine the target cluster center that needs to be moved and other cluster centers that do not need to be moved from each initial cluster center. Based on the attraction parameter value and the distance between the target cluster center and the associated cluster centers, a target attraction value between the target cluster center and the associated cluster centers is determined; wherein, the associated cluster centers are the cluster centers among the other cluster centers that belong to the same cluster group as the target cluster center; Based on the target attraction value, the perturbation operator, and the distance between the target cluster center and the associated cluster center, the target cluster center is adjusted to obtain the next cluster center corresponding to the target cluster center; wherein, the perturbation operator is determined based on the current iteration number and the maximum iteration number; The next cluster center and the other cluster centers are used as new initial cluster centers. The process is then repeated to perform clustering operations on the user set based on each initial cluster center and the user characteristics of each user in the user set to be clustered, until the feature values of each initial cluster center satisfy the iteration termination condition. Finally, the clustering result of the user set is output.
2. The method according to claim 1, characterized in that, The step of determining the target cluster center to be moved and other cluster centers that do not need to be moved from the initial cluster centers based on the feature values of each initial cluster center includes: Select at least two backup cluster centers from each initial cluster center; Each of the backup cluster centers is paired up to obtain cluster groups; Based on the comparison results between the feature values of two alternative cluster centers in the cluster group, determine the alternative cluster centers in the cluster group that need to be moved; The backup cluster centers that need to be moved in the cluster group are designated as target cluster centers, and the cluster centers other than the target cluster centers in each initial cluster group are designated as other cluster centers that do not need to be moved.
3. The method according to claim 1, characterized in that, The process of clustering the user set based on at least two initial cluster centers, according to the user characteristics of each user in the user set to be clustered, and determining the feature values of each initial cluster center, includes: Based on at least two initial cluster centers, the user set is clustered according to the user characteristics of each user in the user set to be clustered, and the clustering results corresponding to each initial cluster center are obtained. The feature values of each initial cluster center are determined based on the distance between each user and the corresponding initial cluster center in each clustering result.
4. The method according to claim 3, characterized in that, The process involves clustering the user set based on at least two initial cluster centers, according to the user characteristics of each user in the user set to be clustered, to obtain the clustering results corresponding to each initial cluster center, including: Obtain the feature weight vector corresponding to the user features of each user in the user set; wherein, the user features include identity dimension features and / or asset dimension features; Based on the feature weight vector, the user features of each user in the user set, and each initial cluster center, determine the distance between each initial cluster center and each user; The user set is clustered based on the distance between each initial cluster center and each user, resulting in the clustering results corresponding to each initial cluster center.
5. The method according to claim 1, characterized in that, Before clustering the user set to be clustered based on at least two initial cluster centers and according to the user characteristics of each user in the user set to be clustered, the method further includes: The user features of each user in the user set to be clustered are detected to identify user features with special values; wherein, the special values include at least one of missing values, outliers, and duplicate values; Data cleaning is performed on user characteristics with special values.
6. The method according to claim 1, characterized in that, The method further includes: Determine the difference between the current iteration number and the maximum iteration number; The perturbation operator is determined with a constant e as the base and the ratio between the difference and the maximum number of iterations as the exponent.
7. A user clustering device, characterized in that, The user clustering device is used to implement the user clustering method according to any one of claims 1-6, and the device comprises: The clustering module is used to cluster the user set based on at least two initial cluster centers, according to the user characteristics of each user in the user set to be clustered, and to determine the feature values of each initial cluster center. The judgment module is used to determine whether the feature values of each initial cluster center meet the iteration termination condition. The iteration module is used to determine the target cluster center to be moved and other cluster centers that do not need to be moved from the initial cluster centers based on the feature values of each initial cluster center if the feature values of each initial cluster center do not meet the iteration termination condition. The iteration module is further configured to adjust the target cluster center based on the attraction parameter value, the perturbation operator, and the distance between the target cluster center and the other cluster centers, to obtain the next cluster center corresponding to the target cluster center; wherein the perturbation operator is determined based on the current iteration number and the maximum iteration number; The iteration module is further configured to use the next cluster center and the other cluster centers as new initial cluster centers, and return to run the clustering module; The result output module is used to output the clustering results of the user set when the feature values of each initial cluster center satisfy the iteration termination condition.
8. 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 6.
9. 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 6.
10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Firework algorithm-based clustering method and device
CN112149703A
User clustering method and device, computer equipment and storage medium
CN116821720A