A clustering evaluation metric method, system, device and storage medium for wine data

By generating sample sets of the same dimension order of magnitude and combining punishment terms to deal with it, the problem of the impact of sample dimensions and outliers in clustering is solved, and the accuracy and effectiveness of clustering results are improved.

CN112348055BActive Publication Date: 2025-07-29SHENZHEN INSTITUTE OF INFORMATION TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011107621.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-16
Publication Date
2025-07-29
Estimated Expiration
2040-10-16

AI Technical Summary

Technical Problem

The existing clustering effectiveness index fails to effectively consider the impact of dimensions and outliers in each dimension of the sample when calculating the intercluster dispersion and intracluster density of data samples, resulting in inaccurate clustering effects, especially when the sample size is large, the impact is more significant.

Method used

The preset function processed the data set to generate a sample set of the same order of magnitude as the same dimension. Combined with the preset clustering algorithm and penalty terms, the penalty terms are constructed and the clustering results are output to reduce the impact of the dimensions and outliers of each dimension of the sample.

Benefits of technology

The effectiveness of clustering effect is improved, the impact of excessive sample size on the evaluation index is reduced, and more accurate clustering results are achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112348055B_ABST
    Figure CN112348055B_ABST
Patent Text Reader

Abstract

The present invention discloses a clustering evaluation metric method, system, device and storage medium for wine data. The method includes: obtaining a data set to be clustered, processing the data set by using a preset function to generate a sample set with the same order of magnitude in the same dimension; combining a preset clustering algorithm and a set number of clusters, generating multiple clusters from the sample set, and obtaining the inter-cluster dispersion value and the intra-cluster compactness value; constructing a penalty term according to a logarithmic function, and combining the inter-cluster dispersion value, the intra-cluster compactness value and the penalty term to output a first clustering result; generating a sample set by processing the data set to be clustered through a preset function, generating multiple clusters from the sample set according to the preset clustering algorithm and the set number of clusters, and outputting the inter-cluster dispersion value and the intra-cluster compactness value, and finally combining the inter-cluster dispersion value, the intra-cluster compactness value and the penalty term to output a first clustering result, reducing the influence of the dimension of each sample dimension and outliers on the clustering result, and realizing the improvement of the effectiveness of the clustering effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and particularly relates to a method, system, device and storage medium for clustering evaluation and measurement of wine data. Background Art

[0002] With the development of society and the advent of the intelligent era, clustering technology, as an important part of the unsupervised pattern recognition learning process, has been widely applied in important fields such as machine learning, pattern recognition and data mining. The purpose of clustering is to divide a number of originally scattered and seemingly unrelated data samples into similar groups or clusters to obtain certain internal data rules. A key task of clustering is to quantitatively evaluate the clustering results, especially to determine an optimal number of clusters or partitioning structure. The quality of the clustering result is judged by clustering validity. The CH (Calinski-Harabasz) index is a common measurement method for evaluating clustering effects. Its definition is the ratio of the between-cluster scatter to the within-cluster compactness multiplied by a penalty term. Among them, the between-cluster scatter refers to the sum of squared errors between clusters, the within-cluster compactness is the sum of squared errors within clusters, and the penalty term refers to the difference between the sample size and the number of categories. The obtained value is then divided by the difference between the number of categories and 1. Other common clustering validity index measurements include the XB (Xie-Beni) index, the classification accuracy index (DB: Davies-Bouldin), and the silhouette coefficient, etc.

[0003] However, when calculating the between-cluster scatter of data samples and the within-cluster compactness of samples, the clustering validity index does not consider the dimensions of each dimension of the sample and the influence of outliers, and the dimensions of each dimension of the sample and outliers will have an important impact on the effectiveness of the clustering result. In addition, for the penalty term, when the sample size is large, it has a great influence on the value of CH, greatly reducing the influence of the between-cluster scatter and the within-cluster compactness. Summary of the Invention

[0004] The first technical solution adopted by the present invention is:

[0005] A clustering evaluation and measurement method, comprising the following steps:

[0006] Obtain a data set to be clustered, and process the data set by using a preset function to generate a sample set with the same order of magnitude of the same dimension;

[0007] Combine a preset clustering algorithm and a set number of clusters to generate multiple clusters from the sample set, and obtain the between-cluster scatter value and the within-cluster compactness value;

[0008] Construct a penalty term according to the logarithmic function;

[0009] Combine the between-cluster scatter value, the within-cluster compactness value and the penalty term, and output the first clustering result.

[0010] Further as a preferred embodiment, the step of obtaining the dataset to be clustered and processing the dataset with a preset function to generate a sample set with the same order of magnitude in the same dimension specifically includes the following steps:

[0011] Obtain the dataset to be clustered;

[0012] Combine the values of any data in the dataset in each dimension with the mean value of the entire dataset in each dimension to generate a deviation dataset;

[0013] Combine the values of any deviation data in the deviation dataset in each dimension with the standard deviation of the data in the corresponding dataset in each dimension to generate a sample set with the same order of magnitude in the same dimension.

[0014] Further as a preferred embodiment, the step of combining a preset clustering algorithm and a set number of clusters to generate multiple clusters from the sample set and obtaining the inter-cluster dispersion value and the intra-cluster compactness value specifically includes the following steps:

[0015] Generate multiple clusters from the sample set according to a preset clustering algorithm and a set number of clusters;

[0016] Obtain the distance matrix between the sample points within each cluster, and calculate the mean square distance of each cluster by combining the distance matrix between the sample points within each cluster;

[0017] Combine the mean square distances of each cluster to calculate the sum of squared errors within the cluster, that is, the intra-cluster compactness value;

[0018] Obtain the distance matrix between all sample points, and calculate the mean square distance of all sample points by combining the distance matrix between the sample points;

[0019] Combine the mean square distances of each cluster and the mean square distance of all sample points to calculate the sum of squared errors between clusters, that is, the inter-cluster dispersion value.

[0020] Further as a preferred embodiment, the step of constructing a penalty term according to a logarithmic function specifically includes the following steps:

[0021] Take the logarithm of the difference between the sample size and the number of clustering clusters to generate the first part of the target penalty term;

[0022] Take the difference between the number of clustering clusters and 1 to generate the second part of the target penalty term;

[0023] Combine the first part and the second part of the penalty term to obtain the penalty term by taking the quotient, that is, divide the first part of the penalty term by the second part of the penalty term to get the penalty term.

[0024] Further as a preferred embodiment, the step of combining the inter-cluster dispersion value, the intra-cluster compactness value, and the penalty term to output the first clustering result specifically includes the following steps:

[0025] Obtain the first clustering result by multiplying the ratio of the inter-cluster dispersion value to the intra-cluster compactness value by the penalty term;

[0026] Output a clustering evaluation value according to the preset number of clustering clusters. If the evaluation value meets the preset conditions, output the first clustering result. Otherwise, return to execute the cluster number setting step until the evaluation value corresponding to the number of clustering clusters meets the preset conditions, and output the first clustering result.

[0027] The second technical solution adopted by the present invention is:

[0028] A clustering evaluation metric system, comprising:

[0029] A generation module, configured to obtain a data set to be clustered, and process the data set by using a preset function to generate a sample set with the same order of magnitude in the same dimension;

[0030] An acquisition module, configured to combine a preset clustering algorithm and a set number of clusters to generate multiple clusters from the sample set, and obtain the inter-cluster dispersion value and the intra-cluster compactness value;

[0031] A construction module, configured to construct a penalty term according to a logarithmic function;

[0032] An output module, configured to output the first clustering result by combining the inter-cluster dispersion value, the intra-cluster compactness value, and the penalty term.

[0033] Further as a preferred embodiment, the generation module includes:

[0034] A first acquisition unit, configured to obtain a data set to be clustered;

[0035] A first generation unit, configured to generate a deviation data set by combining the values of any data in the data set in each dimension with the mean value of the entire data set in each dimension;

[0036] A second generation unit, configured to generate a sample set with the same order of magnitude in the same dimension by combining the values of any deviation data in the deviation data set in each dimension with the standard deviation of the data in the corresponding data set in each dimension.

[0037] Further as a preferred embodiment, the acquisition module includes:

[0038] A third generation unit, configured to generate multiple clusters from the sample set according to a preset clustering algorithm and a set number of clusters;

[0039] A first determination unit, configured to determine the sum of squared errors within the cluster, that is, the intra-cluster compactness value, by combining the mean square distance of each cluster;

[0040] A third acquisition unit, configured to obtain the distance matrix between all sample points, and calculate the mean square distance of all sample points by combining the distance matrix between sample points.

[0041] A second determination unit, configured to determine the sum of squared errors between clusters, that is, the inter-cluster dispersion value, by combining the squared distance of each cluster and the squared distance of all sample points.

[0042] Further as a preferred embodiment, the construction module includes:

[0043] A fourth generation unit, configured to take the logarithm of the difference between the sample size and the number of clustering clusters to generate the first part of the target penalty term;

[0044] A fifth generation unit, configured to subtract 1 from the number of clustering clusters to generate the second part of the target penalty term;

[0045] A sixth generation unit, configured to obtain the penalty term by combining the first part and the second part of the penalty term and taking the quotient, that is, the penalty term is obtained by dividing the first part of the penalty term by the second part of the penalty term.

[0046] Further as a preferred embodiment, the output module includes:

[0047] A fourth acquisition unit, configured to combine the ratio of the inter-cluster dispersion value to the intra-cluster compactness value and multiply by the penalty to output a first clustering result;

[0048] A judgment unit, configured to output a clustering evaluation value according to a preset number of clustering clusters. If the evaluation value meets the preset conditions, the first clustering result is output. Otherwise, the number of clusters setting step is returned until the evaluation value corresponding to the number of clustering clusters meets the preset conditions, and the first clustering result is output.

[0049] The third technical solution adopted by the present invention is:

[0050] A device, wherein the memory is used to store at least one program, and the processor is used to load the at least one program to execute the above method.

[0051] The fourth technical solution adopted by the present invention is:

[0052] A storage medium, in which instructions executable by a processor are stored, and the instructions executable by the processor are used to execute the above method when executed by the processor.

[0053] The beneficial effects of the present invention are as follows: A sample set with the same order of magnitude in the same dimension is generated by processing the wine data set to be clustered through a preset function set. Multiple clusters are generated from the sample set according to the preset clustering algorithm and the set number of clusters, and the inter-cluster dispersion value and the intra-cluster compactness value are output. Finally, according to the ratio of the inter-cluster dispersion value to the intra-cluster compactness value multiplied by the penalty term, the first clustering result is output, thereby reducing the influence of the dimension of each sample and the outliers on the clustering result. In addition, the introduction of the logarithmic function in the penalty term makes the evaluation index immune to the inaccuracy caused by the excessive sample size, realizing the improvement of the effectiveness of the clustering effect of the wine data. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 is a flowchart of the steps of a clustering evaluation metric method of the present invention;

[0055] Figure 2 is a block diagram of the structure of a clustering evaluation metric system of the present invention;

[0056] Figure 3 is a schematic diagram drawn based on the classification result without normalization processing;

[0057] Figure 4 is a schematic diagram drawn based on the classification result after processing by the clustering evaluation metric method provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0058] As Figure 1 shown, it is a flowchart of a clustering evaluation metric method provided by an embodiment of the present invention, which specifically includes the following steps:

[0059] S1. Obtain the data set to be clustered, and process the data set by using a preset function to generate a sample set with the same order of magnitude in the same dimension;

[0060] S2. Combine the preset clustering algorithm and the set number of clusters to generate multiple clusters from the sample set, and obtain the inter-cluster dispersion value and the intra-cluster compactness value;

[0061] S3. Construct a penalty term according to the logarithmic function;

[0062] S4. Combine the inter-cluster dispersion value, the intra-cluster compactness value and the penalty term to output the first clustering result.

[0063] In this embodiment, the system obtains the input dataset to be clustered, performs dimensionless and outlier processing on the dataset through a preset function, so that the data in the dataset are samples of the same order of magnitude in the corresponding same dimension and the influence of outliers, that is, outliers, is excluded, and a sample set is established. Then, using the set number of clusters and a preset clustering algorithm, the sample set is generated into multiple different clusters. After that, the dispersion value between clusters and the compactness value within clusters are calculated and output. Finally, according to the ratio of the dispersion value between clusters and the compactness value within clusters multiplied by the penalty term, the first clustering result corresponding to the number of clustering clusters is output, thereby reducing the influence of the dimension of each dimension of the sample and outliers on the clustering result, reducing the inaccurate influence caused by the excessive sample size, and improving the effectiveness of the clustering result; Dimension refers to the physical inherent and measurable physical properties. Usually, a physical quantity is composed of two factors: its own physical properties (i.e., dimension) and the measurement unit determined to measure the physical properties. Each physical quantity has only one dimension. In the International System of Units, the corresponding symbols of the basic physical quantities such as length, mass, time, current, thermodynamic temperature, amount of substance, and luminous intensity are l, m, t, i, Q, N, and J respectively; Outliers, that is, abnormal points, refer to individual samples in the sample set with particularly large values in each dimension, which will not only affect the value of the mean but also affect the accuracy of clustering; The preset function in this embodiment includes but is not limited to the function in the CH index function where is the value of the processed sample, σ is the standard deviation of the original sample, is the mean of the original sample, logarithmic function processing, arccotangent function processing, etc. In this embodiment, the function in the CH index is preferably used for processing. The preset clustering algorithm includes but is not limited to K-means clustering, hierarchical clustering, density-based spatial clustering of applications with noise, etc. In this embodiment, a logarithmic function (log function) is introduced into the penalty term to limit the numerator in the original penalty term, reducing the inaccurate influence of the evaluation value caused by the excessive sample size. The advantage of the logarithmic function (log function) is that it retains the original monotonicity of the data, does not affect the role of the penalty term, and also makes the evaluation value more accurate. This embodiment will not be elaborated.

[0064] Further, as a preferred embodiment, step S1 specifically includes the following steps:

[0065] S10. Obtain the dataset to be clustered;

[0066] S11. Combine the values of any data in each dimension of the dataset with the mean of the entire dataset in each dimension to generate a deviation dataset;

[0067] S12. Combine the values of any deviation data in each dimension of the deviation dataset with the standard deviation of the data in each dimension of the corresponding dataset to generate a sample set with the same order of magnitude in the same dimension.

[0068] Specifically, obtain the dataset to be clustered, such as {X ij ︱1 ≤ i ≤ m, 1 ≤ j ≤ n}, where m refers to the dimension of the samples, n refers to the number of samples, and both m and n are natural numbers greater than 1. σ i refers to the standard deviation of the samples in dimension i. Then, take any data, such as X .j Let That is, the deviation data. Let Z i. = Y i. / σ i. That is, the sample, where X .j is the j-th data, is the mean value of each data in the dataset in each dimension, Y .j is the j-th deviation data, Y i. is the value of the deviation data in dimension i, Z i. is the value of the sample in dimension i. Finally, generate the deviation dataset {Y ij ︱1 ≤ i ≤ m, 1 ≤ j ≤ n} and the sample set {Z ij ︱1 ≤ i ≤ m, 1 ≤ j ≤ n} where the dimensions of each sample are the same.

[0069] Further, as a preferred embodiment, the step S2 specifically includes the following steps:

[0070] S20. Generate multiple clusters from the sample set according to a preset clustering algorithm and the set number of clusters;

[0071] S21. Obtain the distance matrix between sample points within each cluster, and calculate the mean square distance of each cluster by combining the distance matrices between sample points within each cluster;

[0072] S22. Determine the sum of squared errors within the cluster, that is, the within-cluster compactness value, by combining the mean square distances of each cluster;

[0073] S23. Obtain the distance matrix between all sample points, and calculate the mean square distance of all sample points by combining the distance matrix between sample points;

[0074] S24. Calculate the sum of squared errors between clusters, that is, the between-cluster dispersion value, by combining the mean square distances of each cluster and the mean square distance of all sample points.

[0075] Specifically, divide the sample set {Z ij ︱1 ≤ i ≤ n, 1 ≤ j ≤ m}, where n is the number of samples and m is the dimension of the samples, into k clusters through a preset clustering algorithm and the set number of clusters k. Here, k is a natural number greater than 1. Then, calculate the within-cluster compactness value, the between-cluster dispersion value, and the penalty term respectively. For the within-cluster compactness value, first calculate the Euclidean distance between sample points within each cluster, and then calculate the square of the Euclidean distance between sample points within each cluster divided by the number of samples, that is, the mean square distance of the i-th cluster Next, calculate the within-cluster compactness of all clusters. For the between-cluster compactness, first calculate the Euclidean distance between all sample points, then calculate the square of the Euclidean distance between sample points and divide it by the number of samples, that is, the mean square distance. Next, calculate the between-cluster dispersion of all clusters. For the penalty term, take the logarithm of the difference between the sample size n and the number of clustering clusters, and then divide it by the difference between the number of clustering clusters and 1. And it is required that the sample size is greater than the number of clustering clusters, and the number of clustering clusters is greater than 1, that is

[0076] Further as a preferred embodiment, step S3 specifically includes the following steps:

[0077] S30. Take the logarithm of the difference between the sample size and the number of clustering clusters to generate the first part of the target penalty term;

[0078] S31. Take the difference between the number of clustering clusters and 1 to generate the second part of the target penalty term;

[0079] S32. Combine the first part and the second part of the penalty term to obtain the quotient as the penalty term, that is, divide the first part of the penalty term by the second part of the penalty term to get the penalty term.

[0080] Further as a preferred embodiment, step S4 specifically includes the following steps:

[0081] S40. Combine the ratio of the between-cluster dispersion value to the within-cluster compactness value and multiply it by the penalty term to obtain the optimal number of clustering clusters;

[0082] S41. Determine whether the evaluation value corresponding to the given number of clustering clusters meets the preset conditions. If it meets, output the first clustering result. Otherwise, return to execute the cluster number setting step until the evaluation value corresponding to the number of clustering clusters meets the preset conditions, and output the first clustering result.

[0083] In this embodiment, the preset condition refers to the optimal number of clustering clusters corresponding to the maximum value obtained by multiplying the ratio of the between-cluster dispersion value to the within-cluster compactness value by the penalty term. At this time, the samples between clusters are relatively most dispersed, and the samples within each cluster are relatively most compact, and the clustering effect is optimal; specifically, the obtained between-cluster dispersion value and the within-cluster compactness value are divided, that is, BGSS / WGSS. The larger the BGSS / WGSS value, the closer the sample points within the cluster and the more dispersed the sample points between clusters, and the better the clustering effect. On the contrary, the smaller the BGSS / WGSS value, the more dispersed the sample points within the cluster and the closer the sample points between clusters, and the worse the clustering effect. In addition, it is also necessary to multiply by the penalty term (n > k, k > 1). Similarly, when When the value reaches the maximum, it indicates that the clustering effect is optimal at this time. Output the corresponding optimal number of clustering clusters k′, return the optimal number of clustering clusters k′ to the system to execute the step of setting the number of clusters, and finally output the first clustering result corresponding to the optimal number of clustering clusters k′.

[0084] As Figure 2 shown, it is a structural block diagram of a clustering evaluation metric system of the present invention, including:

[0085] A clustering evaluation metric system, including:

[0086] A generation module, configured to obtain a data set to be clustered, and process the data set by using a preset function to generate a sample set with the same order of magnitude in the same dimension;

[0087] An acquisition module, configured to combine a preset clustering algorithm and a set number of clusters to generate multiple clusters from the sample set, and obtain the inter-cluster dispersion value and the intra-cluster compactness value;

[0088] A construction module, configured to construct a penalty term according to a logarithmic function;

[0089] An output module, configured to combine the inter-cluster dispersion value, the intra-cluster compactness value, and the penalty term to output a first clustering result.

[0090] Further as a preferred embodiment, the generation module includes:

[0091] A first acquisition unit, configured to obtain a data set to be clustered;

[0092] A first generation unit, configured to generate a deviation data set by combining the values of any data in the data set in each dimension with the mean value of the entire data set in each dimension;

[0093] A second generation unit, configured to generate a sample set with the same order of magnitude in the same dimension by combining the values of any deviation data in the deviation data set in each dimension with the standard deviation of the data in the corresponding data set in each dimension.

[0094] Further as a preferred embodiment, the acquisition module includes:

[0095] A third generation unit, configured to generate multiple clusters from the sample set according to a preset clustering algorithm and a set number of clusters;

[0096] A first determination unit, configured to determine the sum of squared errors within the cluster, that is, the intra-cluster compactness value, by combining the mean squared distances of each cluster;

[0097] A third acquisition unit, configured to obtain the distance matrix between all sample points, and calculate the mean squared distance of all sample points by combining the distance matrix between sample points;

[0098] A second determination unit, configured to determine the sum of squared errors between clusters, i.e., the inter-cluster dispersion value, by combining the squared distances of each cluster and the squared distances of all sample points.

[0099] Further as a preferred embodiment, the construction module includes:

[0100] A fourth generation unit, configured to take the logarithm of the difference between the sample size and the number of clustering clusters, and generate the first part of the target penalty term;

[0101] A fifth generation unit, configured to take the difference between the number of clustering clusters and 1, and generate the second part of the target penalty term;

[0102] A sixth generation unit, configured to obtain the penalty term by taking the quotient of the first part and the second part of the penalty term, i.e., the penalty term is obtained by dividing the first part of the penalty term by the second part of the penalty term.

[0103] Further as a preferred embodiment, the output module includes:

[0104] A fourth acquisition unit, configured to multiply the ratio of the inter-cluster dispersion value to the intra-cluster compactness value by the penalty, and output the first clustering result;

[0105] A judgment unit, configured to output a clustering evaluation value according to a preset number of clustering clusters. If the evaluation value meets the preset conditions, the first clustering result is output. Otherwise, the number of clusters setting step is returned to be executed until the evaluation value corresponding to the number of clustering clusters meets the preset conditions, and the first clustering result is output.

[0106] An apparatus, wherein the memory is configured to store at least one program, and the processor is configured to load the at least one program to execute the method described in Embodiment 1.

[0107] An apparatus according to this embodiment can execute a clustering evaluation metric method provided in Method Embodiment 1 of the present invention, can execute any combination of implementation steps of the method embodiment, and has the corresponding functions and beneficial effects of the method.

[0108] A storage medium, wherein instructions executable by a processor are stored, and the instructions executable by the processor are used to execute the method as described in Embodiment 1 when executed by the processor.

[0109] A storage medium according to this embodiment can execute a clustering evaluation metric method provided in Method Embodiment 1 of the present invention, can execute any combination of implementation steps of the method embodiment, and has the corresponding functions and beneficial effects of the method. Specific embodiments

[0111] Such as Figure 3 and Figure 4They are respectively the schematic diagram of the classification result without standardization processing and the schematic diagram of the classification result after processing by the clustering evaluation metric method provided by the technical solution of the present application.

[0112] Obtain the wine data to be classified. The number of data categories of wine data is 159, 271, and 348 respectively.

[0113] Input the wine data into the clustering evaluation system without standardization processing and the penalty term of this system is not optimized, and the CH algorithm clustering evaluation system with Z-Score standardization introduced and the optimized penalty term added for clustering evaluation. The input clustering results are as Figure 3 and Figure 4 shown.

[0114] From Figure 3 it can be seen that the optimal CH value is 2, which does not match the actual number of categories.

[0115] From Figure 4 it can be seen that the optimal number of categories is 3, which is consistent with the actual data set.

[0116] Let Z i. = Y i. / σ i. Sample set {X ij ︱1 ≤ i ≤ n, 1 ≤ j ≤ m}, σ i. is the standard deviation of dimension i, m represents the dimension of the sample set. The Calinski-Harabasz algorithm after Z-Score standardization is called NormalizedCalinski-Harabasz (NCH), and the expression is as follows:

[0117]

[0118] Among them,

[0119]

[0120] Among them, d is used to calculate the distance of the standardized sample set.

[0121] Since there will be a penalty term (i.e., ) after introducing standardization, which has a greater impact on the value of NCH after Z-score standardization (the Calinski-Harabasz algorithm is called Normalized Calinski-Harabasz), so the penalty term is optimized, (n > k, k > 1).

[0122] The above is a specific description of the preferred embodiment of the present invention. However, the present invention is not limited to the described embodiment. Those skilled in the art can make various equivalent deformations or substitutions without departing from the spirit of the present invention, and these equivalent deformations or substitutions are all included within the scope defined by the claims of this application.

Claims

1. A clustering evaluation metric method for wine data, characterized in that It includes the following steps: Obtain the wine dataset to be clustered, and process the wine dataset using a preset function to generate a sample set with the same order of magnitude in the same dimension; The step of obtaining the wine dataset to be clustered, processing the wine dataset using a preset function to generate a sample set with the same order of magnitude in the same dimension specifically includes the following steps: Obtain the wine dataset to be clustered; Combine the values of any data in each dimension of the wine dataset with the mean values of all wine datasets in each dimension to generate a deviation dataset; Combine the values of any deviation data in each dimension of the deviation dataset with the standard deviation of the data in each dimension of the corresponding wine dataset to generate a sample set with the same order of magnitude in the same dimension; Specifically, obtain the wine dataset {X ij ︱1 ≤ i ≤ m, 1 ≤ j ≤ n} to be clustered, where m refers to the dimension of the samples, n represents the number of samples. Both m and n are natural numbers greater than 1. σ i represents the standard deviation of the samples in dimension i. Take any data X .j , and let to obtain the deviation data. Let Z i. =Y i. / σ i. , to obtain the samples. Among them, X .j is the j-th data, is the mean of each data in the wine dataset in each dimension. Y .j is the j-th deviation data. Y i. is the value of the deviation data in dimension i. Z i. is the value of the sample in dimension i. Generate the deviation dataset {Y ij ︱1 ≤ i ≤ m, 1 ≤ j ≤ n} and the sample set {Z ij ︱1 ≤ i ≤ m, 1 ≤ j ≤ n}; Combine a preset clustering algorithm and a set number of clusters to generate multiple clusters from the sample set, and obtain the inter-cluster dispersion value and the intra-cluster compactness value; Construct a penalty term according to the logarithmic function; Combine the inter-cluster dispersion value, the intra-cluster compactness value and the penalty term to output the first clustering result of the wine data; Specifically, the inter-cluster dispersion value the intra-cluster compactness value the penalty term is k is the number of clusters, is the mean square of the moments of the i-th cluster, n i is the number of sample points within the i-th cluster, is the mean square of the moments of all clusters. The first clustering result of the wine data is determined by the Calinski-Harabasz algorithm after Z-Score standardization. The expression of the Calinski-Harabasz algorithm after Z-Score standardization is: NCH k is the value of the Calinski-Harabasz algorithm after Z-Score standardization.

2. The clustering evaluation metric method for wine data according to claim 1, wherein, The step of combining a preset clustering algorithm and a set number of clusters to generate multiple clusters from the sample set, and obtaining the inter-cluster dispersion value and the intra-cluster compactness value specifically includes the following steps: Generate multiple clusters from the sample set according to a preset clustering algorithm and a set number of clusters; Obtain the distance matrix between sample points within each cluster, and calculate the mean square distance of each cluster by combining the distance matrix between sample points within each cluster; Combine the mean square distances of each cluster to determine the sum of squared errors within the cluster, that is, the intra-cluster compactness value; Obtain the distance matrix between all sample points, and calculate the mean square distance of all sample points by combining the distance matrix between sample points; Combine the mean square distances of each cluster and the mean square distance of all sample points to determine the sum of squared errors between clusters, that is, the inter-cluster dispersion value.

3. A clustering evaluation metric method for wine data according to claim 2, characterized in that The step of obtaining the first clustering result according to the ratio of the inter-cluster dispersion value to the intra-cluster compactness value multiplied by the penalty term specifically includes the following steps: Combine the ratio of the inter-cluster dispersion value to the intra-cluster compactness value and multiply by the penalty term to obtain the corresponding number of clustering clusters; Output a clustering evaluation value according to the preset number of clustering clusters. If the evaluation value meets the preset conditions, output the first clustering result of the wine data. Otherwise, return to execute the cluster number setting step until the evaluation value corresponding to the number of clustering clusters meets the preset conditions, and output the first clustering result of the wine data.

4. A clustering evaluation metric system for wine data, characterized in that, It includes: A generation module for obtaining the wine dataset to be clustered, and processing the wine dataset using a preset function to generate a sample set with the same order of magnitude in the same dimension; The obtaining of the wine dataset to be clustered, and processing the wine using a preset function The step of generating a sample set with the same order of magnitude in the same dimension from the dataset specifically includes the following steps: obtaining the wine dataset to be clustered; combining the values of any data in each dimension of the wine dataset with the mean values of all the wine datasets in each dimension to generate a deviation dataset; combining the values of any deviation data in each dimension of the deviation dataset with the standard deviation of the corresponding data in the wine dataset in each dimension to generate a sample set with the same order of magnitude in the same dimension; specifically, obtaining the wine dataset to be clustered {X ij ︱1 ≤ i ≤ m, 1 ≤ j ≤ n}, where m refers to the dimension of the sample, n refers to the number of samples, both m and n are natural numbers greater than 1, σ i refers to the standard deviation of the sample in dimension i, taking any data X .j , let to obtain the deviation data, let Z i. = Y i. / σ i. to obtain the sample, where X .j is the j-th data, is the mean value of each data in the wine dataset in each dimension, Y .j is the j-th deviation data, Y i. is the value of the deviation data in dimension i, Z i. is the value of the sample in dimension i, generating the deviation dataset {Y ij ︱1 ≤ i ≤ m, 1 ≤ j ≤ n} and the sample set {Z ij ︱1 ≤ i ≤ m, 1 ≤ j ≤ n} with the same dimension and unit for each sample; An obtaining module for combining a preset clustering algorithm and a set number of clusters to generate multiple clusters from the sample set, and obtaining the inter-cluster dispersion value and the intra-cluster compactness value; A construction module for constructing a penalty term according to the logarithmic function; An output module for combining the inter-cluster dispersion value, the intra-cluster compactness value and the penalty term to output the first clustering result of the wine data; Specifically, the inter-cluster dispersion value the intra-cluster compactness value The penalty term is k is the number of clusters, is the mean square of the moments of the i-th cluster, n i is the number of sample points in the i-th cluster, is the mean square of the moments of all clusters. The first clustering result of the wine data is determined by the Calinski-Harabasz algorithm after Z-Score standardization. The expression of the Calinski-Harabasz algorithm after Z-Score standardization is: NCH k is the value of the Calinski-Harabasz algorithm after Z-Score standardization.

5. A clustering evaluation metric system for wine data according to claim 4, characterized in that, The obtaining module includes: A third generation unit for generating multiple clusters from the sample set according to a preset clustering algorithm and a set number of clusters; A second obtaining unit, configured to obtain a distance matrix between sample points within each cluster, and calculate the mean square of distances of each cluster by combining the distance matrices between sample points within each cluster; A first determining unit, configured to determine the within-cluster sum of squared errors, that is, the within-cluster compactness value, by combining the mean square of distances of each cluster; A third obtaining unit, configured to obtain a distance matrix between all sample points, and calculate the mean square of distances of all sample points by combining the distance matrix between sample points; A second determining unit, configured to determine the between-cluster sum of squared errors, that is, the between-cluster dispersion value, by combining the mean square of distances of each cluster and the mean square of distances of all sample points; 6. The clustering evaluation metric system for wine data according to claim 5, wherein, The output module includes: A fourth obtaining unit, configured to obtain a corresponding number of clustering clusters by multiplying the ratio of the between-cluster dispersion value to the within-cluster compactness value by a penalty term; A judging unit, configured to output a clustering evaluation value according to a preset number of clustering clusters. If the evaluation value meets the preset conditions, output a first clustering result of the wine data. Otherwise, return to execute the cluster number setting step until the evaluation value corresponding to the number of clustering clusters meets the preset conditions, and output a first clustering result of the wine data.

7. A clustering evaluation metric device for wine data, characterized in that, It includes a memory and a processor. The memory is used to store at least one program, and the processor is used to load the at least one program to execute the method according to any one of claims 1-3.

8. A storage medium storing instructions executable by a processor, characterized in that, The instructions executable by the processor, when executed by the processor, are used to execute the method according to any one of claims 1-3.