Classified data clustering method and system based on double-space learning
By adopting dual-space learning method in the clustering of classified data, dynamically optimize the metric space and attribute subspace, the problem of relying on fixed metrics or coding rules in the existing technology is solved, and a more efficient and accurate clustering effect is achieved.
Patent Information
- Application Number
- CN202411905282.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-03-28
AI Technical Summary
The prior art relies on manual design measurement or coding rules in classification data clustering, and cannot adapt to the diversified classification data distribution, resulting in insufficient performance of clustering tasks.
Using a dual-space learning method, the measurement space and attribute subspace of classified data are dynamically optimized, and the weights and cluster division are optimized through alternate iterations, combined with measurement space learning and attribute value subspace learning, and the measurement weights and attribute weights are updated in a coordinated manner.
It realizes the complex characteristics of classification data more accurately, improves the accuracy and stability of clustering tasks, adapts to the characteristics of different data sets, and significantly improves the generalization ability of clustering algorithms.
Smart Images

Figure CN119719824A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine learning, and more specifically, to a classification data clustering method and system based on dual-space learning. Background Art
[0002] Categorical data has important analytical value in many practical application fields, such as medical, financial, and social behavior. Categorical data is a type of data composed of qualitative values. Compared with numerical data, this type of data cannot be directly mathematically operated and lacks a unified metric space. Especially in unsupervised learning scenarios, clustering analysis of categorical data is a critical task, but it also faces unique challenges. Due to the lack of clear similarity definitions for categorical data, traditional numerical data clustering methods are not suitable for the analysis of such data.
[0003] The existing methods for clustering categorical data can be roughly divided into two categories. The first method directly performs clustering by defining similarity metrics. These methods often rely on manually designed metrics, such as measurement models based on contextual information or statistical characteristics. These methods improve the quality of similarity metrics for categorical data to a certain extent by introducing more prior knowledge or statistical information. Since these metrics are usually based on assumptions or rules in specific fields, it is difficult to perform consistently in different data sets and scenarios. Especially for categorical data with different distribution characteristics or contexts, these predefined metrics often cannot accurately reflect the true similarity between data objects.
[0004] Another type of method attempts to perform clustering indirectly by encoding categorical data into numerical data. This method usually converts categorical values into numerical vectors through attribute statistics or representation learning, so that numerical clustering algorithms can be applied. However, such methods may lose the original characteristics of categorical data during the encoding process. For example, the attribute importance and distribution relationship of categorical data are often simplified during the encoding process, resulting in the inability of the converted numerical representation to fully capture the diversity of categorical data. In addition, this indirect method based on digitization usually relies on fixed encoding strategies, lacks flexibility, and is difficult to adapt to the needs of diverse data sets.
[0005] Although the above methods can solve the problem of clustering categorical data to a certain extent, they all share a core problem: most methods rely on manually designed metrics or encoding rules, which often cannot adapt to the diverse distribution of categorical data. Therefore, existing methods show insufficient applicability and generalization when facing different data sets or application scenarios. Further analysis shows that the optimal metric space for categorical data is closely related to the distribution structure of the data itself, and traditional methods lack the ability to learn and adjust the metric space on different data sets, which directly affects the performance of clustering tasks. Many traditional methods assume that the correlation between attributes is fixed, but in actual data sets, the relationship between attributes may vary significantly due to different fields or data sources. In addition, most methods simplify the clustering task to optimizing a single metric space, ignoring the diversity and complexity that may exist in categorical data. A single metric space cannot fully capture the potential structure of categorical data.
[0006] To this end, in combination with the above requirements and the deficiencies in the prior art, the present application proposes a classification data clustering method and system based on dual-space learning. Summary of the invention
[0007] The present invention provides a classification data clustering method and system based on dual-space learning, which can dynamically optimize the metric space and attribute subspace of classification data to effectively adapt to the characteristics of different data sets and improve the accuracy and stability of classification data clustering tasks.
[0008] The primary purpose of the present invention is to solve the above technical problems. The technical solution of the present invention is as follows:
[0009] The first aspect of the present invention provides a classification data clustering method based on dual-space learning, the method comprising the following steps:
[0010] S1. Receive and preprocess a data set containing multiple classification attributes, convert the classification attribute values into a unified format, and initialize the clustering attribution matrix and measurement weights.
[0011] S2. Construct a new metric function, dynamically adjust the metric space weight, minimize the clustering objective function, and optimize the weight and clustering division through alternating iterations.
[0012] S3. Optimize the attribute subspace weights, evaluate the importance of attributes in clustering, define cluster compactness, use Hellinger distance to measure the cluster separability of attributes, and calculate attribute weights.
[0013] S4. Combine metric space learning with attribute value subspace learning, collaboratively update metric weights and attribute weights, optimize the objective function, and realize clustering of categorical data.
[0014] Furthermore, the step S1 specifically includes: receiving a data set X=x1, x2, ..., x n , X consists of n data samples, where x j Represents the jth sample, initializes the clustering matrix U = {u ij}, where u ij =1 means x j Belongs to the i-th cluster c i , otherwise 0, initialize the metric weight Ensure that the weights satisfy the constraint 0≤w s ≤1 and
[0015] Furthermore, in step S2, the new metric function is specifically:
[0016]
[0017] Among them, τ s (x j , c i ) represents the sth basic metric, for the cluster partition U, where u ij Represents object x j Whether to assign to the i-th cluster center c i , for u ij The following conditions are met:
[0018]
[0019] There is ij =1, otherwise, u ij =0.
[0020] Furthermore, the dynamic adjustment of the metric space weight is achieved by minimizing the following clustering objective function:
[0021]
[0022] Among them, k is the number of cluster centers and n is the number of objects.
[0023] Furthermore, the alternating iterative optimization of weights and clustering division is specifically as follows: first, the weights are fixed Update the partition representation U until the objective function O converges; secondly, fix the partition U and update the weight W by gradient descent M , the weight update strategy is:
[0024]
[0025] Normalize the updated weights to ensure that And w s∈[0, 1], where α is a hyperparameter that controls the gradient descent rate. Through alternating iterations of the two, the objective function O will gradually converge.
[0026] Furthermore, in step S3, the attribute weights are optimized by optimizing the attribute subspace weights to refine the clustering performance, and the attribute weight matrix is used to represent the attribute weights. The attribute weight matrix W C is a k×d dimensional matrix, where d represents the number of attributes and k represents the number of clusters. The (i, h)th item in the matrix is w ih Represents attribute a h For cluster c i The weight of .
[0027] Furthermore, the inter-cluster distinction and intra-cluster compactness Two indicators quantify the property a h The contribution of attribute a in minimizing the objective function O is measured using the Hellinger distance h For cluster c i The ability to distinguish Its definition is as follows:
[0028]
[0029] Among them, lh Is the attribute a h The lth possible value of Ξ(c i |a h =o lh ) represents cluster c i Medium attribute a h The number of objects of the lth value, Ξ(c i |a h ≠o lh ) represents cluster c i Medium attribute a h Value is not equal to o lh The number of objects, Ξ(X\c i ) indicates non-cluster c i The total number of objects; the compactness of the clusters The definition is as follows:
[0030]
[0031] when and When both are large, it indicates that attribute a h In the formation of cluster c i , the attribute weight w ih The calculation formula is:
[0032]
[0033] In this formula, attribute value subspace learning is achieved by optimizing the weight matrix W C To improve the description of each cluster and dynamically adjust the contribution of attributes to the objective function.
[0034] Furthermore, in step S4, by collaboratively updating the metric weight W M and attribute weight W C To improve the distinguishability and compactness of clustering, during the optimization process, the objective function O is improved based on the original metric definition, and the new definition is as follows:
[0035]
[0036] Among them, τ s (x jh , c ih ) represents the weight w of attribute h based on the sth basic metric ih Calculate object x j With cluster c i similarity.
[0037] Furthermore, the dual-space collaborative learning algorithm obtained by combining metric space learning with attribute value subspace learning is optimized through the following steps: Fix W M , update W by learning the attribute value subspace C ; Fixed W C , update W through metric space learning M ; Repeat the above two processes until the objective function O converges.
[0038] The second aspect of the present invention provides a classification data clustering system based on dual-space learning, which is used for the classification data clustering method based on dual-space learning, including: a data initialization module, a metric space learning module, an attribute value subspace module, and a dual-space collaborative learning module.
[0039] The data initialization module receives and preprocesses a data set containing multiple classification attributes, performs unified format encoding conversion on the classification attribute values, and initializes the clustering attribution matrix and metric weights; the metric space learning module constructs a new metric function, dynamically adjusts the metric space weights, minimizes the clustering objective function, and optimizes the weights and clustering divisions through alternating iterations; the attribute value subspace module optimizes the attribute subspace weights, evaluates the importance of attributes in clustering, defines clustering compactness, and uses the Hellinger distance to measure the clustering separability of attributes, and calculates the attribute weights; the dual-space collaborative learning module combines metric space learning with attribute value subspace learning, collaboratively updates metric weights and attribute weights, optimizes the objective function, and realizes clustering of classified data.
[0040] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:
[0041] The present invention provides a classification data clustering method and system based on dual-space learning. By dynamically optimizing the metric space and attribute subspace of the classification data, the limitations of traditional methods that rely on fixed metrics or coding rules are overcome, and the complex characteristics of the classification data can be captured more accurately, achieving a more efficient and accurate clustering effect. The attribute weights are dynamically adjusted according to different data sets, and the importance assessment of the classification data attributes is refined, so as to better adapt to different data distributions and characteristic requirements, and effectively improve the performance of clustering tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 The present invention is a flow chart of a classification data clustering method based on dual-space learning.
[0043] Figure 2 The schematic diagram of a classification data clustering system based on dual-space learning of the present invention. DETAILED DESCRIPTION
[0044] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0045] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0046] Example 1
[0047] like Figure 1 As shown, the present invention provides a classification data clustering method based on dual space learning, and the method comprises the following steps:
[0048] S1. Receive and preprocess a data set containing multiple classification attributes, convert the classification attribute values into a unified format, and initialize the clustering attribution matrix and measurement weights.
[0049] S2. Construct a new metric function, dynamically adjust the metric space weight, minimize the clustering objective function, and optimize the weight and clustering division through alternating iterations.
[0050] S3. Optimize the attribute subspace weights, evaluate the importance of attributes in clustering, define cluster compactness, use Hellinger distance to measure the cluster separability of attributes, and calculate attribute weights.
[0051] S4. Combine metric space learning with attribute value subspace learning, collaboratively update metric weights and attribute weights, optimize the objective function, and realize clustering of categorical data.
[0052] According to the above content, the present invention introduces a dual-space learning mechanism, combined with the collaborative optimization of multi-metric fusion and attribute representation, to achieve more accurate and efficient clustering results. This research not only promotes the development of classified data clustering technology in theory, but also has important significance in practical applications, especially in e-commerce, finance, medical and other industries. This method can provide strong support for complex data analysis and scientific decision-making.
[0053] It should be noted that, compared with the prior art, the present invention has the following advantages:
[0054] 1. Dual-space learning mechanism improves clustering performance: This invention overcomes the limitations of traditional methods that rely on fixed metrics or encoding rules by dynamically optimizing the metric space and attribute subspace of classified data. It can more accurately capture the complex characteristics of classified data and achieve more efficient and accurate clustering effects.
[0055] 2. Multi-metric fusion enhances generalization capability: By fusing multiple metrics and performing complementary learning, the present invention excels in adapting to the characteristics of different data sets, solving the problem that traditional methods are difficult to perform consistently in diverse scenarios, and significantly improving the generalization capability of clustering algorithms.
[0056] 3. Dynamic optimization of attribute subspace to improve adaptability: The present invention can dynamically adjust attribute weights according to different data sets, and refine the importance assessment of classification data attributes, so as to better adapt to different data distribution and feature requirements, and effectively improve the performance of clustering tasks.
[0057] 4. Collaborative optimization to capture potential data structure: The dual-space collaborative learning algorithm combines the optimization results of the metric space and the attribute subspace, improves the distinguishability and compactness of clustering through alternating iterations, and can fully capture the potential structure of classified data.
[0058] Example 2
[0059] Based on the above-mentioned embodiment 1, this embodiment describes in detail the specific process steps of the present invention.
[0060] like Figure 1 As shown, the present invention comprises the following specific steps:
[0061] The step S1 specifically includes: receiving a data set X=x1, x2, ..., x n , X consists of n data samples, where x i Represents the jth sample, initializes the clustering matrix U = {u ij}, where u ij =1 means x j Belongs to the i-th cluster c i , otherwise 0, initialize the metric weight Ensure that the weights satisfy the constraint 0≤w s ≤1 and
[0062] In step S2, the new metric function is specifically:
[0063]
[0064] Among them, τ s (x j , c i ) represents the sth basic metric, for the cluster partition U, where u ij Represents object x j Whether to assign to the i-th cluster center c i , for u ij The following conditions are met:
[0065]
[0066] There is ij =1, otherwise, u ij =0.
[0067] Furthermore, the dynamic adjustment of the metric space weight is achieved by minimizing the following clustering objective function:
[0068]
[0069] Among them, k is the number of cluster centers and n is the number of objects.
[0070] The alternating iterative optimization of weights and clustering is specifically as follows: first, the weights are fixed Update the partition representation U until the objective function O converges; secondly, fix the partition U and update the weight W by gradient descent M , the weight update strategy is:
[0071]
[0072] Normalize the updated weights to ensure that And w s ∈[0, 1], where α is a hyperparameter that controls the gradient descent rate. Through alternating iterations of the two, the objective function O will gradually converge.
[0073] In step S3, the attribute weights are optimized by optimizing the attribute subspace weights to refine the clustering performance. The attribute weight matrix W is used to represent the attribute weights.C is a k×d dimensional matrix, where d represents the number of attributes and k represents the number of clusters. The (i, h)th item in the matrix is w ih Represents attribute a h For cluster c i The weight of .
[0074] Using inter-cluster discrimination and intra-cluster compactness Two indicators quantify the property a h The contribution of attribute a in minimizing the objective function O is measured using the Hellinger distance h For cluster c i The ability to distinguish Its definition is as follows:
[0075]
[0076] Among them, lh Is the attribute a h The lth possible value of Ξ(c i |a h =o lh ) represents cluster c i Medium attribute a h The number of objects of the lth value, Ξ(c i |a h ≠o lh ) represents cluster c i Medium attribute a h Value is not equal to o lh The number of objects, Ξ(X\c i ) indicates non-cluster c i The total number of objects; the compactness of the clusters The definition is as follows:
[0077]
[0078] when and When both are large, it indicates that attribute a h In the formation of cluster c i , the attribute weight w ih The calculation formula is:
[0079]
[0080] In this formula, attribute value subspace learning is achieved by optimizing the weight matrix W C To improve the description ability of each cluster and dynamically adjust the contribution of attributes to the objective function.
[0081] In step S4, the metric weight W is updated collaboratively Mand attribute weight W C To improve the distinguishability and compactness of clustering, during the optimization process, the objective function O is improved based on the original metric definition, and the new definition is as follows:
[0082]
[0083] Among them, τ s (x jh , c ih ) represents the weight w of attribute h based on the sth basic metric ih Calculate object x j With cluster c i similarity.
[0084] The dual-space collaborative learning algorithm obtained by combining metric space learning with attribute value subspace learning is optimized through the following steps: fix W M , update W by learning the attribute value subspace C ; Fixed W C , update W through metric space learning M ; Repeat the above two processes until the objective function O converges.
[0085] According to the above technical features, this collaborative optimization mechanism makes full use of the mutual promotion of metric space and attribute subspace, which can more effectively capture the characteristic distribution of data, improve the integrity of clustering, and show excellent clustering effects in a variety of scenarios.
[0086] Example 3
[0087] like Figure 2 As shown, the present invention also provides a classification data clustering system based on dual-space learning, which is used for the classification data clustering method based on dual-space learning, including: a data initialization module, a metric space learning module, an attribute value subspace module, and a dual-space collaborative learning module.
[0088] The data initialization module receives and preprocesses a data set containing multiple classification attributes, performs unified format encoding conversion on the classification attribute values, and initializes the clustering attribution matrix and metric weights; the metric space learning module constructs a new metric function, dynamically adjusts the metric space weights, minimizes the clustering objective function, and optimizes the weights and clustering divisions through alternating iterations; the attribute value subspace module optimizes the attribute subspace weights, evaluates the importance of attributes in clustering, defines clustering compactness, and uses the Hellinger distance to measure the clustering separability of attributes, and calculates the attribute weights; the dual-space collaborative learning module combines metric space learning with attribute value subspace learning, collaboratively updates metric weights and attribute weights, optimizes the objective function, and realizes clustering of classified data.
[0089] In the embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium, which, when executed, executes the steps of the above method embodiments; and the aforementioned storage medium includes: a mobile storage device, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media capable of storing program codes.
[0090] Alternatively, if the above-mentioned embodiments of the present invention are implemented in the form of software function modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media capable of storing program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0091] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. The icons describing the structural positional relationships in the accompanying drawings are only used for exemplary purposes and are not to be construed as limiting the present invention. For those of ordinary skill in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and is not possible to list all the embodiments here. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included in the scope of protection of the claims of the present invention.
Claims
1. A classification data clustering method based on dual-space learning, characterized in that: The following steps are involved: S1, receiving and preprocessing a data set containing multiple classification attributes, converting the classification attribute values into a unified format, and initializing a clustering attribution matrix and a measurement weight; S2, construct a new metric function, dynamically adjust the metric space weight, minimize the clustering objective function, and optimize the weight and clustering division through alternating iterations; S3, optimize the attribute subspace weights, evaluate the importance of attributes in clustering, define cluster compactness, use Hellinger distance to measure the cluster separability of attributes, and calculate attribute weights; S4. Combine metric space learning with attribute value subspace learning, collaboratively update metric weights and attribute weights, optimize the objective function, and realize clustering of categorical data.
2. The classification data clustering method based on dual-space learning according to claim 1, characterized in that: The step S1 specifically includes: receiving a data set X=x1, x2, ..., x n , X consists of n data samples, where x j Represents the jth sample, initialize the clustering matrix U = {u ij }, where u ij =1 means x j Belongs to the i-th cluster c i , otherwise 0, initialize the metric weight Ensure that the weights satisfy the constraint 0≤w s ≤1 and 3. The classification data clustering method based on dual-space learning according to claim 2, characterized in that: In step S2, the new metric function is specifically: Among them, τ s (x j ,c i ) represents the sth basic metric, for the cluster partition U, where u ij Represents object x j Whether to assign to the i-th cluster center c i , for u ij The following conditions are met: y∈{1,2,…,k} There is ij =1, otherwise, u ij =0.
4. The classification data clustering method based on dual-space learning according to claim 3 is characterized in that: The dynamic adjustment of the metric space weight is achieved by minimizing the following clustering objective function: Among them, k is the number of cluster centers and n is the number of objects.
5. The classification data clustering method based on dual-space learning according to claim 4 is characterized in that: The alternating iterative optimization of weights and clustering is specifically as follows: first, the weights are fixed Update the partition representation U until the objective function O converges; secondly, fix the partition U and update the weight W by gradient descent M , the weight update strategy is: Normalize the updated weights to ensure that And w s ∈[0,1], where α is a hyperparameter that controls the gradient descent rate. Through alternating iterations of the two, the objective function O will gradually converge.
6. A classification data clustering method based on dual-space learning according to claim 5, characterized in that: In step S3, the attribute weights are optimized by optimizing the attribute subspace weights to refine the clustering performance. The attribute weight matrix W is used to represent the attribute weights. C is a k×d dimensional matrix, where d represents the number of attributes and k represents the number of clusters. The (i,h)th item in the matrix is w ih Represents attribute a h For cluster c i The weight of .
7. The classification data clustering method based on dual-space learning according to claim 6, characterized in that: Using inter-cluster discrimination and intra-cluster compactness Two indicators quantify the property a h The contribution of attribute a in minimizing the objective function O is measured using the Hellinger distance h For cluster c i The ability to distinguish Its definition is as follows: Among them, lh Is the attribute a h The lth possible value of Ξ(c i |a h =o lh ) represents cluster c i Medium attribute a h The number of objects of the lth value, Ξ(c i |a h ≠o lh ) represents cluster c i Medium attribute a h Value is not equal to o lh The number of objects, Ξ(X\c i ) indicates non-cluster c i The total number of objects; the compactness of the clusters The definition is as follows: when and When both are large, it indicates that attribute a h In the formation of cluster c i , the attribute weight w ih The calculation formula is: In this formula, attribute value subspace learning is achieved by optimizing the weight matrix W C To improve the description ability of each cluster and dynamically adjust the contribution of attributes to the objective function.
8. The classification data clustering method based on dual-space learning according to claim 7, characterized in that: In step S4, the metric weight W is updated collaboratively M and attribute weight W C To improve the distinguishability and compactness of clustering, during the optimization process, the objective function O is improved based on the original metric definition, and the new definition is as follows: Among them, τ s (x jh ,c ih ) represents the weight w of attribute h based on the sth basic metric ih Calculate object x j With cluster c i similarity.
9. The classification data clustering method based on dual-space learning according to claim 8, characterized in that: The dual-space collaborative learning algorithm obtained by combining metric space learning with attribute value subspace learning is optimized through the following steps: fix W M , update W by learning the attribute value subspace C ; Fixed W C , update W through metric space learning M ; Repeat the above two processes until the objective function O converges.
10. A classification data clustering system based on dual-space learning, the system being used for a classification data clustering method based on dual-space learning as claimed in any one of claims 1 to 9, characterized in that: It includes: data initialization module, metric space learning module, attribute value subspace module, dual space collaborative learning module; The data initialization module receives and preprocesses a data set containing multiple classification attributes, performs unified format encoding conversion on the classification attribute values, and initializes the clustering attribution matrix and measurement weights; The metric space learning module constructs a new metric function, dynamically adjusts the metric space weight, minimizes the clustering objective function, and optimizes the weight and clustering division through alternating iterations; the attribute value subspace module optimizes the attribute subspace weight, evaluates the importance of the attribute in the cluster, defines the cluster compactness, and uses the Hellinger distance to measure the cluster separability of the attribute, and calculates the attribute weight; The dual-space collaborative learning module combines metric space learning with attribute value subspace learning, collaboratively updates metric weights and attribute weights, optimizes the objective function, and realizes clustering of categorical data.
Citation Information
Cited By
Disease control big data analysis method and system
CN121506533A