Data clustering methods, apparatus, electronic devices and computer-readable media
By integrating multiple distance metrics through an ordered weighted average aggregation operator, the problem of insufficient accuracy in clustering results in the K-means clustering algorithm is solved, and higher-precision data clustering is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-05
- Publication Date
- 2026-03-10
AI Technical Summary
In existing technologies, the K-means clustering algorithm has low clustering accuracy, especially when using Euclidean distance as a similarity metric, making it difficult to meet the requirement of high accuracy.
An ordered weighted average aggregation operator is used, which is generated by integrating multiple distance metrics to determine the distance between the data to be clustered and the cluster centers. The cluster centers are then iteratively updated until the target conditions are met, and the cluster partitioning results are output.
The accuracy of clustering results has been improved by comprehensively considering multiple distance metrics, thereby enhancing the precision and stability of the clustering results.
Smart Images

Figure CN117708630B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to data clustering methods, apparatus, electronic devices, and computer-readable media. Background Technology
[0002] With the rapid development of information technology, a large amount of data in various forms, such as text, images, audio, and video, has been generated. Data mining is an information extraction process, mainly referring to the process of extracting implicit and useful information from a large amount of unknown data. Clustering is one of the most widely used and mature data mining techniques, and it has been widely applied in data preprocessing. It also has important applications in machine learning, spatial data analysis, pattern recognition, business decision-making, image processing, document classification, and data compression.
[0003] In existing technologies, the K-means clustering algorithm can be used for data clustering, with Euclidean distance as the similarity metric. However, the accuracy of the clustering results obtained using this algorithm needs improvement. Summary of the Invention
[0004] This application provides data clustering methods, apparatus, electronic devices, and computer-readable media to address the technical problem of low accuracy in clustering results in the prior art.
[0005] In a first aspect, embodiments of this application provide a data clustering method, which includes: acquiring a dataset to be clustered; selecting a target number of data points from the dataset to be clustered as cluster centers, with each cluster center corresponding to a cluster; iteratively executing the following clustering steps until a first target condition is met: determining the distance between the data points in the dataset to be clustered and each cluster center based on an ordered weighted average aggregation operator, wherein the ordered weighted average aggregation operator is generated by fusing multiple distance metrics; dividing the data into clusters corresponding to the nearest cluster centers and updating the cluster centers of each cluster; and outputting the cluster division results.
[0006] In some embodiments, determining the distance between data in the dataset to be clustered and each cluster center based on the ordered weighted average aggregation operator includes: taking each data point in the dataset to be clustered as target data and each cluster center as target cluster center, and performing the following steps: determining the distance between the target data and the target cluster center using N preset distance metrics to obtain N distances, where N is an integer greater than 1; sorting the determined distances in descending order to obtain an N-dimensional array; determining the weights corresponding to each dimension of the data in the N-dimensional array; and weighted summing the data in the N-dimensional array based on the weights to obtain the distance between the target data and the target cluster center.
[0007] In some embodiments, after outputting the cluster partitioning result, the method further includes: determining the accuracy of the cluster partitioning result; in response to the accuracy being lower than a target value, updating the weights corresponding to each dimension of the data in the N-dimensional array, and re-executing the clustering step and the step of outputting the cluster partitioning result; in response to the accuracy being higher than the target value, storing the weights.
[0008] In some embodiments, after the output cluster partitioning result, the method further includes: iteratively executing the following update steps until the second objective condition is met: updating the weights corresponding to each dimension of the data in the N-dimensional array; re-executing the clustering step and the step of outputting the cluster partitioning result; selecting the cluster partitioning result with the highest accuracy from the obtained cluster partitioning results, and storing the weights corresponding to the cluster partitioning result with the highest accuracy.
[0009] In some embodiments, the distance metric includes at least one of the following: Euclidean distance, block distance, Chebyshev distance, cosine of the included angle, and relative entropy distance.
[0010] In some embodiments, obtaining the dataset to be clustered includes: obtaining an initial dataset; extracting feature information of each initial data in the initial dataset, and using the feature information as the data to be clustered to obtain the dataset to be clustered; wherein the initial data in the initial dataset includes at least one of the following: images and text.
[0011] In some embodiments, the first target condition includes at least one of the following: the cluster centers of each type of cluster converge, and the number of times the clustering step is executed is greater than or equal to the target number.
[0012] Secondly, embodiments of this application provide a data clustering apparatus, comprising: an acquisition unit for acquiring a dataset to be clustered; a selection unit for selecting a target number of data points from the dataset to be clustered as cluster centers, each cluster center corresponding to a cluster; an iterative execution unit for iteratively executing the following clustering steps until a first target condition is met: determining the distance between the data points in the dataset to be clustered and each cluster center based on an ordered weighted average aggregation operator, wherein the ordered weighted average aggregation operator is generated by fusing multiple distance metrics; dividing the data into clusters corresponding to the nearest cluster centers and updating the cluster centers of each cluster; and an output unit for outputting the cluster division results.
[0013] In some embodiments, determining the distance between data in the dataset to be clustered and each cluster center based on the ordered weighted average aggregation operator includes: taking each data point in the dataset to be clustered as target data and each cluster center as target cluster center, and performing the following steps: determining the distance between the target data and the target cluster center using N preset distance metrics to obtain N distances, where N is an integer greater than 1; sorting the determined distances in descending order to obtain an N-dimensional array; determining the weights corresponding to each dimension of the data in the N-dimensional array; and weighted summing the data in the N-dimensional array based on the weights to obtain the distance between the target data and the target cluster center.
[0014] In some embodiments, the apparatus further includes a first storage unit for determining the accuracy of the cluster partitioning result; updating the weights corresponding to each dimension of the data in the N-dimensional array in response to the accuracy being lower than a target value, and re-executing the clustering step and the step of outputting the cluster partitioning result; and storing the weights in response to the accuracy being higher than the target value.
[0015] In some embodiments, the apparatus further includes a second storage unit for iteratively executing the following update steps until a second target condition is met: updating the weights corresponding to each dimension of the data in the N-dimensional array; re-executing the clustering step and the step of outputting the cluster partitioning result; selecting the cluster partitioning result with the highest accuracy from the obtained cluster partitioning results, and storing the weights corresponding to the cluster partitioning result with the highest accuracy.
[0016] In some embodiments, the distance metric includes at least one of the following: Euclidean distance, block distance, Chebyshev distance, cosine of the included angle, and relative entropy distance.
[0017] In some embodiments, the acquisition unit is further configured to acquire an initial dataset; extract feature information of each initial data in the initial dataset, and use the feature information as data to be clustered to obtain a dataset to be clustered; wherein the initial data in the initial dataset includes at least one of the following: images and text.
[0018] In some embodiments, the first target condition includes at least one of the following: the cluster centers of each type of cluster converge, and the number of times the clustering step is executed is greater than or equal to the target number.
[0019] Thirdly, embodiments of this application provide an electronic device, including: one or more processors; and a storage device having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any embodiment of the first aspect.
[0020] Fourthly, embodiments of this application provide a computer-readable medium having a computer program stored thereon that, when executed by a processor, implements the method as described in any embodiment of the first aspect.
[0021] The data clustering method, apparatus, electronic device, and computer-readable medium provided in this application first acquire a dataset to be clustered; then, a target number of data points are selected from the dataset as cluster centers, with each cluster center corresponding to a cluster; subsequently, the clustering steps are iteratively executed to obtain the partitioned clusters and update the cluster centers until a first target condition is met, at which point the cluster partitioning result is output. Thus, clustering of data in the dataset to be clustered can be achieved. During the clustering process, an ordered weighted average aggregation operator is used to calculate distances. This ordered weighted average aggregation operator is generated by fusing multiple distance metrics, thus comprehensively considering clustering results under different distance metrics. Compared to using a single distance metric, this significantly improves the accuracy of the clustering results. Attached Figure Description
[0022] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0023] Figure 1 This is a flowchart of an embodiment of the data clustering method according to this application;
[0024] Figure 2 This is a flowchart of the distance determination process based on the data clustering method of this application;
[0025] Figure 3 This is a schematic diagram of a structure of an embodiment of the data clustering apparatus according to this application;
[0026] Figure 4 This is a schematic diagram of the structure of an electronic device used to implement the embodiments of this application. Detailed Implementation
[0027] All actions involving the acquisition of signals, information, or data in this application are carried out in accordance with the relevant data protection laws and policies of the country where the application is located, and with the authorization of the owner of the relevant device.
[0028] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.
[0029] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0030] Please refer to Figure 1 This document illustrates a flow 100 of an embodiment of the data clustering method according to this application. This data clustering method can be applied to various electronic devices with data processing capabilities. For example, such electronic devices may include, but are not limited to: smartphones, tablets, e-book readers, MP3 (Moving Picture Experts Group Audio Layer III) players, MP4 (Moving Picture Experts Group Audio Layer IV) players, laptops, in-vehicle computers, PDAs, desktop computers, set-top boxes, smart TVs, cameras, wearable devices, smart locks, etc. The processor in the aforementioned electronic device can be the execution entity of this data clustering method.
[0031] This data clustering method includes the following steps:
[0032] Step 101: Obtain the dataset to be clustered.
[0033] In this embodiment, the entity executing the data clustering method can obtain the dataset to be clustered. The dataset to be clustered may include multiple data points. The format of the data is not limited; for example, it may be text, images, etc.
[0034] In some alternative implementations, the dataset to be clustered can be obtained through the following steps:
[0035] First, obtain the initial dataset. The initial data in the initial dataset includes at least one of the following: images and text.
[0036] Next, feature information is extracted from each initial data point in the initial dataset, and this feature information is used as the data to be clustered, resulting in the dataset to be clustered. Here, a trained feature extraction network can be used for feature extraction. For example, the dataset to be clustered could be an iris flower dataset. Features such as sepal length, sepal width, and petal length can be extracted to obtain the iris flower dataset. As another example, the dataset to be clustered could be a wheat seed dataset. Features such as region, perimeter, compaction degree, grain length, grain width, and asymmetry coefficient can be extracted to obtain the wheat seed dataset. The data in the dataset to be clustered corresponds one-to-one with the data in the initial dataset. Based on the clustering results of the dataset to be clustered, the clustering results of the initial dataset can be obtained.
[0037] Step 102: Select a target number of data points from the dataset to be clustered as cluster centers, with each cluster center corresponding to a cluster.
[0038] In this embodiment, the executing entity can select a target number of data points from the dataset to be clustered as cluster centers. The target number can be denoted as k, and the cluster centers can be denoted as c. Here, c = {c1, c2, ..., c...} k}
[0039] In practice, cluster centers can be selected randomly or according to pre-defined rules; no specific limitations are imposed here. Each cluster center corresponds to one cluster. Clusters can be denoted as C1, C2, ..., Cc. k .
[0040] Step 103: Iteratively execute the following clustering steps until the first objective condition is met: Based on the ordered weighted average aggregation operator, determine the distance between the data in the dataset to be clustered and each cluster center, wherein the ordered weighted average aggregation operator is generated by fusing multiple distance metrics; divide the data into clusters corresponding to the nearest cluster centers, and determine the cluster centers of each type of cluster after division.
[0041] In this embodiment, the following clustering steps are performed iteratively until the first objective condition is met:
[0042] Sub-step S11: Based on the ordered weighted average aggregation operator, determine the distance between the data in the dataset to be clustered and each cluster center.
[0043] Here, the ordered weighted average aggregation operator is generated by fusing multiple distance metrics. The p-th data point x in the dataset to be clustered... p With the j-th cluster center c jThe distance can be expressed as d(x) p c j See the following formula:
[0044]
[0045] Where p is an integer greater than or equal to 1 and less than or equal to n. n is the number of data points in the dataset to be clustered. j is an integer greater than or equal to 1 and less than or equal to K. m is the dimension of the data. q is an integer greater than or equal to 1 and less than or equal to m.
[0046] Sub-step S12: Divide the data into clusters corresponding to the nearest cluster centers and determine the cluster centers of each group after division.
[0047] Specifically, firstly, for each data point, it can be assigned to the cluster corresponding to the nearest cluster center. That is, if d(x) satisfies... p ,c j )=min(d(x p ,c j Then x p ∈C j C j For the j-th cluster center c j The corresponding cluster.
[0048] After assigning each data point to its respective cluster, the cluster centers for each cluster can be determined. See the following formula:
[0049]
[0050] Where, n j For the j-th cluster C j The number of data points in the dataset.
[0051] In this embodiment, the first target condition can be set as needed. Optionally, it may include, but is not limited to, at least one of the following: the cluster centers of each type of cluster converge (i.e., remain unchanged), and the number of times the clustering step is executed is greater than or equal to the target number.
[0052] In some alternative implementations, see [link to relevant documentation]. Figure 2 Determining the distance between data points in the dataset to be clustered and each cluster center based on the ordered weighted average aggregation operator may include the following sub-steps:
[0053] Sub-step S21: Take each data point in the dataset to be clustered as the target data and take each cluster center as the target cluster center.
[0054] Sub-step S22 involves determining the distances between the target data and the target cluster center using N preset distance metrics, resulting in N distances. Here, N is an integer greater than 1.
[0055] Optionally, the distance metric may include, but is not limited to, at least one of the following: Euclidean distance, street distance, Chebyshev distance, cosine of the included angle, and relative entropy distance.
[0056] Sub-step S23: Sort the determined distances in descending order to obtain an N-dimensional array.
[0057] Sub-step S24: Determine the weights corresponding to each dimension of the data in the N-dimensional array. Here, the weights corresponding to each dimension of the data in the N-dimensional array can be set randomly, or they can be preset based on historical experience; there is no limitation here.
[0058] Sub-step S25: Based on the weights, perform a weighted summation of the data in the N-dimensional array to obtain the distance between the target data and the target cluster center.
[0059] As an example, N distance metrics are used: Euclidean distance, street distance, Chebyshev distance, and relative entropy distance, resulting in distances of 2, 4, 1, and 5 respectively. Sorting these distances in descending order yields the array [5, 4, 2, 1]. The weight of the first dimension is 0.3, the weight of the second dimension is 0.4, the weight of the third dimension is 0.2, and the weight of the fourth dimension is 0.1. Therefore, the distance between the target data and the target cluster center is 0.3 × 5 + 0.4 × 4 + 0.2 × 2 + 0.1 × 1 = 3.6.
[0060] In some optional implementations, in sub-step S24, the weights can be determined as follows: First, the priorities of the N distance metrics are obtained. Then, based on the priorities, the weights corresponding to each dimension of the N-dimensional array are determined. The higher the priority, the greater the weight. For example, there are four distance metrics: Euclidean distance, street distance, Chebyshev distance, and relative entropy distance. The priorities are, in order, Euclidean distance, street distance, Chebyshev distance, and relative entropy distance. Their weights could be 0.4, 0.3, 0.2, and 0.1, respectively.
[0061] Step 104: Output the cluster partitioning results.
[0062] The method provided in the above embodiments of this application first obtains a dataset to be clustered; then, a target number of data points are selected from the dataset as cluster centers, with each cluster center corresponding to a cluster; subsequently, the clustering steps are iteratively executed to obtain the partitioned clusters and update the cluster centers until the first target condition is met, at which point the cluster partitioning result is output. Thus, clustering of data in the dataset to be clustered can be achieved. During the clustering process, an ordered weighted average aggregation operator is used to calculate distances. This ordered weighted average aggregation operator is generated by fusing multiple distance metrics, thus comprehensively considering the clustering results under different distance metrics. Compared to using a single distance metric, this significantly improves the accuracy of the clustering results.
[0063] In some optional embodiments, after outputting the cluster partitioning results, the executing entity can further determine the accuracy of the cluster partitioning results. In response to the accuracy being lower than a target value, the weights corresponding to each dimension of the data in the N-dimensional array can be updated, and the clustering step and the step of outputting the cluster partitioning results can be re-executed. The target value can be set as needed, and its specific value is not limited here. The weights can be randomly selected or selected according to preset rules, and are not specifically limited here. This can further improve the accuracy of the clustering results. In response to the accuracy being higher than the target value, the weights are stored, thereby facilitating the improvement of the accuracy of clustering results in subsequent clustering tasks.
[0064] In some optional embodiments, after outputting the cluster partitioning results, the execution entity may iteratively execute the following update steps until the second objective condition is met: updating the weights corresponding to each dimension of the data in the N-dimensional array; re-executing the clustering step and the step of outputting the cluster partitioning results. Then, from the obtained cluster partitioning results, the cluster partitioning result with the highest accuracy is selected, and the weights corresponding to the cluster partitioning result with the highest accuracy are stored. The second objective condition may include, but is not limited to, at least one of the following: the number of update step executions is greater than a preset number, the execution time is greater than a preset time, and there are no unused weights, thereby further improving the accuracy of the clustering results. Simultaneously, it facilitates improving the accuracy of clustering results in subsequent clustering task processing.
[0065] Further reference Figure 3 As an implementation of the methods shown in the above figures, this application provides an embodiment of a data clustering device, which is similar to... Figure 1 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0066] like Figure 3As shown, the data clustering device 300 of this embodiment includes: an acquisition unit 301, used to acquire a dataset to be clustered; a selection unit 302, used to select a target number of data from the dataset to be clustered as cluster centers, each cluster center corresponding to a cluster; an iterative execution unit 303, used to iteratively execute the following clustering steps until a first target condition is met: determining the distance between the data in the dataset to be clustered and each cluster center based on an ordered weighted average aggregation operator, wherein the ordered weighted average aggregation operator is generated by fusing multiple distance metrics; dividing the data into clusters corresponding to the nearest cluster centers and updating the cluster centers of each cluster; and an output unit 304, used to output the cluster division results.
[0067] In some optional implementations of this embodiment, determining the distance between the data in the dataset to be clustered and each cluster center based on the ordered weighted average aggregation operator includes: taking each data in the dataset to be clustered as target data and each cluster center as target cluster center, and performing the following steps: determining the distance between the target data and the target cluster center using N preset distance metrics to obtain N distances, where N is an integer greater than 1; sorting the determined distances in descending order to obtain an N-dimensional array; determining the weights corresponding to each dimension of the data in the N-dimensional array; and weighted summing the data in the N-dimensional array based on the weights to obtain the distance between the target data and the target cluster center.
[0068] In some optional implementations of this embodiment, the device further includes a first storage unit for determining the accuracy of the cluster partitioning result; in response to the accuracy being lower than a target value, updating the weights corresponding to each dimension of the data in the N-dimensional array, and re-executing the clustering step and the step of outputting the cluster partitioning result; and in response to the accuracy being higher than the target value, storing the weights.
[0069] In some optional implementations of this embodiment, the device further includes a second storage unit for iteratively executing the following update steps until the second target condition is met: updating the weights corresponding to each dimension of the data in the N-dimensional array; re-executing the clustering step and the step of outputting the cluster partitioning result; selecting the cluster partitioning result with the highest accuracy from the obtained cluster partitioning results, and storing the weights corresponding to the cluster partitioning result with the highest accuracy.
[0070] In some optional implementations of this embodiment, the distance metric includes at least one of the following: Euclidean distance, street distance, Chebyshev distance, cosine of the included angle, and relative entropy distance.
[0071] In some optional implementations of this embodiment, the acquisition unit 301 is further configured to acquire an initial dataset; extract feature information of each initial data in the initial dataset, and use the feature information as data to be clustered to obtain a dataset to be clustered; wherein, the initial data in the initial dataset includes at least one of the following: images and text.
[0072] In some optional implementations of this embodiment, the first target condition includes at least one of the following: the cluster centers of each type of cluster converge, and the number of times the clustering step is executed is greater than or equal to the target number.
[0073] The apparatus provided in the above embodiments of this application, after outputting the cluster partitioning results, may iteratively execute the following update steps until the second objective condition is met: updating the weights corresponding to each dimension of the data in the N-dimensional array; re-executing the clustering step and the step of outputting the cluster partitioning results. Then, from the obtained cluster partitioning results, the cluster partitioning result with the highest accuracy is selected, and the weight corresponding to the cluster partitioning result with the highest accuracy is stored. This can further improve the accuracy of the clustering results. Simultaneously, it facilitates improving the accuracy of clustering results in subsequent clustering task processing.
[0074] The following is for reference. Figure 4 It shows a schematic diagram of the structure of an electronic device used to implement some embodiments of this application. Figure 4 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this application.
[0075] like Figure 4 As shown, electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 401, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 402 or a program loaded from storage device 408 into random access memory (RAM) 403. RAM 403 also stores various programs and data required for the operation of electronic device 400. Processing device 401, ROM 402, and RAM 403 are interconnected via bus 404. Input / output (I / O) interface 405 is also connected to bus 404.
[0076] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 408 including, for example, disks, hard disks, etc.; and communication devices 409. Communication device 409 allows electronic device 400 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 4 An electronic device 400 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 4 Each box shown can represent a device or multiple devices as needed.
[0077] In particular, according to some embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 409, or installed from storage device 408, or installed from ROM 402. When the computer program is executed by processing device 401, it performs the functions defined above in the methods of some embodiments of this application.
[0078] It should be noted that the computer-readable medium described in some embodiments of this application may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In some embodiments of this application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In some embodiments of this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0079] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol, such as HTTP (Hypertext Transfer Protocol), and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0080] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: acquire a dataset to be clustered; select a target number of data points from the dataset to be clustered as cluster centers, each cluster center corresponding to one cluster; iteratively execute the following clustering steps until a first objective condition is met: determine the distance between the data in the dataset to be clustered and each cluster center based on an ordered weighted average aggregation operator, the ordered weighted average aggregation operator being generated by fusing multiple distance metrics; divide the data into clusters corresponding to the nearest cluster centers and update the cluster centers of each cluster; output the cluster partitioning results.
[0081] Computer program code for performing operations of some embodiments of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++; and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, or it can be connected to an external computer (e.g., via the Internet using an Internet service provider), including local area networks (LANs) or wide area networks (WANs).
[0082] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0083] The units described in some embodiments of this application can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor may be described as including a first determining unit, a second determining unit, a selecting unit, and a third determining unit. The names of these units do not necessarily limit the specific unit itself.
[0084] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0085] The above description is merely a selection of preferred embodiments of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this application.
Claims
1. A data clustering method, characterized by, The method comprises: obtaining a data set to be clustered, data in the data set to be clustered comprising at least one of the following: an image, text; selecting a target number of data from the data set to be clustered as cluster centers, each cluster center corresponding to a class cluster; iteratively performing the following clustering steps until a first target condition is met: determining distances between data in the data set to be clustered and each cluster center based on an ordered weighted average aggregation operator, the ordered weighted average aggregation operator being generated by fusing multiple distance measurement methods; dividing the data into the class cluster corresponding to the nearest cluster center and updating the cluster centers of each class cluster; outputting a class cluster division result; determining the distances between the data in the data set to be clustered and each cluster center based on the ordered weighted average aggregation operator comprises: sequentially taking each data in the data set to be clustered as target data and each cluster center as a target cluster center, and performing the following steps: determining the distance between the target data and the target cluster center by using a preset N distance measurement method, N being an integer greater than 1, to obtain N distances; sorting the determined distances in descending order to obtain an N-dimensional array; determining the weight corresponding to each dimension data in the N-dimensional array; weighting and summing the data in the N-dimensional array based on the weight to obtain the distance between the target data and the target cluster center.
2. The method of claim 1, wherein, After the class cluster division result is outputted, the method further comprises: determining the accuracy of the class cluster division result; in response to the accuracy being lower than a target value, updating the weight corresponding to each dimension data in the N-dimensional array and re-executing the clustering steps and the step of outputting the class cluster division result; in response to the accuracy being higher than a target value, storing the weight.
3. The method of claim 1, wherein, After the class cluster division result is outputted, the method further comprises: iteratively performing the following update steps until a second target condition is met: updating the weight corresponding to each dimension data in the N-dimensional array; re-executing the clustering steps and the step of outputting the class cluster division result; selecting the class cluster division result with the highest accuracy from the obtained class cluster division results and storing the weight corresponding to the class cluster division result with the highest accuracy.
4. The method of claim 1, wherein, The distance measurement method comprises at least one of the following: Euclidean distance, block distance, Chebyshev distance, cosine of the included angle, relative entropy distance.
5. The method of claim 1, wherein, The method comprises: obtaining an initial data set; extracting feature information of each initial data in the initial data set, taking the feature information as data to be clustered, and obtaining a data set to be clustered; wherein the initial data in the initial data set comprises at least one of the following: an image, text.
6. The method of claim 1, wherein, The first target condition comprises at least one of the following: convergence of the cluster centers of each class cluster, and the number of times of executing the clustering steps being greater than or equal to a target number.
7. A data clustering apparatus, characterized by comprising: The device comprises: an obtaining unit configured to obtain a data set to be clustered, data in the data set to be clustered comprising at least one of the following: an image, text; a selecting unit configured to select a target number of data from the data set to be clustered as cluster centers, each cluster center corresponding to a class cluster; The iteration execution unit is configured to iteratively execute the following clustering steps until a first target condition is met: determining distances between data in the data set to be clustered and each cluster center based on an ordered weighted average aggregation operator, the ordered weighted average aggregation operator being generated by fusing multiple distance measurement manners; and dividing the data into a class cluster corresponding to a cluster center with the shortest distance and updating the cluster center of each class cluster. The output unit is configured to output a class cluster division result. The determining of the distances between the data in the data set to be clustered and each cluster center based on the ordered weighted average aggregation operator comprises: sequentially taking each data in the data set to be clustered as target data and taking each cluster center as a target cluster center, and performing the following steps: determining distances between the target data and the target cluster center by using N preset distance measurement manners respectively, N being an integer greater than 1, obtaining N distances; sorting the determined distances in descending order to obtain an N-dimensional array; determining weights corresponding to each dimension data in the N-dimensional array; and performing weighted summation on the data in the N-dimensional array based on the weights to obtain the distance between the target data and the target cluster center.
8. An electronic device, comprising: The computer program is executed by the processor to implement the method in any one of claims 1-6. The computer program is executed by the processor to implement the method in any one of claims 1-6. 9. A computer readable medium having stored thereon a computer program, characterized in that,