An adaptive neighborhood granular clustering method suitable for mixed attribute data

By combining the K-means clustering algorithm and granular computing, the adaptive neighborhood granular clustering method processes mixed attribute data, solves the stability and applicability problems of traditional algorithms, and realizes efficient clustering of mixed attribute data.

CN119961708BActive Publication Date: 2025-10-17ANHUI UNIVERSITY OF TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510039810.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-10-17
Estimated Expiration
2045-01-10

AI Technical Summary

Technical Problem

The traditional K-means clustering algorithm can only process numerical attribute data and the clustering results are unstable, and it cannot effectively process mixed attribute data.

Method used

Combining the K-means clustering algorithm and granular computing, the adaptive neighborhood granular clustering method is used to calculate the neighborhood granular vector and select the initial cluster center. The neighborhood granular K-means clustering algorithm is used to update the cluster center to achieve granulation of mixed attribute data.

Benefits of technology

The stability and applicability of the algorithm are improved, mixed attribute data can be effectively processed, the inaccurate measurement of data dissimilarity caused by different dimensions is avoided, and clustering performance is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119961708B_ABST
    Figure CN119961708B_ABST
Patent Text Reader

Abstract

The application discloses a self-adaptive neighborhood granular clustering method suitable for mixed attribute data and belongs to the technical field of machine learning. In view of the problems that the traditional K-means clustering algorithm can only process numerical attribute data and the clustering result is unstable in the prior art, the application provides a self-adaptive neighborhood granular clustering method suitable for mixed attribute data, which comprises the following steps: S1, obtaining and inputting to-be-clustered data; S2, calculating neighborhood granular vectors of the to-be-clustered data by the self-adaptive neighborhood granular clustering method of mixed attribute data; S3, selecting initial clustering centers of the to-be-clustered data based on a dissimilarity measurement method of data; S4, updating the clustering centers by using a neighborhood granular K-means clustering algorithm; and S5, outputting a clustering result. Thus, the K-means clustering algorithm and granular computing are combined, mixed attribute data granulation is realized, and the self-adaptive neighborhood granular clustering method has the excellent characteristics of high applicability and high clustering performance.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of machine learning, and more particularly, to an adaptive neighborhood granular clustering method suitable for mixed attribute data. BACKGROUND

[0002] Clustering is an unsupervised analysis method that can be used to mine the internal structure or pattern of data. As one of the research hotspots in various disciplines, clustering is widely used in marketing analysis, natural language processing, image processing, bioinformatics, computer vision and other fields. In practical applications, mixed attribute data with both numerical and symbolic attributes is ubiquitous. The traditional K-means clustering algorithm can only process data with numerical attributes, and the initial clustering center of the K-means clustering algorithm is randomly selected, which leads to unstable clustering results. SUMMARY

[0003] 1. Technical problem to be solved

[0004] In view of the problems in the prior art that the traditional K-means clustering algorithm can only process data with numerical attributes and the clustering results are unstable, the present application provides an adaptive neighborhood granular clustering method suitable for mixed attribute data, which combines the K-means clustering algorithm and granular computing to realize granulation of mixed attribute data, and has the excellent characteristics of strong applicability and high clustering performance.

[0005] 2. Technical scheme

[0006] The object of the present application is achieved by the following technical scheme.

[0007] An adaptive neighborhood granular clustering method suitable for mixed attribute data, comprising the following steps:

[0008] S1, obtaining and inputting data to be clustered;

[0009] S2, calculating the neighborhood granular vector of the data to be clustered by the adaptive neighborhood granular clustering method of mixed attribute data;

[0010] S3, selecting the initial clustering center of the data to be clustered based on the dissimilarity measurement method of data;

[0011] S4, updating the clustering center by using the neighborhood granular K-means clustering algorithm;

[0012] S5, outputting the clustering result.

[0013] As a further improvement of the present application, in step S1, the data to be clustered includes a sample set and an attribute set, and the attribute set includes numerical attributes and symbolic attributes.

[0014] As a further improvement of the present application, in step S2, the neighborhood granular vector of the data to be clustered is calculated, and the steps include:

[0015] The average value of attribute difference of the numerical attribute is calculated, and the neighborhood of the numerical attribute is determined based on the average value of attribute difference;

[0016] The neighborhood of the symbolic attribute is determined;

[0017] The neighborhood granular vector of the different mixed attribute data is calculated through the neighborhood of the numerical attribute and the neighborhood of the symbolic attribute.

[0018] As a further improvement of the present application, the neighborhood of the numerical attribute is determined based on the average value of attribute difference, and the determination formula is:

[0019]

[0020] Wherein, i and j represent natural numbers, N represents the number of samples, n represents the numerical attribute feature, r represents the hyper parameter, a represents the attribute, x i represents the i-th sample, x ia represents the value of the i-th sample on the attribute a, x ja represents the value of the j-th sample on the attribute a, represents the neighborhood granular vector of the i-th sample on the attribute a, represents the neighborhood determination value of the j-th sample, represents the neighborhood determination formula of the numerical attribute, represents the Euclidean distance between any two samples on the attribute a, and dis(a) represents the average value of attribute difference.

[0021] As a further improvement of the present application, the neighborhood of the symbolic attribute is determined, and the determination formula is:

[0022]

[0023] Wherein, c represents the symbolic attribute feature, b represents the attribute, x ib represents the value of the i-th sample on the attribute b, x jb represents the value of the j-th sample on the attribute b, represents the neighborhood granular vector of x i on the attribute b, represents the neighborhood determination value of the j-th sample, represents the neighborhood determination formula of the symbolic attribute.

[0024] As a further improvement of the present application, the neighborhood granular vector of the different mixed attribute data is represented as:

[0025] G={G A (x1),GA (x2),...,G A (x N )}

[0026]

[0027] where G represents the neighborhood granular vector of the whole data to be clustered, G A (x N ) represents the neighborhood granular vector of x N on attribute A, and T represents the matrix transpose.

[0028] As a further improvement of the present application, in step S3, the data-based dissimilarity measure method selects the initial clustering center of the data to be clustered, and the steps thereof include:

[0029] S31: based on the neighborhood granular vector, the dissimilarity matrix and the overall dissimilarity of the data to be clustered are calculated;

[0030] S32: the number of neighborhood granular vectors in each row of the dissimilarity matrix whose value is less than and equal to m times the overall dissimilarity is calculated, and a matrix is constructed;

[0031] S33: the first initial clustering center point, i.e., the neighborhood granular vector corresponding to the maximum value in the matrix, is selected, and the matrix is updated;

[0032] S34: it is judged whether the dissimilarity between the neighborhood granular vector corresponding to the maximum value in the matrix and the initial clustering center satisfies the condition, if yes, the neighborhood granular vector corresponding to the maximum value is selected as the clustering center, and the matrix is updated; if not, the matrix is updated, and the step is repeated; the condition is expressed as: D(G A (x j ),u p )≥Tdis,(p=1,2,...,s),G A (x j ) represents the neighborhood granular vector of x j on attribute A, p represents a natural number, u p represents the clustering center vector, s represents the number of clustering centers, and Tdis represents the overall dissimilarity.

[0033] S35: the number of clustering clusters is set, and it is judged whether the number of clustering centers satisfies the number of clustering clusters, if yes, the initial clustering center point is obtained.

[0034] As a further improvement of the present application, the overall dissimilarity of the data to be clustered is expressed as:

[0035]

[0036] Among them, Tdis represents the overall dissimilarity, N represents the total number of neighborhood particle vectors, x and y represent any two samples in the data set to be clustered, G A (x) represents the neighborhood particle vector of x on attribute A, G A (y) represents the neighborhood particle vector of y on attribute A, and ρ represents the hyperparameter.

[0037] As a further improvement of the present invention, in step S4, the step of running the neighborhood particle K-means clustering algorithm to update the cluster center includes:

[0038] S41, calculating the distance between all neighborhood particle vectors and the selected cluster center, classifying the i-th sample into the category corresponding to the minimum distance, and updating the category;

[0039] S42, calculating the new cluster center point of the category;

[0040] S43. Determine whether the difference between the objective functions during two iterations is less than a set threshold or whether the maximum number of iterations is reached. If the conditions are met, output the clustering result. If the conditions are not met, repeat steps S41-S43.

[0041] As a further improvement of the present invention, the objective function is expressed as:

[0042]

[0043] Among them, J e represents the objective function, j represents a natural number, k represents the number of clusters, C j Indicates the category, u j Represents the mean particle vector of the class.

[0044] 3. Beneficial effects

[0045] Compared with the prior art, the advantages of the present invention are:

[0046] The present invention is an adaptive neighborhood granular clustering method suitable for mixed attribute data, which combines the K-means clustering algorithm and granular computing, takes into account the different densities of different numerical attribute data, and realizes the granulation of mixed attribute data through the adaptive neighborhood granulation method of mixed attribute data, effectively avoiding the problem of inaccurate data dissimilarity measurement caused by different dimensions of numerical attribute data and symbolic attribute data. Furthermore, based on the neighborhood particle vectors of the data granulation, a newly defined data dissimilarity measurement method is used to select the initial cluster center. Finally, the neighborhood particle K-means clustering algorithm is combined to obtain the clustering result of the data, which effectively improves the stability of the algorithm and has the excellent characteristics of strong applicability and high clustering performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1This is a flow chart of a method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0048] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0049] Example

[0050] like Figure 1 As shown, an adaptive neighborhood particle clustering method for mixed attribute data provided by this embodiment includes the following steps: S1, obtaining and inputting the data to be clustered; S2, calculating the neighborhood particle vectors of the data to be clustered by the adaptive neighborhood particle clustering method for mixed attribute data; S3, selecting the initial cluster centers of the data to be clustered based on the data dissimilarity measurement method; S4, updating the cluster centers using the neighborhood particle K-means clustering algorithm; S5, outputting the clustering results.

[0051] Specifically in this embodiment, step S1, obtain and input the data to be clustered. In this embodiment, the data set to be clustered N = (X, A), where X represents the sample set, X = {x1, x2, ..., x N}, A represents the attribute set, A={a1,a2,...,a p , a p+1 ,...,a m In this embodiment, the attribute set includes numerical attributes and symbolic attributes. For attribute set A, {a1, a2, ..., a p} is a numerical attribute, {a p+1 ,...,a m} is a symbolic attribute.

[0052] It should be noted that in this embodiment, the algorithm parameters need to be initialized. That is, the number of clusters k, hyperparameters r and ρ, the number of iterations t = 0, the maximum number of iterations Iters = 50, and the loss function J are pre-set. e The change threshold VCJT = 0.001.

[0053] Step S2, calculates the neighborhood particle vectors of the data to be clustered by an adaptive neighborhood particle clustering method for mixed attribute data, and the steps include: calculating the average value of the attribute difference of the numerical attribute, and judging the neighborhood of the numerical attribute based on the average value of the attribute difference; judging the neighborhood of the symbolic attribute; and calculating the neighborhood particle vectors of different mixed attribute data through the neighborhood of the numerical attribute and the neighborhood of the symbolic attribute.

[0054] Specifically, in this embodiment, for a numerical attribute a∈{a1, a2, ..., a p}, calculate the average attribute difference dis(a) of the numerical attribute on attribute a, and the calculation formula is:

[0055]

[0056] where a denotes an attribute, dis(a) denotes the average of attribute difference, N denotes the number of samples, i and j denote natural numbers, x ia denotes the value of the i-th sample on attribute a, x ja denotes the value of the j-th sample on attribute a.

[0057] Further, the neighborhood of a numerical attribute is determined based on the average of attribute difference, and the determination formula is:

[0058]

[0059] where i and j denote natural numbers, N denotes the number of samples, n denotes the feature of a numerical attribute, r denotes a hyperparameter, a denotes an attribute, a∈{a1,a2,...,a m}, x i denotes the i-th sample, x ia denotes the value of the i-th sample on attribute a, x ja denotes the value of the j-th sample on attribute a, denotes the neighborhood particle vector of x i on attribute a, denotes the neighborhood determination value of the j-th sample, denotes the neighborhood determination formula of a numerical attribute, used to determine whether x ia and x ja are adjacent on attribute a, dis(a) denotes the average of attribute difference. In this embodiment, if then x ia and x ja are adjacent, otherwise not adjacent.

[0060] The neighborhood of a symbolic attribute is determined, and the determination formula is:

[0061]

[0062] where c denotes the feature of a symbolic attribute, b denotes an attribute, b∈{a1,a2,...,a m}, x ib denotes the value of the i-th sample on attribute b, x jb denotes the value of the j-th sample on attribute b, denotes the neighborhood particle vector of x i on attribute b, denotes the neighborhood determination value of the j-th sample, denotes the neighborhood determination formula of a symbolic attribute, used to determine whether x ib and x jbAre they adjacent in attribute b? In this embodiment, if Then it means x ib and x jb adjacent, otherwise not adjacent.

[0063] Furthermore, the neighborhood particle vectors of different mixed attribute data are calculated by the neighborhood of the numerical attribute and the neighborhood of the symbolic attribute. In this embodiment, the neighborhood particle vectors of different mixed attribute data are expressed as:

[0064] G={G A (x1),G A (x2),...,G A (x N )}

[0065]

[0066] Among them, G represents the neighborhood particle vector of the entire data to be clustered, G A (x N ) represents x N Neighborhood particle vector on attribute A, T represents matrix transpose.

[0067] Step S3, selecting the initial cluster center of the data to be clustered based on the data dissimilarity measurement method, which includes:

[0068] S31: Based on the neighborhood particle vectors, calculate the dissimilarity matrix and overall dissimilarity of the data to be clustered. In this embodiment, the calculation formula of the dissimilarity matrix of the data to be clustered is:

[0069]

[0070] Where disM represents the dissimilarity matrix, N represents a natural number, D(G A (x i ), G A (x j )) represents the neighborhood particle vector x i and x j The difference.

[0071] Furthermore, the overall dissimilarity of the data to be clustered is calculated using the following formula:

[0072]

[0073] Here, Tdis represents the total dissimilarity. At this point, the number of cluster centers has been selected for initialization, and the number of cluster centers s is set to 0.

[0074] S32: Calculate the number of neighborhood particle vectors whose median value of each row of data in the dissimilarity matrix is ​​less than or equal to m times the overall dissimilarity, and construct the matrix. Specifically, select m = 0.25, calculate the number of neighborhood particle vectors whose median value of each row of data in the dissimilarity matrix disM is ≤ 0.25*Tdis, and construct the matrix Counts, Counts = [counts(x1), counts(x2), ..., counts(x N )],counts(x i ) That is, the data in row i of the dissimilarity matrix disM satisfies the condition: D(G A (x i ), G A (x j ))≤0.25*Tdis, the number of data (j=1,…,N).

[0075] S33: Select the first initial cluster center point u i , that is, the maximum value counts(x i ) corresponds to the neighborhood particle vector G A (x i ), update the matrix Counts, counts(x i )=0, let the number of cluster centers s=s+1.

[0076] S34: Determine the maximum value of the matrix Counts counts(x j ) corresponds to the neighborhood particle vector G A (x j ) and the initial cluster center to meet the conditions, if the conditions are met, then select the maximum value counts(x j ) corresponds to the neighborhood particle vector G A (x j ) as the s+1th cluster center, update the matrix Counts, counts(x j )=0, the number of cluster centers s=s+1; if the condition is not met, update the matrix Counts and repeat the step; the condition is expressed as: D(G A (x j ),u p )≥Tdis, (p=1, 2,...,s), G A (x j ) represents x j The neighborhood particle vector on attribute A, p represents a natural number, u p represents the cluster center vector, s represents the number of cluster centers, and Tdis represents the overall dissimilarity.

[0077] S35: Set the number of clusters k, and determine whether the cluster center s satisfies the number of clusters k. If so, the initial cluster center point {u1, u2, ..., u s}.

[0078] It is worth noting that, in this embodiment, for the overall dissimilarity Tdis of the data to be clustered, we have:

[0079]

[0080] in,

[0081]

[0082] G A (x)∨G A (y)=(g i (x)∨g1(y), g2(x)∨g2(y),...,g m (x)∨g m (y))

[0083] G A (x)∧G A (y)=(g1(x)∧g1(y),g2(x)∧g2(y),...,g m (x)∧g m (y))

[0084] G A (x)-G A (y)=(g1(x)-g1(y), g2(x)-g2(y),...,g m (x)-g m (y))

[0085]

[0086] Step S4, using the neighborhood particle K-means clustering algorithm to update the cluster center, the steps include:

[0087] S41. Calculate all neighborhood particle vectors G A (x i ) and the selected cluster center u j The distance d of (j=1, 2, ..., s) ij , d ij =D(G A (x i ),u j ), x i Paddle to the minimum distance d ij In the corresponding category, update category C j , C j =C j∪x i .

[0088] S42, calculating the category C j new cluster center point, wherein, |C j | represents the number of data points in the category C j , G A (x) represents the neighborhood particle vector of the data point x to be clustered.

[0089] S43, judging whether the difference of the objective function J e in the two iteration processes is less than the set threshold value VCJT or whether the maximum iteration number Iters is reached, if the condition is met, the clustering result is output, if the condition is not met, steps S41-S43 are repeated.

[0090] In this embodiment, the objective function is represented as:

[0091]

[0092] wherein, J e represents the objective function, j represents a natural number, k represents the number of clustering clusters, C j represents the category, u j represents the mean particle vector of the category C j , which is also the particle center, D(G A (x), u j ) represents the dissimilarity of the particle vector of the data point x to be clustered and the particle center.

[0093] Step S5, outputting the clustering result, that is, according to the clustering result obtained by training in step S4, forming the final clustering result, C=(C1, C2,..., C k ).

[0094] Therefore, the adaptive neighborhood particle clustering method for mixed attribute data provided in this embodiment considers the different degrees of sparsity of different numerical attribute data, realizes the granulation of mixed attribute data by proposing the adaptive neighborhood particle method for mixed attribute data, effectively avoids the problem of inaccurate data dissimilarity measurement caused by different dimensions of numerical attribute data and symbolic attribute data; based on the neighborhood particle vector of data granulation, the initial clustering center is selected by using the newly defined data dissimilarity measurement method, the clustering result of the data is obtained by combining the neighborhood particle K-means clustering algorithm, the stability of the algorithm is effectively improved, and the algorithm has the excellent characteristics of strong applicability and high clustering performance.

[0095] The above description of the application and its embodiments is illustrative and not restrictive, and the application can be practiced in other specific forms without departing from the spirit or essential character thereof. The drawings described herein are only one of the many embodiments of the application and are not limiting, and any reference signs in the claims should not be construed as limiting the claims to the figure in which the reference signs are used. Therefore, if a person skilled in the art is inspired by the disclosure, and without departing from the spirit of the application, designs a similar structure and embodiment to the technical solution without creativity, it should be within the protection scope of the application. In addition, the word "comprising" does not exclude other elements or steps, and the word "one" before an element does not exclude the inclusion of "multiple" elements. The multiple elements stated in the product claim can also be implemented by one element through software or hardware. The words "first", "second" and the like are used to indicate names, and not to indicate any particular order.

Claims

1. An adaptive neighborhood granular clustering method for mixed attribute data, comprising the following steps: S1. Obtain and input the data to be clustered; S2, calculating the neighborhood particle vectors of the data to be clustered by using an adaptive neighborhood particle clustering method for mixed attribute data; S3. Selecting the initial cluster centers of the data to be clustered based on the data dissimilarity measurement method; S4, using the neighborhood particle K-means clustering algorithm to update the cluster center; S5. Output clustering results; In step S2, the neighborhood particle vectors of the data to be clustered are calculated, which includes the following steps: Calculate the average value of attribute differences of numerical attributes, and identify the neighborhood of numerical attributes based on the average value of attribute differences; Identify the neighborhood of symbolic attributes; Calculate the neighborhood particle vectors of different mixed attribute data through the neighborhood of numerical attributes and the neighborhood of symbolic attributes; The neighborhood of the numerical attribute is determined based on the average value of the attribute difference. The determination formula is: Among them, i and j are natural numbers, N is the number of samples, n is the numerical attribute feature, r is the hyperparameter, a is the attribute, represents the i-th sample, xia represents the value of the i-th sample on attribute a, and xja represents the value of the j-th sample on attribute a. represents the neighborhood particle vector of the i-th sample on attribute a, represents the neighborhood discriminant value of the jth sample, represents the neighborhood discriminant of a numerical attribute, It represents the Euclidean distance between any samples on attribute a, and dis(a) represents the average value of attribute difference; The neighborhood of the discriminant symbolic attribute is determined by the following formula: Among them, c represents the symbolic attribute feature, b represents the attribute, represents the value of the i-th sample on attribute b, represents the value of the jth sample on attribute b, express Neighborhood particle vector on attribute b, represents the neighborhood discrimination value of the jth sample, Neighborhood discriminant representing symbolic attributes; The neighborhood particle vectors of the different mixed attribute data are expressed as: Among them, G represents the neighborhood particle vector of the entire data to be clustered, express Neighborhood particle vector on attribute A, T represents matrix transpose.

2. The adaptive neighborhood granular clustering method for mixed attribute data according to claim 1, characterized in that: In step S1, the data to be clustered includes a sample set and an attribute set, and the attribute set includes numerical attributes and symbolic attributes.

3. The adaptive neighborhood granular clustering method for mixed attribute data according to claim 1, characterized in that: In step S3, the data-based dissimilarity measurement method is used to select the initial cluster centers of the data to be clustered, which includes the following steps: S31: Based on the neighborhood particle vectors, calculate the dissimilarity matrix and overall dissimilarity of the data to be clustered; S32: Calculate the number of neighborhood particle vectors whose median value in each row of data in the dissimilarity matrix is ​​less than or equal to m times the overall dissimilarity, and construct the matrix; S33: Select the first initial cluster center point, that is, the neighborhood particle vector corresponding to the maximum value in the matrix, and update the matrix; S34: Determine whether the dissimilarity between the neighborhood particle vector corresponding to the maximum value of the matrix and the initial cluster center meets the conditions. If the conditions are met, select the neighborhood particle vector corresponding to the maximum value as the cluster center and update the matrix. If the conditions are not met, update the matrix and repeat this step. The conditions are expressed as: , express The neighborhood particle vector on attribute A, p represents a natural number, up represents the cluster center vector, s represents the number of cluster centers, Indicates overall dissimilarity; S35: Set the number of clusters and determine whether the number of cluster centers meets the number of clusters. If so, obtain the initial cluster center point.

4. The adaptive neighborhood granular clustering method for mixed attribute data according to claim 3, characterized in that: The overall dissimilarity of the data to be clustered is expressed as: Among them, Tdis represents the overall dissimilarity, N represents the total number of neighborhood particle vectors, x and y represent any two samples in the data set to be clustered, represents the neighborhood particle vector of x on attribute A, represents the neighborhood particle vector of y on attribute A, and ρ represents the hyperparameter.

5. The adaptive neighborhood granular clustering method for mixed attribute data according to claim 1, characterized in that: S4. Using the neighborhood particle K-means clustering algorithm to update the cluster center, the steps include: S41, calculating the distance between all neighborhood particle vectors and the selected cluster center, classifying the i-th sample into the category corresponding to the minimum distance, and updating the category; S42, calculating the new cluster center point of the category; S43. Determine whether the difference between the objective functions during two iterations is less than a set threshold or whether the maximum number of iterations is reached. If the conditions are met, output the clustering result. If the conditions are not met, repeat steps S41-S43.

6. The adaptive neighborhood granular clustering method for mixed attribute data according to claim 5, characterized in that: The objective function is expressed as: Among them, Je represents the objective function, j represents a natural number, k represents the number of clusters, Cj represents the category, and uj represents the mean particle vector of the category.

Citation Information

Patent Citations

  • Automatic topology identification method for photovoltaic grid-connected low-voltage transformer area power distribution network

    CN114818890A

  • Fast K-nearest neighbor classifier method for large-scale data

    CN116363420A