Clustering algorithm test method, equipment, medium and computer program product

The nodes are clustered through the clustering algorithm and calculated the accuracy, recall and cluster analogy, which solves the problem of difficulty in quantifying clustering algorithm testing, and realizes algorithm performance evaluation and optimization iteration.

CN119537973APending Publication Date: 2025-02-28XIAOHONGSHU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311112083.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-30
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The testing of clustering algorithms is difficult to quantify, and the lack of effective testing indicators makes it difficult to guide algorithm optimization and iteration and give it interpretability.

Method used

By obtaining multiple test sets, each of which includes multiple nodes of the same kind, and using a clustering algorithm to cluster nodes. Then, the main identity and main cluster of each cluster are determined, and based on the correspondence between the cluster and the identification, the accuracy, recall and cluster analog of the cluster algorithm are calculated as test indicators.

Benefits of technology

Quantitative testing of clustering algorithms is implemented, accurate and recall indicators with strong interpretability are provided, and algorithm performance is evaluated through cluster analogy, thereby guiding optimization iteration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537973A_ABST
    Figure CN119537973A_ABST
Patent Text Reader

Abstract

The invention relates to a method for testing a clustering algorithm, and the method comprises the steps: obtaining a plurality of test sets, each test set comprises a plurality of nodes of the same kind, and each test set corresponds to a corresponding identifier; clustering the nodes of the plurality of test sets into one or more clusters by using the clustering algorithm; determining the identifier corresponding to the maximum number of nodes in each cluster as the identifier corresponding to the cluster; in one or more clusters corresponding to each identifier, determining a cluster containing the most nodes corresponding to the identifier as a main cluster corresponding to the identifier; and based on the corresponding relationship between the cluster and the identifier and the corresponding relationship between the identifier and the corresponding main cluster, determining the accuracy rate and the recall rate of the clustering algorithm as test indexes. The invention also relates to a test device of the clustering algorithm, a medium and a computer program product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a clustering algorithm testing method, equipment, medium and computer program product. Background Art

[0002] The process of dividing a collection of physical or abstract objects into multiple classes consisting of similar objects is called clustering. In other words, it is the process of grouping "same" objects together. For example, in the field of content recommendation, the content stored in the server is clustered as objects. Usually, high-dimensional features are used to represent an object (node) in clustering, and they are clustered into one class based on the similarity between the calculated nodes. Although clustering algorithms can be implemented conveniently and efficiently, unlike the test set of classification algorithms, which has label information and can design test indicators relatively intuitively, the test set of clustering algorithms has no label information, and it is difficult to determine comprehensive and objective test indicators, making it difficult to guide the optimization iteration of the clustering algorithm and to give the clustering algorithm interpretability. Summary of the invention

[0003] The purpose of the present invention is to provide a clustering algorithm testing method, device, medium and computer program product to solve the technical problem that clustering algorithms cannot be quantitatively tested.

[0004] The first embodiment of the present invention discloses a clustering algorithm testing method for electronic devices, the method comprising:

[0005] Acquire multiple test sets, each of which includes multiple nodes of the same type, and each of which corresponds to a corresponding identifier;

[0006] Using the clustering algorithm, clustering the nodes of the plurality of test sets into one or more clusters;

[0007] Determine the identifier of the node with the largest number of nodes in each cluster as the identifier corresponding to the cluster;

[0008] In one or more clusters corresponding to each of the identifiers, determine the cluster containing the largest number of nodes corresponding to the identifier as the main cluster corresponding to the identifier;

[0009] Based on the correspondence between clusters and identifiers, and the correspondence between identifiers and corresponding main clusters, the accuracy and recall rate of the clustering algorithm are determined as test indicators.

[0010] Optionally, it also includes:

[0011] For each identifier, the accuracy of the identifier is determined as: the number of nodes corresponding to the identifier in the main cluster corresponding to the identifier / the total number of nodes in the main cluster corresponding to the identifier.

[0012] Optionally, it also includes:

[0013] The accuracy of the clustering algorithm is determined as: the sum of the accuracy of all identifications / the number of identifications.

[0014] Optionally, it also includes:

[0015] For each identifier, the recall rate of the identifier is determined as: the number of nodes corresponding to the identifier in the main cluster corresponding to the identifier / the total number of nodes corresponding to the identifier.

[0016] Optionally, it also includes:

[0017] The recall rate of the clustering algorithm is determined as: the sum of the recall rates of all identifiers / the number of identifiers.

[0018] Optionally, it also includes:

[0019] The cluster ratio of the clustering algorithm is determined as a test indicator, wherein the cluster ratio is: the total number of clusters / the number of identifiers.

[0020] The second embodiment of the present invention discloses an electronic device, which includes a memory storing computer executable instructions and a processor. When the instructions are executed by the processor, the electronic device implements the testing method of the clustering algorithm according to the first embodiment of the present invention.

[0021] The third embodiment of the present invention discloses a computer storage medium, on which instructions are stored. When the instructions are executed on a computer, the computer is enabled to execute the clustering algorithm testing method according to the first embodiment of the present invention.

[0022] A fourth embodiment of the present invention discloses a computer program product, comprising computer executable instructions, wherein the instructions are executed by a processor to implement the clustering algorithm testing method according to the first embodiment of the present invention.

[0023] Compared with the prior art, the main differences and effects of the embodiments of the present invention are:

[0024] In the present invention, quantitative test indicators of the clustering algorithm can be determined, namely, the accuracy and recall rate with strong interpretability. At the same time, the test indicators also include cluster analogy, which can be used to evaluate the performance of the clustering algorithm in the test, thereby guiding the optimization iteration of the clustering algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 A flow chart of a clustering algorithm testing method according to an embodiment of the present application is shown.

[0026] Figure 2 A schematic diagram showing a test set according to an embodiment of the present application.

[0027] Figure 3 A schematic diagram showing clustering results according to an embodiment of the present application.

[0028] Figure 4 A schematic diagram showing the correspondence between clustering results and identifiers according to an embodiment of the present application.

[0029] Figure 5 A scene diagram showing a test of a clustering algorithm according to an embodiment of the present application.

[0030] Figure 6 A schematic diagram showing a note according to an embodiment of the present application.

[0031] Figure 7 A hardware structure block diagram of an electronic device for implementing a test of a clustering algorithm according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0032] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0033] Clustering methods involve the concepts of nodes and clusters, where nodes are represented by high-dimensional features, such as 128 dimensions, 256 dimensions, 512 dimensions and other commonly used feature dimensions; clusters are the results of clustering output, and each cluster consists of one or more nodes.

[0034] In order to perform quantitative testing on a clustering algorithm, an embodiment of the present application discloses a clustering algorithm testing method for an electronic device. Figure 1 A flow chart of the method is shown, which includes:

[0035] S102, obtaining multiple test sets, each test set including multiple nodes of the same type, and each test set corresponding to a corresponding identifier;

[0036] For example, Figure 2 As shown, nodes 1 to 14 are manually clustered in advance, and nodes belonging to the same category are grouped into a real cluster, and three real clusters are obtained as test sets. Among them, these nodes can be notes uploaded by users to the server. And each real cluster is given a corresponding identifier (ID), and the identifier (ID) will also be used to refer to the corresponding real cluster in the description of this application. Figure 2 As shown, the real cluster 201 is marked as A, including nodes 1 to 5 shown as circles; the real cluster 202 is marked as B, including nodes 6 to 10 shown as squares; the real cluster 203 is marked as C, including nodes 11 to 14 shown as pentagons.

[0037] S104, clustering the nodes of the multiple test sets into one or more clusters using the clustering algorithm;

[0038] For example, the clustering algorithm to be tested is used to cluster nodes 1 to 14. The clustering result is as follows: Figure 3 As shown, nodes 1 to 4, nodes 9, and node 10 are clustered into cluster 31, nodes 6 to 8, and node 14 are clustered into cluster 32, nodes 11 to 13 are clustered into cluster 33, and node 3 is clustered into cluster 34.

[0039] S106, determining the identifier of the node corresponding to the largest number in each cluster as the identifier corresponding to the cluster;

[0040] For example, after clustering, each cluster may consist of nodes with one ID or multiple IDs. The ID with the largest number of nodes is called the primary ID of the cluster, and the cluster is also called the one belonging to this ID. Figure 3 As shown, cluster 31 has the largest number of nodes represented by circles, and the ID corresponding to these nodes is A, so the main ID of cluster 31 is A, and cluster 31 belongs to A; similarly, it can be determined that: the ID corresponding to cluster 32 is B, that is, the main ID of cluster 32 is B, and cluster 32 belongs to B; the ID corresponding to cluster 33 is C, that is, the main ID of cluster 33 is C, and cluster 33 belongs to C; the ID corresponding to cluster 34 is A, that is, the main ID of cluster 34 is A, and cluster 34 belongs to A.

[0041] S108, determining, among the one or more clusters corresponding to each of the identifiers, the cluster containing the largest number of nodes corresponding to the identifier as the main cluster corresponding to the identifier;

[0042] For example, after clustering, there may be multiple clusters belonging to the same ID. For a certain ID, among the clusters belonging to it, the cluster with the most nodes including this ID is the main cluster of this ID. If a certain ID has no cluster belonging to it, the main cluster of this ID is empty. Figure 4 As shown, cluster 31 and cluster 34 belong to A, among which cluster 31 contains the most nodes of A, and cluster 31 is determined to be the main cluster of A; cluster 32 belongs to B. Since there is only one cluster, cluster 32 contains the most nodes of B, and cluster 32 is determined to be the main cluster of B; cluster 33 belongs to C. Since there is only one cluster, cluster 33 contains the most nodes of C, and cluster 33 is determined to be the main cluster of C.

[0043] S110, based on the correspondence between the clusters and the identifiers, and the correspondence between the identifiers and the corresponding main clusters, determine the accuracy and recall rate of the clustering algorithm as test indicators.

[0044] According to some embodiments of the present application, the method also includes: for each identifier, determining the accuracy of the identifier as: the number of nodes corresponding to the identifier in the main cluster corresponding to the identifier / the total number of nodes in the main cluster corresponding to the identifier; for each identifier, determining the recall rate of the identifier as: the number of nodes corresponding to the identifier in the main cluster corresponding to the identifier / the total number of nodes corresponding to the identifier.

[0045] For example, for a cluster Cluster, assuming its primary ID is X, the precision and recall of the Cluster are determined as follows:

[0046]

[0047]

[0048] node* indicates the node in Cluster that belongs to X, node** indicates the node in Cluster, and node*** indicates the node in X. num(node) indicates the number of nodes.

[0049] For an ID, the precision and recall of the primary cluster using the ID represent the accuracy and recall of the ID respectively. If an ID does not belong to its cluster, the precision and recall of the ID are 0. For example, the primary cluster of A is cluster 31, and the precision and recall of cluster 31 are recall = 0.8, that is, precision = 0.67, recall = 0.8 for ID A.

[0050] According to some embodiments of the present application, the method further includes: determining the accuracy of the clustering algorithm as: the sum of the accuracy of all identifiers / the number of identifiers; determining the recall of the clustering algorithm as: the sum of the recall of all identifiers / the number of identifiers. For example, for the entire clustering result, the accuracy and recall can be defined as:

[0051]

[0052]

[0053] num(ID) represents the number of real clusters. For example, Figure 3 or Figure 4 The accuracy of the clustering results shown Recall

[0054] In the present application, when n=1, avgPrecison=100%, avgRecall=100%, Cluster==ID, the clustering result reaches the theoretical optimal value.

[0055] According to some embodiments of the present application, the method further includes: determining the cluster analogy of the clustering algorithm as a test indicator, wherein the cluster analogy is: the total number of clusters / the number of identifiers. For example, the cluster analogy is:

[0056]

[0057] num(Cluster) indicates the number of clusters after clustering. For example, Figure 3 or Figure 4 The clustering result shown has a cluster ratio of n=1.33.

[0058] In this application, when n=1, the number of clusters is equal to the number of real clusters; when n>1, the larger n is, the more scattered the clusters are, and the greater the probability that the same nodes are scattered; when n<1, the smaller n is, the more cohesive the clusters are, and the greater the probability that different nodes are clustered together. The two indicators avgPrecison and avgRecall can be used to determine the performance of the clustering results.

[0059] In the present invention, quantitative test indicators of the clustering algorithm can be determined, namely, the accuracy and recall rate with strong interpretability. At the same time, the test indicators also include cluster analogy, which can be used to evaluate the performance of the clustering algorithm in the test, thereby guiding the optimization iteration of the clustering algorithm.

[0060] The implementation of the technical solution of the present application is introduced below in conjunction with specific scenarios. The technical solution provided in the embodiment of the present application is applicable to the test scenario of the clustering algorithm in the recommendation of multimedia content such as text, pictures (including static pictures in formats such as jpeg and dynamic pictures in formats such as gif), and videos. The present application mainly uses the test of the clustering algorithm in the recommendation of similar notes as an example. Among them, the notes can be notes on a certain platform that include at least one of the multimedia contents such as text, pictures, videos, etc., which are used to record the user's experience or opinions on a certain topic. Figure 5 The scene diagram of the clustering algorithm test according to the embodiment of the present application is shown. Specifically, the scene includes a terminal 501, a server 502 and a network 503.

[0061] Terminal 501 may be a desktop terminal or a mobile terminal, and the mobile terminal may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. Terminal 501 may be installed with an application that can browse notes, such as a browser or a client. The application involved in the embodiment of the present application may be a software client, or a client such as a web page or a small program. If the application is a client such as a web page or a small program, the background server is a background server corresponding to the software or the web page or the small program, and the specific type of the client is not limited. Among them, the user can browse or create notes by logging in to his or her own user on the application, and after creating the notes, the notes created by the user can be used to implement the method according to the embodiment of the present application to test the clustering algorithm. It should be noted that even if the user does not log in, generally speaking, the server corresponding to the client will also identify the user, for example, it can be identified by the terminal used by the user, so the identification can also be understood as the user of the user.

[0062] Server 502 is an electronic device that implements the test method of the clustering algorithm according to the embodiment of the present application. It can be a background server corresponding to the application installed on the terminal 501. For example, it can be an independent physical server or a server cluster or distributed system composed of multiple servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms, but is not limited to this. Server 502 includes a database that can be used to store notes browsed, created, and uploaded by users, as well as multi-dimensional data such as text, pictures, annotations, etc. of the notes. The steps of the test method of the clustering algorithm provided in the embodiment of the present application are used to test and evaluate the clustering algorithm, and then use the tested clustering algorithm to determine the content that can be pushed in the terminal 501.

[0063] The terminal 501 and the server 502 are connected via a network 503 , which includes one or more and may include various connection types, such as wired or wireless communication links, cloud or fiber optic cables, etc. Specific examples of the above-mentioned network may include the Internet provided by the communication provider of the terminal 501 .

[0064] The following describes in detail some embodiments of the present application. Figure 5The server 502 receives user data from the terminal 501, that is, the notes created and uploaded by the user. The server 502 determines the test notes in the database for testing, for example, all the notes in the database, or some notes in the database selected according to the conditions, as the test set. These test notes are represented by high-dimensional features, or these candidate notes are converted into high-dimensional feature representations. Then, these test notes are used as nodes of the test set, and the test method of the clustering algorithm according to the implementation of the present application is used to cluster the nodes of the test set. For example, Figure 6 As shown, the test notes include: Note 601, Note 602, Note 603, Note 604, Note 605, Note 606, Note 607, Note 608, Note 609, Note 610, Note 611, Note 612, Note 613, Note 614. Note 601, Note 602, Note 603, Note 604, Note 605 are related to potted plants, and are manually marked as A (ie, ID is A), corresponding to Figure 2 Node 1, Node 2, Node 3, Node 4, Node 5 in the table; Notes 606, 607, 608, 609, and 610 are related to indoor seats and are manually identified as B (i.e., ID is B), corresponding to Figure 2 Nodes 6, 7, 8, 9, and 10 in the table; Notes 611, 612, 613, and 614 are related to digital devices and are manually identified as C (i.e., ID is C). Figure 2 Node 11, node 12, node 13, node 14 in. Using the clustering algorithm testing method according to the embodiment of the present application, the clustering algorithm to be tested is used to cluster nodes 1-node 14, that is, to cluster notes 601-note 614, such as Figure 3 As shown, after clustering, nodes 1-4, 9, and 10 are clustered into cluster 31, nodes 6-8, and 14 are clustered into cluster 32, nodes 11-13 are clustered into cluster 33, and node 3 is clustered into cluster 34. That is, the corresponding notes 601-604, 609, and 610 are clustered into cluster 31, notes 606-608, and 614 are clustered into cluster 32, notes 611-613 are clustered into cluster 33, and note 603 is clustered into cluster 34. Then, the precision and recall of the main cluster of each ID are further determined to represent the accuracy and recall indicators of the ID respectively. For example, the main cluster of A is cluster 31, and the accuracy of cluster 31 is The recall rate recall = 0.8, that is, the precision of ID A is precision = 0.67, and the recall rate recall = 0.8; the accuracy of the entire clustering result Recall As the test indicator of the clustering algorithm; and the cluster analogy of the entire clustering result is n=1.33, which is also used as the test indicator of the clustering algorithm. In this way, the quantitative test indicators of the clustering algorithm are determined, that is, the accuracy and recall rate with strong interpretability. At the same time, the test indicators also include cluster analogy, which can be used to evaluate the performance of the clustering algorithm in the test, thereby guiding the optimization iteration of the clustering algorithm. After optimization and iteration, the clustering algorithm can be used to recommend the same or similar content to the user. For example, the server 502 receives user information from the terminal 501, determines the note currently browsed by the user, and then uses the clustering algorithm that has been tested and optimized and iterated to recommend notes of the same type as the note to the terminal 501 and display them to the user.

[0065] Figure 7 It is a hardware structure block diagram of an electronic device for implementing a test of a clustering algorithm according to an embodiment of the present application.

[0066] like Figure 7 As shown, the electronic device 700 may include one or more processors 702, a system motherboard 708 connected to at least one of the processors 702, a system memory 704 connected to the system motherboard 708, a non-volatile memory (NVM) 706 connected to the system motherboard 708, and a network interface 710 connected to the system motherboard 708.

[0067] The processor 702 may include one or more single-core or multi-core processors. The processor 702 may include any combination of a general-purpose processor and a special-purpose processor (e.g., a graphics processor, an application processor, a baseband processor, etc.). In an embodiment of the present invention, the processor 702 may be configured to execute the following Figure 1-Figure 4 One or more of the various embodiments shown.

[0068] In some embodiments, system board 708 may include any suitable interface controller to provide any suitable interface to at least one of processors 702 and / or any suitable device or component in communication with system board 708 .

[0069] In some embodiments, the system board 708 may include one or more memory controllers to provide an interface to the system memory 704. The system memory 704 may be used to load and store data and / or instructions. In some embodiments, the system memory 704 of the electronic device 700 may include any suitable volatile memory, such as a suitable dynamic random access memory (DRAM).

[0070] NVM 706 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions. In some embodiments, NVM 706 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device, such as at least one of a HDD (Hard Disk Drive), a CD (CompactDisc) drive, and a DVD (Digital Versatile Disc) drive.

[0071] NVM 706 may include a portion of storage resources installed on a device of electronic device 700, or it may be accessible by the device but not necessarily a portion of the device. For example, NVM 706 may be accessed over a network via network interface 710.

[0072] In particular, system memory 704 and NVM 706 may include, respectively, a temporary copy and a permanent copy of instructions 720. Instructions 720 may include instructions that, when executed by at least one of processors 702, cause electronic device 700 to implement the following: Figure 1-Figure 4 In some embodiments, the instructions 720, hardware, firmware and / or software components thereof may additionally / alternatively be located in the system mainboard 708, the network interface 710 and / or the processor 702.

[0073] The network interface 710 may include a transceiver for providing a radio interface for the electronic device 700, thereby communicating with any other suitable device (e.g., a front-end module, an antenna, etc.) through one or more networks. In some embodiments, the network interface 710 may be integrated with other components of the electronic device 700. For example, the network interface 710 may be integrated with at least one of the processor 702, the system memory 704, the NVM 706, and a firmware device (not shown) having instructions. When at least one of the processors 702 executes the instructions, the electronic device 700 implements Figure 1-Figure 4 One or more of the various embodiments shown.

[0074] The network interface 710 may further include any suitable hardware and / or firmware to provide a multiple-input multiple-output radio interface. For example, the network interface 710 may be a network adapter, a wireless network adapter, a telephone modem, and / or a wireless modem.

[0075] In one embodiment, at least one of the processors 702 may be packaged together with one or more controllers for the system motherboard 708 to form a system in package (SiP). In one embodiment, at least one of the processors 702 may be integrated on the same die with one or more controllers for the system motherboard 708 to form a system on a chip (SoC).

[0076] The electronic device 700 may further include an input / output (I / O) device 712 connected to the system motherboard 708. The I / O device 712 may include a user interface to enable a user to interact with the electronic device 700; the design of the peripheral component interface enables the peripheral components to interact with the electronic device 700. In some embodiments, the electronic device 700 further includes a sensor for determining at least one of an environmental condition and location information related to the electronic device 700.

[0077] In some embodiments, I / O device 712 may include, but is not limited to, a display (e.g., a liquid crystal display, a touch screen display, etc.), speakers, a microphone, one or more cameras (e.g., a still image camera and / or a video camera), a flashlight (e.g., an LED flash), and a keyboard.

[0078] In some embodiments, the peripheral component interface may include, but is not limited to, a non-volatile memory port, an audio jack, and a power interface.

[0079] In some embodiments, the sensors may include, but are not limited to, gyroscope sensors, accelerometers, proximity sensors, ambient light sensors, and positioning units. The positioning unit may also be part of or interact with the network interface 710 to communicate with components of a positioning network (e.g., global positioning system (GPS) satellites).

[0080] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 700. In other embodiments of the present application, the electronic device 700 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0081] Program code can be applied to input instructions to perform the functions described in the present invention and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a system for processing instructions including processor 702 includes any system having a processor such as a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.

[0082] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in the present invention is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.

[0083] One or more aspects of at least one embodiment may be implemented by instructions stored on a computer-readable storage medium, which, when read and executed by a processor, enables an electronic device to implement the method of the embodiment described in the present invention.

[0084] According to some embodiments of the present application, a computer storage medium is disclosed, on which instructions are stored. When the instructions are executed on a computer, the computer executes a testing method for a clustering algorithm according to an embodiment of the present application.

[0085] The first embodiment is a method implementation method corresponding to the present embodiment, and the present embodiment can be implemented in conjunction with the first embodiment. The relevant technical details mentioned in the first embodiment are still valid in the present embodiment, and are not repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in the present embodiment can also be applied in the first embodiment.

[0086] According to some embodiments of the present application, a computer program product is disclosed, including computer executable instructions, where the instructions are executed by a processor to implement a clustering algorithm testing method according to an embodiment of the present application.

[0087] The first embodiment is a method implementation method corresponding to the present embodiment, and the present embodiment can be implemented in conjunction with the first embodiment. The relevant technical details mentioned in the first embodiment are still valid in the present embodiment, and are not repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in the present embodiment can also be applied in the first embodiment.

[0088] It is to be understood that the specific embodiments described herein are only for explaining the present application, rather than limiting the present application. In addition, for ease of description, only some but not all structures or processes related to the present application are shown in the accompanying drawings. It should be noted that in this specification, similar reference numerals and letters represent similar items in the accompanying drawings.

[0089] It should be understood that although the terms "first", "second", etc. may be used herein to describe various features, these features should not be limited by these terms. These terms are used only to distinguish and should not be understood as indicating or implying relative importance. For example, a first feature may be referred to as a second feature, and similarly a second feature may be referred to as a first feature without departing from the scope of the exemplary embodiments.

[0090] In the description of this application, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in this embodiment can be understood according to specific circumstances.

[0091] Illustrative embodiments of the present application include, but are not limited to, methods, apparatus, media, and computer program products for testing clustering algorithms.

[0092] The various aspects of the illustrative embodiments will be described using terms commonly used by those skilled in the art to convey the essence of their work to other persons skilled in the art. However, it is apparent to those skilled in the art that some alternative embodiments may be implemented using the features described in part. For purposes of explanation, specific numbers and configurations are set forth to provide a more thorough understanding of the illustrative embodiments. However, it is apparent to those skilled in the art that alternative embodiments may be implemented without the specific details. In some other cases, some well-known features are omitted or simplified herein to avoid obscuring the illustrative embodiments of the present application.

[0093] In addition, various operations will be described as multiple separate operations in a manner that is most helpful for understanding the illustrative embodiments; however, the order of description should not be interpreted as implying that these operations must rely on the order of description, and many of the operations can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the operations can also be rearranged. When the described operations are completed, the process can be terminated, but can also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0094] References in the specification to "one embodiment," "an embodiment," "an illustrative embodiment," etc., indicate that the described embodiment may include a particular feature, structure, or property, but each embodiment may or may not necessarily include the particular feature, structure, or property. Moreover, these phrases are not necessarily referring to the same embodiment. In addition, when particular features are described in conjunction with a specific embodiment, the knowledge of those skilled in the art can affect the combination of these features with other embodiments, whether or not these embodiments are explicitly described.

[0095] Unless the context dictates otherwise, the terms "comprising," "having," and "including" are synonymous. The phrase "A and / or B" means "(A), (B), or (A and B)."

[0096] As used herein, the term "module" may refer to, be part of, or include: memory (shared, dedicated, or group) for running one or more software or firmware programs, application-specific integrated circuits (ASICs), electronic circuits and / or processors (shared, dedicated, or group), combinational logic circuits, and / or other suitable components that provide the described functionality.

[0097] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order is not necessary. Instead, in some embodiments, these features may be described in a manner and / or order different from that shown in the illustrative drawings. In addition, the structural or method features included in a specific figure do not mean that all embodiments need to include such features. In some embodiments, these features may not be included or may be combined with other features.

[0098] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented in the form of instructions or programs carried or stored on one or more transient or non-transient machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors, etc. When the instructions or programs are run by the machine, the machine may perform the aforementioned various methods. For example, the instructions may be distributed via a network or other computer-readable medium. Therefore, the machine-readable medium may include, but is not limited to, any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, such as a floppy disk, an optical disk, a compact disk read-only memory (CD-ROMs), a magneto-optical disk, a read-only memory (ROM), a random access memory (RAM), an erasable programmable read-only memory (EPROM), an electronically erasable programmable read-only memory (EEPROM), a magnetic card or an optical card, or a flash memory or a tangible machine-readable memory for transmitting network information via electrical, optical, acoustic, or other forms of signals (e.g., carrier waves, infrared signals, digital signals, etc.). Accordingly, machine-readable media includes any form of machine-readable media suitable for storing or transmitting electronic instructions or information readable by a machine (eg, a computer).

[0099] The embodiments of the present application are described in detail above in conjunction with the accompanying drawings, but the use of the technical solution of the present application is not limited to the various applications mentioned in the embodiments of the present application. Various structures and modifications can be easily implemented with reference to the technical solution of the present application to achieve the various beneficial effects mentioned herein. Various changes made within the knowledge of ordinary technicians in the field without departing from the purpose of the present application should all fall within the scope of the patent coverage of the present application.

Claims

1. A clustering algorithm testing method for electronic equipment, characterized in that: The method comprises: Acquire multiple test sets, each of which includes multiple nodes of the same type, and each of which corresponds to a corresponding identifier; Using the clustering algorithm, clustering the nodes of the plurality of test sets into one or more clusters; Determine the identifier of the node with the largest number of nodes in each cluster as the identifier corresponding to the cluster; In one or more clusters corresponding to each of the identifiers, determine the cluster containing the largest number of nodes corresponding to the identifier as the main cluster corresponding to the identifier; Based on the correspondence between clusters and identifiers, and the correspondence between identifiers and corresponding main clusters, the accuracy and recall rate of the clustering algorithm are determined as test indicators.

2. The method according to claim 1, characterized in that Also includes: For each identifier, the accuracy of the identifier is determined as: the number of nodes corresponding to the identifier in the main cluster corresponding to the identifier / the total number of nodes in the main cluster corresponding to the identifier.

3. The method according to claim 2, characterized in that Also includes: The accuracy of the clustering algorithm is determined as: the sum of the accuracy of all identifications / the number of identifications.

4. The method according to claim 1, characterized in that: Also includes: For each identifier, the recall rate of the identifier is determined as: the number of nodes corresponding to the identifier in the main cluster corresponding to the identifier / the total number of nodes corresponding to the identifier.

5. The method according to claim 4, characterized in that Also includes: The recall rate of the clustering algorithm is determined as: the sum of the recall rates of all identifiers / the number of identifiers.

6. The method according to claim 1, characterized in that Also includes: The cluster ratio of the clustering algorithm is determined as a test indicator, wherein the cluster ratio is: the total number of clusters / the number of identifiers.

7. An electronic device, characterized in that: The electronic device comprises a memory storing computer executable instructions and a processor. When the instructions are executed by the processor, the electronic device implements the clustering algorithm testing method according to any one of claims 1 to 6.

8. A computer storage medium, characterized in that Instructions are stored on the computer storage medium. When the instructions are executed on a computer, the computer is enabled to execute the clustering algorithm testing method according to any one of claims 1 to 6.

9. A computer program product, characterized in that The method comprises computer executable instructions, wherein the instructions are executed by a processor to implement a testing method for a clustering algorithm according to any one of claims 1 to 6.