User clustering method, device, terminal equipment and storage medium
Patent Information
- Application Number
- CN202111515774.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-10
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2041-12-10
Smart Images

Figure CN114154590B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of financial technology, and in particular to a user clustering method, apparatus, terminal device and storage medium. Background Art
[0002] With the rapid development of the financial industry, people's financial consumption concepts and behaviors have changed. Customers at different levels have different financial needs. Therefore, banks need to scientifically and accurately grasp the characteristics of different customers, classify customers, and adopt differentiated business methods for different types of customers to meet customers' diverse financial needs.
[0003] The existing credit user classification method mainly classifies users according to the business stage, such as customers who have borrowed and currently have a balance, customers who have borrowed and currently have no balance, customers who have not borrowed, etc. At present, there are also classification methods based on user borrowing and repayment behavior information for clustering, mainly based on vector Kmeans clustering algorithm (K-means clustering algorithm), hierarchical clustering and other methods, by constructing multiple variables to form a one-dimensional vector, and then comparing the distance between vectors for clustering, but credit data is often flow-level information, and expressing the user's daily borrowing and repayment behavior through variable construction will result in certain information loss, resulting in inaccurate classification results. Therefore, it can be considered to use the method of constructing curves to represent, but the existing curve similarity construction method can often only measure the absolute value information of the curve node distance and ignore the curve trend related information, which will also affect the accuracy of the user classification results.
[0004] Therefore, it is necessary to propose a solution to improve the accuracy of user classification results. Summary of the invention
[0005] The main purpose of the present invention is to provide a user clustering method, apparatus, terminal device and storage medium, aiming to improve the accuracy of user classification results.
[0006] To achieve the above object, the present invention provides a user clustering method, which comprises:
[0007] Get user information;
[0008] constructing a user distribution curve according to the user information;
[0009] The slope similarities between the user distribution curves are calculated, and the users are classified according to the slope similarities between the user distribution curves.
[0010] Optionally, before the step of calculating the slope similarity between the user distribution curves and classifying the users according to the slope similarity between the user distribution curves, the step further includes:
[0011] Randomly assigning each of the user distribution curves to a number of non-empty clusters;
[0012] The category mode of each of the clusters is calculated, and each of the category modes is used to represent the corresponding cluster, so as to classify the users according to each of the clusters.
[0013] Optionally, the step of calculating the slope similarity between the user distribution curves and classifying the users according to the slope similarity between the user distribution curves includes:
[0014] Calculating the slope similarity between each of the user distribution curves and the distribution curves in each of the clusters;
[0015] Calculating the mean of each slope similarity;
[0016] Allocating each of the user distribution curves to a cluster corresponding to the smallest mean among the means;
[0017] Calculate the new category mode of each reallocated cluster, and use each new category mode to represent the corresponding reallocated cluster;
[0018] Calculating the change ratio of the cluster to which each of the user distribution curves belongs;
[0019] Whether to use the clusters to which the user distribution curves belong as the categories of the users is determined according to the change ratio.
[0020] Optionally, the step of judging whether to use the clusters to which the user distribution curves belong as the classifications of the users according to the change ratio includes:
[0021] Determining whether the change ratio is less than a preset threshold;
[0022] If the change ratio is not less than the preset threshold, the clusters to which the user distribution curves belong are not used as the classification of the user, and the process returns to the step of calculating the slope similarity between the user distribution curves and the distribution curves in the clusters;
[0023] If the change ratio is less than the preset threshold, each cluster corresponding to each user distribution curve is used as the classification of the user.
[0024] Optionally, the step of calculating the slope similarity between each of the user distribution curves and the distribution curves in each of the clusters includes:
[0025] Selecting a number of sampling points on each of the user distribution curves and the distribution curves in each of the clusters;
[0026] Calculating the slope of each sampling point and constructing a slope sequence;
[0027] The mean of the sum of squared errors between the slope sequences is calculated, and the mean of the sum of squared errors is used as the slope similarity between the user distribution curves corresponding to the slope sequences.
[0028] Optionally, the acquired user information includes the user's loan time information and loan balance information.
[0029] Optionally, the step of constructing a user distribution curve according to the user information includes:
[0030] Selecting the user information corresponding to the user at each preset time point as a preset point;
[0031] The preset points are connected to construct the user distribution curve.
[0032] In addition, to achieve the above object, the present invention further provides a user clustering device, the user clustering device comprising:
[0033] Acquisition module, used to obtain user information;
[0034] A construction module, used to construct a user distribution curve according to the user information;
[0035] The classification module is used to calculate the slope similarity between the user distribution curves and classify the users according to the slope similarity between the user distribution curves.
[0036] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal device, which includes a memory, a processor, and a user clustering program stored in the memory and executable on the processor, and the user clustering program, when executed by the processor, implements the steps of the user clustering method as described above.
[0037] In addition, to achieve the above object, the present invention further provides a computer-readable storage medium, on which a user clustering program is stored, and when the user clustering program is executed by a processor, the steps of the user clustering method described above are implemented.
[0038] The embodiment of the present invention proposes a user clustering method, apparatus, terminal device and storage medium, which obtains user information; constructs a user distribution curve according to the user information; calculates the slope similarity between each user distribution curve, and classifies users according to the slope similarity between each user distribution curve. By constructing the user distribution curve, a more comprehensive statistical analysis of user information can be performed to reduce information loss; by calculating the slope similarity between each user distribution curve, and classifying users according to the slope similarity between each user distribution curve, the curve trend information can be used to judge the similarity of the user distribution curve, so that the user classification result is more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a principle schematic diagram of a method for calculating curve distance in the prior art;
[0040] Figure 2 This is a schematic diagram of an example of calculating curve distance in the prior art;
[0041] Figure 3 This is a schematic diagram of the functional modules of the terminal device to which the user clustering device of the present invention belongs;
[0042] Figure 4 A schematic diagram of a flow chart of an exemplary embodiment of a user clustering method of the present invention;
[0043] Figure 5 A schematic diagram of a user distribution curve constructed according to the user information in an embodiment of the present invention;
[0044] Figure 6 The present invention is a schematic diagram of a detailed process of calculating the slope similarity between the user distribution curves and classifying users according to the slope similarity between the user distribution curves in an embodiment of the present invention.
[0045] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0046] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0047] The main solution of the embodiment of the present invention is: by obtaining user information; constructing a user distribution curve according to the user information; calculating the slope similarity between each of the user distribution curves, and classifying the users according to the slope similarity between each of the user distribution curves. By constructing the user distribution curve, a more comprehensive statistical analysis of the user information can be performed to reduce information loss; by calculating the slope similarity between each of the user distribution curves, and classifying the users according to the slope similarity between each of the user distribution curves, the curve trend information can be used to determine the similarity of the user distribution curves, so that the user classification result is more accurate.
[0048] Technical terms involved in the embodiments of the present invention:
[0049] Clustering: An unsupervised machine learning method that divides a population into multiple categories by evaluating the similarities between individuals in the population. In practical applications, similar interventions are used for customers in the same category.
[0050] K-means clustering algorithm: a method that assigns the mode of the category information of the K nodes closest to each node to the node, and determines the category information of all nodes through multiple iterations. The distance between two nodes is described by distance functions such as Euclidean distance and cosine distance.
[0051] sim' (Curve similarity, curve similarity function): a function that evaluates the similarity between curves. Its value can represent the similarity between curves.
[0052] Hausdorff distance: It is a distance defined between any two sets in the metric space and can be used to measure the distance between curves.
[0053] In the prior art, the method of dividing credit users is mainly to construct multiple variables to form a one-dimensional vector, and then compare the distance between the vectors for clustering. The clustering method here is mainly based on vector Kmeans clustering, hierarchical clustering and other methods. However, the present invention takes into account that credit data is often flow-level information, and the daily borrowing and repayment behavior of users is represented by variable construction, which will result in certain information loss. Therefore, the user distribution curve is constructed to fully display the user information.
[0054] After constructing the user distribution curve, users can be classified according to the similarity of each user distribution curve. Among the existing curve similarity construction methods, the most widely used is the Hausdorff distance. Figure 1 , Figure 1FIG. 1 is a schematic diagram showing the principle of a method for calculating curve distance in the prior art. Figure 1 As shown, to calculate the distance between curve A and curve B, first randomly select a point on curve A, calculate the minimum distance from the point to curve B, and then calculate the maximum distance of all sampled points, which is the Hausdorff distance. The calculation formula for this distance is:
[0055] D H (L i ,L j )=max(h(L i ,L j ), h(L j ,L i ))
[0056] in, dist(a,b) is the Euclidean distance between point a and point b.
[0057] However, the above method will ignore the shape characteristics of the curve. Figure 2 , Figure 2 FIG. 1 is a schematic diagram showing an example of calculating curve distance in the prior art. Figure 2 As shown in the figure, the curve a and curve c calculated by Hausdorff distance are closer, but from the actual curve shape, the similarity between curve a and curve b is higher. Therefore, this method can only measure the absolute value information of the curve node distance and ignore the information related to the curve trend.
[0058] The present invention provides a solution, by setting sampling points on the curve, calculating the slope of the sampling points, and constructing a slope sequence. If the slopes of the two curves are made closer by translation, then we consider that the similarity between the two curves is higher, that is, a curve similarity evaluation method based on time series translation. In order to make the calculation result more accurate, the present invention also considers the length of the slope list to be examined, and for slope lists of different lengths, the mean of the sum of squares of the slope errors of the two curves is made as small as possible, thereby achieving the purpose of reducing the calculation error and improving the accuracy of the user classification result.
[0059] Specifically, refer to Figure 3 , Figure 3 This is a functional module diagram of a terminal device to which the user clustering device of the present invention belongs. The user clustering device may be a device that is independent of the terminal device and capable of performing user clustering, and may be carried on the terminal device in the form of hardware or software. The terminal device may be an intelligent mobile terminal with data processing functions such as a mobile phone or a tablet computer, or may be a fixed terminal device or server with data processing functions.
[0060] In this embodiment, the terminal device to which the user clustering apparatus belongs includes at least an output module 110 , a processor 120 , a memory 130 and a communication module 140 .
[0061] The memory 130 stores an operating system and a user clustering program. The user clustering device can store the acquired user information, the user distribution curve constructed according to the user information, the calculated slope similarity between the user distribution curves, and the classification of users according to the slope similarity between the user distribution curves in the memory 130; the output module 110 can be a display screen, etc. The communication module 140 can include a WIFI module, a mobile communication module, a Bluetooth module, etc., and communicates with an external device or server through the communication module 140.
[0062] When the user clustering program in the memory 130 is executed by the processor, the following steps are implemented:
[0063] Get user information;
[0064] constructing a user distribution curve according to the user information;
[0065] The slope similarities between the user distribution curves are calculated, and the users are classified according to the slope similarities between the user distribution curves.
[0066] Furthermore, when the user clustering program in the memory 130 is executed by the processor, the following steps are also implemented:
[0067] Randomly assigning each of the user distribution curves to a number of non-empty clusters;
[0068] The category mode of each of the clusters is calculated, and each of the category modes is used to represent the corresponding cluster, so as to classify the users according to each of the clusters.
[0069] Furthermore, when the user clustering program in the memory 130 is executed by the processor, the following steps are also implemented:
[0070] Calculating the slope similarity between each of the user distribution curves and the distribution curves in each of the clusters;
[0071] Calculating the mean of each slope similarity;
[0072] Allocating each of the user distribution curves to a cluster corresponding to the smallest mean among the means;
[0073] Calculate the new category mode of each reallocated cluster, and use each new category mode to represent the corresponding reallocated cluster;
[0074] Calculating the change ratio of the cluster to which each of the user distribution curves belongs;
[0075] Whether to use the clusters to which the user distribution curves belong as the categories of the users is determined according to the change ratio.
[0076] Furthermore, when the user clustering program in the memory 130 is executed by the processor, the following steps are also implemented:
[0077] Determining whether the change ratio is less than a preset threshold;
[0078] If the change ratio is not less than the preset threshold, the clusters to which the user distribution curves belong are not used as the classification of the user, and the process returns to the step of calculating the slope similarity between the user distribution curves and the distribution curves in the clusters;
[0079] If the change ratio is less than the preset threshold, each cluster corresponding to each user distribution curve is used as the classification of the user.
[0080] Furthermore, when the user clustering program in the memory 130 is executed by the processor, the following steps are also implemented:
[0081] Selecting a number of sampling points on each of the user distribution curves and the distribution curves in each of the clusters;
[0082] Calculating the slope of each sampling point and constructing a slope sequence;
[0083] The mean of the sum of squared errors between the slope sequences is calculated, and the mean of the sum of squared errors is used as the slope similarity between the user distribution curves corresponding to the slope sequences.
[0084] Furthermore, when the user clustering program in the memory 130 is executed by the processor, the following steps are also implemented:
[0085] Selecting the user information corresponding to the user at each preset time point as a preset point;
[0086] The preset points are connected to construct the user distribution curve.
[0087] This embodiment adopts the above scheme, specifically by obtaining user information; constructing a user distribution curve according to the user information; calculating the slope similarity between each of the user distribution curves, and classifying the users according to the slope similarity between each of the user distribution curves. By constructing the user distribution curve, a more comprehensive statistical analysis of the user information can be performed to reduce information loss; by calculating the slope similarity between each of the user distribution curves, and classifying the users according to the slope similarity between each of the user distribution curves, the curve trend information can be used to determine the similarity of the user distribution curves, so that the user classification result is more accurate.
[0088] Based on the above terminal device architecture but not limited to the above architecture, an embodiment of the method of the present invention is proposed.
[0089] The execution subject of the method of this embodiment may be a user clustering device or a terminal device, etc. This embodiment takes a user clustering device as an example.
[0090] Reference Figure 4 , Figure 4 The following is a flow chart of an exemplary embodiment of a user clustering method of the present invention. The user clustering method comprises:
[0091] Step S10, obtaining user information;
[0092] After a bank user opens an account, his / her loan balance will change over time. At this time, users can be classified according to the flow information of their credit data, so as to adopt differentiated management methods for different types of customers. User information can be directly retrieved through the bank's internal system, and the obtained user information includes the user's loan time information and loan balance information.
[0093] Step S20, constructing a user distribution curve according to the user information;
[0094] Selecting the user information corresponding to the user at each preset time point as a preset point;
[0095] The preset points are connected to construct the user distribution curve.
[0096] Reference Figure 5 , Figure 5 FIG. 1 is a schematic diagram of a user distribution curve constructed according to the user information in an embodiment of the present invention. Figure 5 As shown, the horizontal axis of the user distribution curve is the user's loan time, and the vertical axis is the user's loan balance information. The time interval selected in the embodiment of the present invention is 30 days, and the user distribution curve is formed by counting the user's loan balance information every 30 days.
[0097] Step S30, calculating the slope similarity between the user distribution curves, and classifying the users according to the slope similarity between the user distribution curves.
[0098] After constructing the user distribution curve according to the user information, the users can be clustered according to the similarity of the user curves. In the embodiment of the present invention, it is proposed to cluster the users by using the similarity of the slope of the curve.
[0099] Specifically, the distribution curves of all users can be randomly assigned to k non-empty clusters. A cluster is a set of samples generated by clustering. Samples in the same cluster are similar to each other and different from samples in other clusters. Then the category mode of each cluster is calculated, and the category of the mode represents the corresponding cluster. The category can be to divide users into recurring borrowers and lost users according to their loan balances, or to classify users into other categories, such as classifying users' purchasing tendencies and purchasing abilities according to their information on purchasing financial products.
[0100] Furthermore, after obtaining the category of the cluster to which each user distribution curve belongs, the user distribution curve can be assigned to the closest cluster by calculating the mean of the slope similarity between each user distribution curve and the curves in each cluster. Then, the category mode of each reallocated cluster is calculated, and the new category mode is used to represent each corresponding cluster.
[0101] The above process of clustering the user distribution curves according to the slope similarity and representing each cluster with the category mode is repeated until the category change ratio of all distribution curves is less than a certain threshold, and then the clusters to which the user distribution curves belong can be used as the classification of the user.
[0102] In this embodiment, user information is obtained; a user distribution curve is constructed according to the user information; the slope similarity between each of the user distribution curves is calculated, and users are classified according to the slope similarity between each of the user distribution curves. By constructing the user distribution curve, a more comprehensive statistical analysis of the user information can be performed to reduce information loss; by calculating the slope similarity between each of the user distribution curves and classifying the users according to the slope similarity between each of the user distribution curves, the similarity of the user distribution curves can be determined by using the curve trend information, so that the result of user classification is more accurate.
[0103] Reference Figure 6 , Figure 6 1 is a schematic diagram of a detailed process of calculating the slope similarity between the user distribution curves and classifying users according to the slope similarity between the user distribution curves in an embodiment of the present invention. Figure 4 In the embodiment shown, in this embodiment, the above step S30, the step of calculating the slope similarity between the user distribution curves, and dividing the users according to the slope similarity between the user distribution curves includes:
[0104] Step S301, calculating the slope similarity between each of the user distribution curves and the distribution curves in each of the clusters;
[0105] Specifically, first, k sampling points are selected on each of the user distribution curves and the distribution curves in each of the clusters, where k is a positive integer greater than or equal to 1.
[0106] Calculating the slope of each sampling point and constructing a slope sequence;
[0107] The slope can also be called the angular coefficient, which can reflect the angle of the user distribution curve. The calculation method of the slope of a point on the curve includes: first find the derivative of the function corresponding to the curve, and then substitute the horizontal coordinate of the point on the curve into the derivative function relationship. The function value obtained is the slope of the point on the curve. Another method is to draw a tangent through the sampling point on the curve and find the slope of the tangent. The slope of the tangent is the slope of the curve at the sampling point. After calculating the slope of the curve at each sampling point, construct the slope of each sampling point into a slope sequence {k1, k2, …, k n}.
[0108] Calculating a mean of the sum of squared errors between the slope sequences, and using the mean of the sum of squared errors as the slope similarity between the user distribution curves corresponding to the slope sequences;
[0109] The error sum of squares is also called the residual sum of squares, the within-group sum of squares, etc. It can be used to test the differences between samples. By calculating the mean of the error sum of squares, the similarity judgment between user distribution curves can be made more accurate. After constructing the slope sequence corresponding to each user distribution curve, the mean of the error sum of squares between each slope sequence is calculated, and the mean of the error sum of squares can be used as the slope similarity between the user distribution curves corresponding to the slope sequence.
[0110] Specifically, the slope similarity is calculated based on the curve distance evaluation method based on time series translation, and the translation length is set to L i , where L i ={l1,l2,l3,…,l m}, the calculation method is:
[0111] Where n is the length of the slope sequence and m is the number of adjacent sampling points.
[0112] Step S302, calculating the mean of the slope similarities;
[0113] The calculated slope similarities are averaged, and an arithmetic mean, a geometric mean, a square mean, a harmonic mean, and a weighted mean may be used. In the embodiment of the present invention, the arithmetic mean of the slope similarities is calculated.
[0114] Step S303, assigning each of the user distribution curves to a cluster corresponding to the smallest mean among the means;
[0115] After calculating the mean of the slope similarity between the user distribution curve and the distribution curves in each cluster, the cluster with the smallest mean is selected, and the user distribution curve is assigned to the corresponding cluster with the smallest mean, thereby realizing the redistribution of the distribution curves of each cluster.
[0116] Step S304, calculating a new category mode of each reallocated cluster, and using each new category mode to represent the corresponding reallocated cluster;
[0117] The categories of each distribution curve in the reallocated clusters are statistically analyzed, the mode of the category of each user distribution curve in each cluster is calculated, and the mode of each category is selected to represent the corresponding reallocated cluster.
[0118] Step S305, calculating the change ratio of the cluster to which each of the user distribution curves belongs;
[0119] Percent change is a concept used to describe the relationship between an old value or quantity and a new value or quantity. The percentage change value is specifically used to express the difference between the new value and the old value as a percentage of the old value. For example, V1 represents the old value or initial value, and V2 represents the new value or current value. The percentage change is expressed by the equation ((V2-V1) / V1)×100. By calculating the ratio of the category change of the cluster after each user distribution curve is reallocated to the category change of the cluster before the allocation, the degree of change of the cluster to which the user distribution curve belongs after each re-clustering can be obtained, that is, the degree of change of the category of the user distribution curve. When the category change degree of the user distribution curve is less than the preset threshold, it can be considered that the user classification hardly changes, and the user classification is completed.
[0120] Step S306: determining, according to the change ratio, whether to use the clusters to which the user distribution curves belong as categories of the users.
[0121] Determining whether the change ratio is less than a preset threshold;
[0122] After calculating the change ratio of the cluster to which each user distribution curve belongs, the obtained change ratio is compared with a preset threshold to determine whether it is less than the preset threshold. In the embodiment of the present invention, the preset threshold of the change ratio is 1%.
[0123] If the change ratio is not less than the preset threshold, the clusters to which the user distribution curves belong are not used as the classification of the user, and the process returns to the step of calculating the slope similarity between the user distribution curves and the distribution curves in the clusters;
[0124] If the category change ratio of the cluster to which the user distribution curve belongs is greater than or equal to 1%, it means that the cluster to which each user distribution curve belongs has changed greatly after reallocation, and the classification result is not accurate enough, and it is necessary to continue to reallocate each user distribution curve, and return to execute steps S301 to S306 until the category change ratio of the cluster to which all user distribution curves belong is less than 1%.
[0125] If the change ratio is less than the preset threshold, each cluster corresponding to each user distribution curve is used as the classification of the user.
[0126] If the category change ratio of the cluster to which the user distribution curve belongs is less than 1%, it means that the cluster to which each user distribution curve belongs is basically fixed and the degree of change is extremely small and can be ignored. Then the category of the cluster to which each user distribution curve belongs is the category of the corresponding user, and the user classification result is more accurate.
[0127] In addition, the curve similarity clustering method proposed in the embodiment of the present invention can also be applied to other fields, such as classifying the interest features of users within a period of time.
[0128] This embodiment uses the above scheme to specifically calculate the mean of the slope similarity between each user distribution curve and the curves in each cluster, and assigns the user distribution curve to the closest cluster. Then calculate the category mode of each reallocated cluster, and use the new category mode to represent each corresponding cluster. Repeat the process of clustering the user distribution curve according to the slope similarity and representing each cluster with the category mode until the category change ratio of all distribution curves is less than a certain threshold, then the clusters to which each user distribution curve belongs can be used as the classification of the user. By calculating the slope similarity of the curve, the curve can be clustered according to the trend of the curve, and then the user can be classified, thereby improving the accuracy of the user classification result. The method of clustering based on curve similarity is also applicable to other fields, providing an effective reference for clustering methods in other fields.
[0129] In addition, an embodiment of the present invention further provides a user clustering device, the user clustering device comprising:
[0130] Acquisition module, used to obtain user information;
[0131] A construction module, used to construct a user distribution curve according to the user information;
[0132] The classification module is used to calculate the slope similarity between the user distribution curves and classify the users according to the slope similarity between the user distribution curves.
[0133] The acquisition module obtains the credit information of users in a period of time from the bank system, and then the construction module constructs the user distribution curve according to the obtained user information. Then, the classification module first calculates the slope similarity between the user distribution curves, and classifies the users according to the slope similarity between the user distribution curves. In the calculation process of the slope similarity of the user distribution curve, the sampling points can be set on the curve first, and then the slope of the sampling points can be calculated, and the slope sequence can be constructed. The curve distance evaluation method based on the time series translation is used. After multiple experiments, the translation length is set to Li, where Li = {l1, l2, l3…, l m The main idea is that if the slopes of the two curves are closer by translation, then we think the distance between the two curves is smaller. In order to make the calculation result more accurate, this algorithm also considers the length of the slope list under consideration. For slope lists of different lengths, the mean of the sum of squared slope errors of the two curves is made as small as possible, thereby achieving the purpose of reducing the calculation error.
[0134] Specifically, the algorithm for clustering users is as follows:
[0135] (1) Randomly assign the distribution curves of all customers to k non-empty clusters.
[0136] Specifically, the distribution curves of all users are first randomly assigned to k non-empty clusters, where a cluster is a set of samples generated by clustering. Samples in the same cluster are similar to each other and different from samples in other clusters.
[0137] (2) Calculate the category mode of each cluster and use the mode to represent the corresponding cluster.
[0138] Then, the category mode of each cluster is calculated, and the category of the mode is used to represent the corresponding cluster. The category can be to classify users into revolving borrowers and lost users according to their loan balances, or to classify users into other categories, for example, to classify users' purchasing tendencies and purchasing abilities according to their information on purchasing financial products.
[0139] (3) Calculate the mean sim' similarity between each distribution curve and the curves in each cluster, and assign the distribution curve to the nearest cluster.
[0140] Furthermore, after obtaining the category of the cluster to which each user distribution curve belongs, the user distribution curve can be assigned to the closest cluster by calculating the mean of the slope similarity between each user distribution curve and the curves in each cluster. Then, the category mode of each reallocated cluster is calculated, and the new category mode is used to represent each corresponding cluster.
[0141] (4) Then go to (2). This process is repeated until the category change ratio of all distribution curves is less than a certain threshold.
[0142] The above process of clustering the user distribution curves according to the slope similarity and representing each cluster with the category mode is repeated until the category change ratio of all distribution curves is less than a certain threshold, and then the clusters to which the user distribution curves belong can be used as the classification of the user.
[0143] This embodiment adopts the above scheme, specifically by obtaining the credit information of the user within a period of time, and then constructing the user distribution curve according to the obtained user information through the construction module, and then calculating the slope similarity between the user distribution curves through the classification module, and classifying the users according to the slope similarity between the user distribution curves. By constructing the user distribution curve to cluster the users, rather than vector clustering, the user's flow information is effectively used to reduce the loss of user information, and a method of clustering based on curve slope similarity is proposed. The curves are clustered according to the trend information of the curves, and the similarity between the two curves can be evaluated from the perspective of the curve shape, avoiding the problem that the traditional curve clustering method can only measure the absolute value information of the curve node distance and ignore the curve trend related information, and improves the accuracy of the classification result.
[0144] In addition, an embodiment of the present invention also proposes a terminal device, which includes a memory, a processor, and a user clustering program stored in the memory and executable on the processor, wherein the user clustering program implements the steps of the user clustering method described above when executed by the processor.
[0145] Since the user clustering program adopts all the technical solutions of all the aforementioned embodiments when executed by the processor, it has at least all the beneficial effects brought by all the technical solutions of all the aforementioned embodiments, which will not be described one by one here.
[0146] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a user clustering program is stored. When the user clustering program is executed by a processor, the steps of the user clustering method described above are implemented.
[0147] Since the user clustering program adopts all the technical solutions of all the aforementioned embodiments when executed by the processor, it has at least all the beneficial effects brought by all the technical solutions of all the aforementioned embodiments, which will not be described one by one here.
[0148] Compared with the prior art, the user clustering method, device, terminal device and storage medium proposed in the embodiment of the present invention obtain user information; construct a user distribution curve according to the user information; calculate the slope similarity between each user distribution curve, and classify the users according to the slope similarity between each user distribution curve. Users are clustered by constructing a user distribution curve instead of vector clustering, and the user's flow information is effectively used, so that a more comprehensive statistical analysis of user information can be performed to reduce the loss of user information; and a method of clustering based on curve slope similarity is proposed, which clusters curves according to the trend information of the curves, and can evaluate the similarity between two curves from the perspective of curve shape, avoiding the problem that the traditional curve clustering method can only measure the absolute value information of the curve node distance and ignore the information related to the curve trend, thereby improving the accuracy of the classification results.
[0149] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0150] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0151] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, a controlled terminal, or a network device, etc.) to execute the method of each embodiment of the present application.
[0152] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A user clustering method, characterized in that: The user clustering method comprises the following steps: Get user information; constructing a user distribution curve according to the user information; Calculating the slope similarity between the user distribution curves, and classifying the users according to the slope similarity between the user distribution curves; Before the step of calculating the slope similarity between the user distribution curves and classifying the users according to the slope similarity between the user distribution curves, the method further includes: Randomly assigning each of the user distribution curves to a number of non-empty clusters; Calculating the category mode of each of the clusters, and using each of the category modes to represent the corresponding cluster, so as to classify the user according to each of the clusters; The step of calculating the slope similarity between the user distribution curves and classifying the users according to the slope similarity between the user distribution curves comprises: Calculating the slope similarity between each of the user distribution curves and the distribution curves in each of the clusters; Calculating the mean of each slope similarity; Allocating each of the user distribution curves to a cluster corresponding to the smallest mean among the means; Calculate the new category mode of each reallocated cluster, and use each new category mode to represent the corresponding reallocated cluster; Calculating the change ratio of the cluster to which each of the user distribution curves belongs; Whether to use the clusters to which the user distribution curves belong as the categories of the users is determined according to the change ratio.
2. The user clustering method according to claim 1, characterized in that: The step of judging whether to use the clusters to which the user distribution curves belong as the classification of the users according to the change ratio comprises: Determining whether the change ratio is less than a preset threshold; If the change ratio is not less than the preset threshold, the clusters to which the user distribution curves belong are not used as the classification of the user, and the process returns to the step of calculating the slope similarity between the user distribution curves and the distribution curves in the clusters; If the change ratio is less than the preset threshold, each cluster corresponding to each user distribution curve is used as the classification of the user.
3. The user clustering method according to claim 1, characterized in that: The step of calculating the slope similarity between each of the user distribution curves and the distribution curves in each of the clusters comprises: Selecting a number of sampling points on each of the user distribution curves and the distribution curves in each of the clusters; Calculating the slope of each sampling point and constructing a slope sequence; The mean of the sum of squared errors between the slope sequences is calculated, and the mean of the sum of squared errors is used as the slope similarity between the user distribution curves corresponding to the slope sequences.
4. The user clustering method according to claim 1, characterized in that: The obtained user information includes the user's loan time information and loan balance information.
5. The user clustering method according to claim 1, characterized in that: The step of constructing a user distribution curve according to the user information comprises: Selecting the user information corresponding to the user at each preset time point as a preset point; The preset points are connected to construct the user distribution curve.
6. A user clustering device, characterized in that: The user clustering device comprises: Acquisition module, used to obtain user information; A construction module, used to construct a user distribution curve according to the user information; A classification module, used for calculating the slope similarity between the user distribution curves, and classifying users according to the slope similarity between the user distribution curves; Before calculating the slope similarity between the user distribution curves and classifying the users according to the slope similarity between the user distribution curves, the method further includes: Randomly assigning each of the user distribution curves to a number of non-empty clusters; Calculating the category mode of each of the clusters, and using each of the category modes to represent the corresponding cluster, so as to classify the user according to each of the clusters; The calculating the slope similarity between the user distribution curves and classifying the users according to the slope similarity between the user distribution curves comprises: Calculating the slope similarity between each of the user distribution curves and the distribution curves in each of the clusters; Calculating the mean of each slope similarity; Allocating each of the user distribution curves to a cluster corresponding to the smallest mean among the means; Calculate the new category mode of each reallocated cluster, and use each new category mode to represent the corresponding reallocated cluster; Calculating the change ratio of the cluster to which each of the user distribution curves belongs; Whether to use the clusters to which the user distribution curves belong as the categories of the users is determined according to the change ratio.
7. A terminal device, characterized in that: The terminal device includes a memory, a processor, and a user clustering program stored in the memory and executable on the processor. When the user clustering program is executed by the processor, the steps of the user clustering method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a user clustering program, and when the user clustering program is executed by a processor, the steps of the user clustering method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
An integrated power load curve clustering method
CN109272058A
Electric energy meter quality monitoring method
CN111027642A
Load curve form clustering method based on piecewise slope
CN111311431A
Customer data processing method and device, computer equipment and storage medium
CN111369121A
Weather data processing method, server and computer-readable storage medium
WO2019153599A1
