Unbalanced data processing method based on SMOTE algorithm and hexagon mechanism
By mapping multi-dimensional data to a two-dimensional plane and using the selection probability of hexagonal areas, combined with the SMOTE algorithm to generate new samples, the blindness and noise problems of the SMOTE algorithm in unbalanced data processing are solved, and the performance and performance of the classifier are improved. Data balance.
Patent Information
- Application Number
- CN202411204819.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-08-30
AI Technical Summary
The SMOTE algorithm has problems such as blindness, noise generation, sample overlap, and boundary ambiguity when dealing with unbalanced data, resulting in a decline in classifier performance.
Map multi-dimensional data to a two-dimensional plane, use hexagonal areas to construct scoring rules to obtain selection probabilities, and combine it with the SMOTE algorithm to generate new samples to avoid blindness and noise, reduce sample overlap, and clarify boundaries.
It improves the accuracy of data processing and classifier performance, reduces the risk of overfitting, effectively balances the data set, and reduces the impact of noise.
Smart Images

Figure CN118709052A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of machine learning, and in particular relates to an unbalanced data processing method based on a SMOTE algorithm and a hexagonal mechanism. Background Art
[0002] Machine learning is one of the hottest subjects at present. As an important part of machine learning, classification problems are ubiquitous in practical applications, such as common face recognition, speech recognition, medical diagnosis, fraud detection, information retrieval systems, etc. However, in practical applications, when faced with classification problems, it is inevitable to encounter a serious imbalance in the proportions between classes. This situation is also called unbalanced classification, which has attracted widespread attention and research in the industry. For example, insurance claims and hardware failures are rare events in real life; observation samples account for only a small number of fraud analysis sample sets; and only a small part of the world's population suffers from a certain disease. Therefore, the unbalanced classification problem is usually an extension of the binary classification problem.
[0003] It is undeniable that the widely existing imbalanced data is often not suitable for standard classifiers. Generally speaking, the class with fewer samples is called the minority class, and the class with more samples is called the majority class. The imbalance ratio (IR) is the ratio of the number of majority class samples to the number of minority class samples, and is usually used to evaluate the severity of imbalance in a dataset. Due to the significant difference in the number of majority class samples and minority class samples in an imbalanced dataset, traditional classifiers tend to classify all samples as the majority class, resulting in a decrease in classifier performance.
[0004] In order to obtain valuable information from imbalanced data, predecessors have summarized two basic directions of solutions: algorithm-level research and data-level research. The algorithm-level method is to use cost-sensitive learning to adjust the weight of samples. They increase the weight of misclassified minority class samples or reduce the weight of correctly classified minority class samples. Therefore, cost-sensitive learning is an improvement on the classifier without changing the original data. However, data-level algorithms focus on how to balance unbalanced data sets. This is the biggest difference between algorithms at the algorithm level and data level. Data-level methods are generally divided into oversampling, undersampling, and mixed sampling. The idea of undersampling is to delete majority class samples. Therefore, undersampling is rarely used because it deletes valuable data. Random oversampling (ROS) simply copies minority class samples, but may cause overfitting and amplify noise. Therefore, in order to address the shortcomings of ROS, Chawla et al. proposed synthetic minority oversampling technology (SMOTE).
[0005] SMOTE is a classic and mainstream oversampling method. x , randomly select a sample x i , i=1,2,3..., k ,from k Random selection among neighbors x and x i A point between x new .set up λ is a random number between 0 and 1, the formula is as follows:
[0006] Therefore, the SMOTE algorithm is a process of generating new samples by linear interpolation. The samples generated by SMOTE are often located in the minority class area, which is sufficient to ensure the rationality of the new samples. In addition, there is no longer a simple coverage relationship between the new samples and the original samples, which effectively reduces the risk of overfitting. It ensures that the minority class dataset processed by SMOTE can approximate the distribution of the original minority class dataset.
[0007] Although the SMOTE algorithm is widely used as a classic mainstream oversampling method, it also has many problems: (1) SMOTE is blind. The points used by the algorithm to synthesize samples are randomly selected from the minority class points and their neighboring points. The synthesized new samples are also randomly selected on their connecting lines, and the k value of the k nearest neighbors is not fixed.
[0008] (2) SMOTE does not consider the distribution of samples and neighbors, and does not use any majority class information. The algorithm only selects a few points from the k nearest neighbors for synthesis. This may also produce noisy results, such as new samples generated in the majority class area.
[0009] (3) When the data set is small or the number of minority class samples is small, SMOTE only takes values between the minority class samples, which may cause sample overlap and increase noise due to repeated sampling. This can easily lead to overfitting.
[0010] (4) When the minority class samples are located at the edge of the distribution between the minority class and the majority class, the new samples generated by the minority class samples and their neighbors will also be located at this edge through the SMOTE algorithm. This makes the boundary between the majority class and the minority class increasingly blurred. Although the SMOTE algorithm improves the balance of the data set, the fuzzy boundary problem increases the difficulty of the classification algorithm.
[0011] Therefore, there is an urgent need for an unbalanced data processing method based on the SMOTE algorithm and the hexagonal mechanism to solve the above problems. Summary of the invention
[0012] To solve the above technical problems, the present invention proposes an unbalanced data processing method based on the SMOTE algorithm and the hexagonal mechanism. The data processed by the present invention has better performance on the classifier than the data processed by the SMOTE algorithm and its variants.
[0013] To achieve the above object, the present invention provides an unbalanced data processing method based on the SMOTE algorithm and the hexagonal mechanism, comprising: Mapping the multi-dimensional unbalanced data to a two-dimensional plane, and using hexagons to cover the two-dimensional plane to obtain a hexagonal area; Based on the hexagonal area, construct a hexagonal scoring rule to obtain the selection probability of the hexagonal area; Based on the selection probability of the hexagonal area, the SMOTE algorithm is used to synthesize new samples.
[0014] Optionally, mapping the multidimensional unbalanced data to the two-dimensional plane includes: mapping the multidimensional unbalanced data to the two-dimensional plane using a principal component analysis method.
[0015] Optionally, using hexagons to fill the two-dimensional plane, and obtaining the hexagonal area includes: Obtaining a majority class sample set and a minority class sample set on the two-dimensional plane; Based on the majority class sample set and the minority class sample set, obtaining the optimal side length of the hexagon; The two-dimensional plane is covered according to the optimal side length to obtain the hexagonal area.
[0016] Optionally, based on the majority class sample set and the minority class sample set, a method for obtaining the optimal side length of the hexagon is:
[0017] in, is the average distance from each minority class sample to other minority class samples, i is the sample number taken, j For the taken i Different sample numbers, m is the total number of minority class samples, For the minority class samples, For Different minority class samples, is the average of the minimum distances from each minority class sample to other minority class samples, is the average distance from each sample to other samples, is a sample in the sample set, For all samples Different samples, n is the total number of samples in the sample set, is the average of the minimum distances from each sample to other samples, d G is the side length of the tessellated hexagon, a is the edge length adaptation factor, for and The distance between for x i and x j The distance between them, min() is the minimum function, is the summation symbol.
[0018] Optionally, constructing a hexagonal scoring rule based on the hexagonal area, and obtaining the selection probability of the hexagonal area includes: According to the majority class sample set and the minority class sample set, in combination with a naming rule, the polygonal area is named to obtain a named hexagonal area; Assimilate the named hexagonal area by using the assimilation rule to obtain the assimilated hexagonal area; Based on the hexagonal area and the assimilated hexagonal area and in combination with a scoring rule, the selection probability of any hexagonal area is obtained.
[0019] Optionally, the selection probability is: , in, P select is the selection probability, G one is the sampling area participating in the current probability calculation, For Region G one The total score, b is the boundary weight coefficient, assuming that there are a total of H areas that can participate in sampling, Corresponding to each small area in the H areas, P is G one The weight of the region.
[0020] Optionally, synthesizing new samples using the SMOTE algorithm based on the selection probability of the hexagonal area includes: Based on the selection probability, selecting a preset hexagonal area and an adjacent area of the preset hexagonal area; Selecting a minority class sample in each of the preset hexagonal area and the adjacent area; Interpolation synthesis is performed on the minority class samples to obtain the new samples.
[0021] Optionally, the interpolation synthesis method is: , in, A M is a minority class sample, is the M-1th original sample, a M is the Mth original sample selected, r M A random number between 0 and 1.
[0022] Compared with the prior art, the present invention has the following advantages and technical effects: 1. The present invention reduces the dimensionality of the data to a two-dimensional plane, constructs a hexagonal scoring rule to select multiple samples suitable for synthesis, and uses the SMOTE algorithm to synthesize new samples in the original dimensional space.
[0023] 2. The present invention formulates reasonable point selection rules to avoid blindness and abandons the use of k nearest neighbors.
[0024] 3. The present invention uses hexagonal regions to divide samples, which takes into account the influence of sample distribution to a certain extent. At the same time, the information of all points is fully utilized when scoring and selecting points. Moreover, due to the limitation of the size of hexagons and the fact that synthesis only occurs in adjacent areas, the influence and generation of noise samples are effectively reduced; 4. The number of minority classes selected by the present invention for synthesizing new sample points is equal to the number of hexagonal areas and their adjacent hexagons. This dynamic interpolation method using multiple points greatly avoids the sample overlap and overfitting problems caused by random point selection in pairs; 5. The present invention assigns a lower score to the boundary area to ensure that fewer points are generated at the boundary, thereby alleviating the occurrence of boundary blur. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 is a flow chart of an unbalanced data processing method based on the SMOTE algorithm and the hexagonal mechanism according to an embodiment of the present invention; Figure 2 is a flow chart of the assimilation process of an embodiment of the present invention; Figure 3 Schematic diagram of sampling areas obtained under different side length adaptation factors according to an embodiment of the present invention; Figure 4 It is a synthetic schematic diagram of an embodiment of the present invention; Figure 5 is a sampling schematic diagram of an embodiment of the present invention, wherein: Figure 5(a) is a sampling diagram using the dermatology-6 dataset as an example. Figure 5 (b) is a sampling diagram using the yeast5 dataset as an example. Figure 5 (c) is a sampling diagram using the gpoker-8-9 vs 5 dataset as an example; Figure 6 This is a box plot of the test results of the embodiment of the present invention, where: Figure 6 (a) is the box plot of the F1_score indicator of each model on all data sets, Figure 6 (b) is the G-means indicator box plot of each model on all data sets, Figure 6 (c) is a box plot of the AUC indicator of each model on all data sets. DETAILED DESCRIPTION
[0026] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0027] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0028] The present invention proposes an unbalanced data processing method based on the SMOTE algorithm and the hexagonal mechanism, such as Figure 1 As shown, specifically including: Map the multi-dimensional unbalanced data to a two-dimensional plane, and use hexagons to cover the two-dimensional plane to obtain the hexagonal area; Based on the hexagonal area, a hexagonal scoring rule is constructed to obtain the selection probability of the hexagonal area; Based on the selection probability of the hexagonal area, the SMOTE algorithm is used to synthesize new samples.
[0029] Furthermore, mapping the multidimensional unbalanced data to a two-dimensional plane includes: mapping the multidimensional unbalanced data to a two-dimensional plane using a principal component analysis method.
[0030] Specifically, the present invention mainly uses the principal component analysis algorithm (PCA) to map the data to a new coordinate system through linear transformation, and retains the most critical data information by retaining the most significant features of the data set. The subsequent dense paving problem in mathematics involves considering that only regular triangles, regular quadrilaterals or regular hexagons can be used to cover a plane. However, it is difficult to find hypergeometric bodies with the same effect in high-dimensional spaces of different dimensions. Therefore, PCA must be used to extract the two-dimensional features of the data. In order to minimize the information loss caused by dimensionality reduction, the processed data is only used to select samples. From this point of view, PCA can also reduce noise to a certain extent. Finally, new samples are still generated in the original dimension.
[0031] Furthermore, the two-dimensional plane is covered with hexagons to obtain the hexagonal area including: Obtain majority class sample sets and minority class sample sets on a two-dimensional plane; Based on the majority class sample set and the minority class sample set, obtain the optimal side length of the hexagon; According to the optimal side length, the two-dimensional plane is tiled to obtain a hexagonal area.
[0032] Specifically, suppose that the sample set X distributed on a two-dimensional plane is x 1 , x 2 , ..., x n}(in n is the number of all samples in the dataset) and the minority class sample set X min = { x 1 min , x 2 min , ..., x m min}(in m is the number of minority class samples in the dataset). Let the function distance ( a , b ) is two points a and b The Euclidean distance between min Refers to taking the minimum value. Therefore, the following formula defines four variables: (1) in, is the average distance from each minority class sample to other minority class samples, i is the sample number taken, j For the taken i Different sample numbers,m is the total number of minority class samples, For the minority class samples, For Different minority class samples, is the average of the minimum distances from each minority class sample to other minority class samples, is the average distance from each sample to other samples, is a sample in the sample set, For all samples Different samples, n is the total number of samples in the sample set, is the average of the minimum distances from each sample to other samples, d G is the side length of the tessellated hexagon, a is the edge length adaptation factor, for and The distance between for x i and x j The distance between them, min() is the minimum function, for the summation symbol; Hexagonal regions for tessellation G The side length d G The following requirements should be met: (2) in, d G is the side length of the tessellated hexagon, a is the edge length adaptation factor; The edge length adaptation factor meets the following requirements: , (3) Furthermore, based on the hexagonal area, a hexagonal scoring rule is constructed to obtain the selection probability of the hexagonal area including: According to the majority class sample set and the minority class sample set, the polygonal area is named in combination with the naming rules to obtain the named hexagonal area; Using the assimilation rule, the named hexagonal area is assimilated to obtain the assimilated hexagonal area; Based on the hexagonal areas and the assimilated hexagonal areas, combined with the scoring rules, the selection probability of any hexagonal area is obtained.
[0033] Specifically, after determining the side length of the hexagonal area and covering the plane with hexagons, it is necessary to formulate rules to assign categories to each area. This step paves the way for subsequent scoring, point selection, and synthesis. Based on the number of minority class samples and majority class samples in the area, the following rules are established: (1) Naming rules: G :Each regular hexagon is recorded as a region G .
[0034] NGB-G : With area G The other six adjacent regions are called regions G The neighborhood of NGB-G .
[0035] G min : The area containing only minority class samples is recorded as the minority class area G min .
[0036] G maj : The area containing only majority class samples is recorded as the majority class area G maj .
[0037] G zero : The area that does not contain any samples is recorded as an empty area G zero .
[0038] G dis : The area containing both majority class samples and minority class samples is recorded as the disputed area G dis In normal situations, the disputed domain is distributed at the boundary of two categories.
[0039] (2) Assimilation rules: For an empty area G zero ,if G zero All Neighborhoods NGB-G zero ∈ G T ,in, NGB-G zero For Region G zero Neighborhood of; G T Representative G dis Any field type other than Gzero Not G T , then assimilate, G zero ∈ G T . G min and G maj The assimilation rules are the same as above. However, for the disputed fields G dis , if all its neighbors NGB- G dis ∈ G D ,in, NGB-G dis For Region G dis Neighborhood of D = min (or D = maj ),but G dis There is noise in the G dis Finally, we get G dis ∈ G D .
[0040] like Figure 2 As shown, the minority class samples S Area G S satisfy G S ∈ G min , all its neighbors NGB - G S ∈ G zero ,in, NGB - G S For Region G S neighborhood, so after assimilation G S ∈ G zero This example also shows that the regional assimilation process is a noise reduction process. SAfter assimilation, the area is filtered, which is used to select samples. Since the assimilated area originally contains noise samples, outliers or no samples, it will not be selected for sampling.
[0041] Weight formula and sample selection; Only the unassimilated G min and G dis Regions are selected for sampling because they are the only ones that contain minority class samples. The assimilated regions only participate in the weight calculation. Then, the selection probability is obtained by scoring and weighting different regions. Let the first region selected be G one For areas that can participate in sampling G one and its neighboring areas NGB-G one ,in, NGB-G one For Region G one The neighborhood of G t ,in t =1, 2, 3, 4, 5, 6, 7. The scoring rules are as follows: (a) Total score is 7 points. G t The score is recorded as Point ( G t ); (b) If G t ∈ G min ,but Point ( G t ) = 1; (c) If G t ∈ G dis ,but Point ( G t )=0.25; (d) If G t ∈{ G zero ,G maj}, then Point( G t )=0.
[0042] Therefore, according to the scoring rules, the areaG one The total score is: , (4) If the total score is less than 1, the region will not participate in sampling and is represented as: , (5) but G one The probability formula is expressed as: , (6) in, b is the boundary weight coefficient, b <1( b >1) can strengthen (weaken) the selection frequency of boundary samples. The introduction of b is to avoid the appearance of fuzzy boundaries. Since we focus on the overall distribution of samples, not just boundary samples. Therefore, b The value is 1. After normalization, G one The probability of choosing is , (7) in, P select is the selection probability, G one is the sampling area participating in the current probability calculation, For Region G one The total score, b is the boundary weight coefficient, assuming that there are a total of H areas that can participate in sampling, Corresponding to each of the H regions, P is G one The weight of the region.
[0043] like Figure 3 As shown, since the present invention only focuses on G one ∈{ G min , G dis}and NGB - G one ∈{ G min , G dis}, so we can no longer consider G maj and G zero This can be conveniently used to implement the scoring rule, thus greatly reducing the amount of computation after assimilation. Figure 3 The left and right pictures are at different side length adaptation factors. a The sampling areas and their scores are obtained below. It is worth noting that the samples N and its area G N .sample N is a minority class sample located in the majority class area, and theoretically should be filtered as noise. At this time, a suitable side length must be selected to filter the noise. Figure 3 As shown in the figure on the right, Point ( G N )=0.5<1 means sample N and its area G N is filtered as noise and does not participate in sampling. Therefore, the coefficient a The impact on the performance of the algorithm is crucial.
[0044] Furthermore, based on the selection probability of the hexagonal area, the synthesis of new samples using the SMOTE algorithm includes: Based on the selection probability, a preset hexagonal area and an adjacent area of the preset hexagonal area are selected; Select one minority class sample from each of the preset hexagonal area and the adjacent area; Interpolate and synthesize the minority class samples to obtain new samples.
[0045] Furthermore, through the selection probability in formula (7) P select , in all G min and G dis Randomly select the first region in G one Then, we use the idea of SMOTE to synthesize samples, which requires selecting at least one other sampleable area. Therefore, we need to consider choosing G one Neighborhood NGB - G one If it exists NGB - G one ∈{ G min , G dis} and can be used for sampling, then record these NGB - G one The number of M (less than or equal to 6). Then start selecting samples and synthesizing new samples. The process is as follows Figure 4As shown. First, G one Randomly select a minority class sample in M indivual NGB - G one A minority class sample is randomly selected from the sample. Then, the original samples corresponding to these selected samples are synthesized through multiple interpolations in the original multidimensional space until the number of samples of the two classes reaches a balance. a 0 , a 1 , a 2 ,......, a M For the selected M + 1 original sample, sample A 1 Randomly generate the first sample a 0 and the second sample a 1 On the straight line between A 2 Randomly generated in A 1 and the third original sample a 2 In this way, the sample A M It is randomly generated in A M-1 and the M +1) original samples, and becomes the final new sample. r 1 , r 2 ,......, r M is a random number between 0 and 1, the synthesis formula is as follows: (8) like Figure 4 of( a )、( b )and( c ), four sample points are used in the synthesis process a 0 , a 1 , a 2 and a 3 , and obtain the final sample A 3 .like Figure 4 (d ), this process is equivalent to random sampling in the closed area surrounded by the original samples. In summary, the hexagonal scoring mechanism can select the appropriate area and give the selection probability of samples in different areas, and finally synthesize the samples of the original dimension. In addition, it can also ensure that different numbers of samples are synthesized in areas with different density of minority class samples. Because the higher the density of the same number of samples, the closer the distance between the samples, the fewer the divided domains, the lower the frequency of sample extraction, and the fewer samples are finally generated.
[0046] The method proposed in the present invention is implemented based on Python. The maximum value that meets formula (3) is selected as the side length of the generated hexagonal area. In a five-fold cross-validation method, a comparative experiment is designed on 26 public data sets as shown in Table 1, comparing HS-SMOTE with HUE, kNNMTD, SMOTE, Borderline-SMOTE, ADASYN, G-SMOTE, MWMOTE, Gaussian-SMOTE, DTO-SMOTE, and KNNOR. The non group is not processed, HUE and kNNMTD are undersampling methods, and the rest are oversampling methods.
[0047] Table 1 Dataset Number of features Total number of samples Number of minority class samples The number of majority class samples Imbalance ratio Label glass1 9 214 268 500 1.82 D1 wisconsin 9 683 76 138 1.86 D2 pima 8 768 268 500 1.87 D3 glass0 9 214 70 144 2.06 D4 yeast1 8 1484 429 1055 2.46 D5 haberman 3 306 81 225 2.78 D6 vehicle0 18 846 199 647 3.25 D7 ecoli1 7 336 77 259 3.36 D8 ecoli2 7 336 52 284 5.46 D9 glass6 9 214 29 185 6.38 D10 yeast3 8 1484 163 1321 8.1 D11 ecoli3 7 336 35 201 8.6 D12 yeast-2 vs 4 8 514 51 463 9.08 D13 yeast-0-2-5-7-9 vs 3-6-8 8 1004 99 905 9.14 D14 vowel0 13 998 90 898 9.98 D15 glass-0-1-6 vs 2 9 192 17 175 10.29 D16 glass2 9 214 17 197 11.59 D17 Cleveland - 0 vs 4 13 177 13 160 12.62 D18 glass4 9 214 13 201 15.47 D19 ecoli4 7 336 20 316 15.8 D20 Dermatology-6 34 358 20 338 16.9 D21 glass-0-1-6 vs 5 9 184 9 175 19.44 D22 glass5 9 214 9 205 22.78 D23 yeast5 8 1484 44 1440 32.73 D24 Poker-8-9 vs 6 10 1485 25 1460 58.4 D25 Poker-8-9 vs 5 10 2075 25 2050 82 D26 Examples of sampling results on the dermatology-6, yeast5, poker-8-9 vs 5 datasets are as follows Figure 5 As shown in (a)-(c), HS-SMOTE avoids generating many samples across regions and makes full use of each minority sample. Practice has proved that HS-SMOTE can also effectively solve the problem of multi-region imbalanced classification. Then, the default SVM, GBDT, and MLP of scikit-learn are used as classifiers, and F1_score, G-means, and AUC are used as evaluation indicators. Figure 6 (a)-(c) use box plots to show the classification results under different evaluation indicators. Compared with the indicator performance of other sampling algorithms, HS-SMOTE has the highest median and mean, indicating that HS-SMOTE has the best performance.
[0048] The above are only preferred specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. The unbalanced data processing method based on SMOTE algorithm and hexagonal mechanism is characterized by: include: Mapping the multi-dimensional unbalanced data to a two-dimensional plane, and using hexagons to cover the two-dimensional plane to obtain a hexagonal area; Based on the hexagonal area, construct a hexagonal scoring rule to obtain the selection probability of the hexagonal area; Based on the selection probability of the hexagonal area, the SMOTE algorithm is used to synthesize new samples.
2. The unbalanced data processing method based on the SMOTE algorithm and the hexagonal mechanism according to claim 1 is characterized in that: Mapping the multidimensional unbalanced data to the two-dimensional plane includes: mapping the multidimensional unbalanced data to the two-dimensional plane using a principal component analysis method.
3. The unbalanced data processing method based on the SMOTE algorithm and the hexagonal mechanism according to claim 2 is characterized in that: The two-dimensional plane is covered with hexagons to obtain a hexagonal area including: Obtaining a majority class sample set and a minority class sample set on the two-dimensional plane; Based on the majority class sample set and the minority class sample set, obtaining the optimal side length of the hexagon; The two-dimensional plane is covered according to the optimal side length to obtain the hexagonal area.
4. The unbalanced data processing method based on the SMOTE algorithm and the hexagonal mechanism according to claim 3 is characterized in that: Based on the majority class sample set and the minority class sample set, the method for obtaining the optimal side length of the hexagon is: in, is the average distance from each minority class sample to other minority class samples, i is the sample number taken, j For what is taken i Different sample numbers, m is the total number of minority class samples, For the minority class samples, For Different minority class samples, is the average of the minimum distances from each minority class sample to other minority class samples, is the average distance from each sample to other samples, is a sample in the sample set, For all samples Different samples, n is the total number of samples in the sample set, is the average of the minimum distances from each sample to other samples, d G is the side length of the tessellated hexagon, a is the edge length adaptation factor, for and The distance between for x i and x j The distance between them, min() is the minimum function, is the summation symbol.
5. The unbalanced data processing method based on the SMOTE algorithm and the hexagonal mechanism according to claim 3 is characterized in that: Based on the hexagonal area, constructing a hexagonal scoring rule, and obtaining the selection probability of the hexagonal area includes: According to the majority class sample set and the minority class sample set, in combination with a naming rule, the hexagonal area is named to obtain the named hexagonal area; Assimilate the named hexagonal area by using the assimilation rule to obtain the assimilated hexagonal area; Based on the hexagonal area and the assimilated hexagonal area and in combination with a scoring rule, the selection probability of any hexagonal area is obtained.
6. The unbalanced data processing method based on the SMOTE algorithm and the hexagonal mechanism according to claim 5 is characterized in that: The selection probability is: , in, P select is the selection probability, G one is the sampling area participating in the current probability calculation, For Region G one The total score, b is the boundary weight coefficient, assuming that there are a total of H areas that can participate in sampling, Corresponding to each small area in the H areas, P is G one The weight of the region.
7. The unbalanced data processing method based on the SMOTE algorithm and the hexagonal mechanism according to claim 1 is characterized in that: Based on the selection probability of the hexagonal area, the synthesis of new samples using the SMOTE algorithm includes: Based on the selection probability, selecting a preset hexagonal area and an adjacent area of the preset hexagonal area; Selecting a minority class sample in each of the preset hexagonal area and the adjacent area; Interpolation synthesis is performed on the minority class samples to obtain the new samples.
8. The unbalanced data processing method based on the SMOTE algorithm and the hexagonal mechanism according to claim 7, characterized in that: The interpolation synthesis method is: , in, A M For the minority class samples, A M-1 is the M-1th original sample, a M is the Mth original sample selected, r M is a random number between 0 and 1, and M is the number of synthesized times.
Citation Information
Patent Citations
Oversampling method of unbalanced data set
CN111259964A
Minority class sample generation method based on constructing equilateral balanced triangle through SMOTE algorithm
CN113379823A
Data processing apparatus, and data processing method
JP2021047826A
Method for classifying high-dimensional imbalanced data based on svm
WO2019041629A1
