Missing value imputation method, apparatus and computer equipment based on random forest

Through the nested random forest method based on random forest, the target sample set is divided into missing types and filled in step by step, which solves the problem of insufficient fine-grained missing data processing in the prior art, and improves the accuracy of data analysis.

CN114881158BInactive Publication Date: 2024-12-10NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210536238.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-17
Publication Date
2024-12-10
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art lacks fine-grainedness when processing missing data, fails to fully utilize the impact of each existing data on missing values, resulting in insufficient accuracy in data analysis results.

Method used

Using the missing value filling method based on random forest, the nested random forest is constructed by dividing the eigenvalue missing type of the target sample set, and the missing eigenvalue filling is performed step by step. The nested random forest is trained using the non-missed sample set to fill. Missing value.

Benefits of technology

It realizes that while considering the overall data distribution, it makes full use of the individual and local characteristics of the data to fill in refined missing values, improving the accuracy of data analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114881158B_ABST
    Figure CN114881158B_ABST
Patent Text Reader

Abstract

The present application relates to a missing value filling method, device and computer equipment based on random forests, which divides the missing sample set of the target sample set according to the missing feature value type, obtains a plurality of nested missing sample groups including a plurality of missing samples arranged according to the number of missing feature values ​​and the missing feature value type of the missing sample includes the missing feature value type of the previous missing sample, and then constructs a nested random forest according to the nested missing sample group, wherein each nested layer of the nested random forest corresponds to the missing sample, and finally uses the non-missing sample set corresponding to the current nested layer to train the random forest in the current nested layer of the nested random forest, and fills the missing feature values ​​of the missing samples corresponding to the current nested layer. The present invention constructs a hierarchically nested random forest with fine-grained attribution, while taking into account the overall distribution of known data, and fully utilizing the individual and local characteristics of the data, thereby realizing refined hierarchical missing value filling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a missing value filling method, device and computer equipment based on random forest. Background Art

[0002] With the development of data science, missing data has become a basic research issue. Whether it is industrial production or scientific research, missing data is an inevitable phenomenon. Due to the limitations of technical conditions and the cost of data collection, the loss of some data is inevitable. Even if complete data is collected, data loss will still occur during the storage and application process due to technical failures, human design problems, and operational errors. In the field of data science, the problem of missing data is a common and important issue. With the development of data science and artificial intelligence in recent years, data modeling and analysis methods dominated by machine learning are in full swing. In the process of data preprocessing, the study of missing data involves various application fields, such as medical care, financial systems, biological sciences, climate research, and social issues.

[0003] In many studies, the method for dealing with missing data is to eliminate it directly. When the amount of data is relatively sufficient, this method is simple and easy. However, from the perspective of data science, the eliminated data may contain key information. If it can be effectively filled, it will inevitably have a certain degree of positive significance on the results of data analysis. In traditional research, the filling of missing data mainly relies on existing data to simulate the overall data distribution, and then uses certain statistical indicators as filling rules. The main ideas of existing machine learning algorithms in dealing with missing data problems are also focused on simulating data distribution. For example, the current random forest data filling method, in order to avoid overfitting, does not make full use of every existing value, and is a coarse-grained filling method. Summary of the invention

[0004] Based on this, it is necessary to provide a fine-grained random forest-based missing value filling method, device and computer equipment that can fully consider the impact of each existing data on the missing value in order to address the above technical problems.

[0005] A missing value filling method based on random forest, the method comprising:

[0006] Acquire a target sample set; the target sample set includes a non-missing sample set with no missing feature values ​​and a missing sample set with missing feature values;

[0007] The missing sample set is divided according to the type of missing feature values ​​to obtain a plurality of nested missing sample groups; the nested missing sample groups include a plurality of missing samples arranged according to the number of missing feature values; the missing feature value type of the missing sample in each nested missing sample group includes the missing feature value type of the previous missing sample;

[0008] Constructing a nested random forest according to the nested missing sample group; each nested layer of the nested random forest corresponds to a missing sample;

[0009] After training the current nested layer of the nested random forest using the non-missing sample set corresponding to the current nested layer as the training set, the missing samples corresponding to the current nested layer are filled with missing feature values; the non-missing sample set corresponding to the current nested layer is the samples filled in the previous nested layer of each nested random forest and the non-missing sample set corresponding to the previous nested layer.

[0010] In one embodiment, constructing a nested random forest according to the nested missing sample group includes:

[0011] When there are more than two missing samples with the same number and type of missing eigenvalues ​​in the nested missing sample group, more than two independent random forests are constructed in the corresponding nested layer.

[0012] In one embodiment, after using the non-missing sample set corresponding to the current nested layer as a training set to train the current nested layer of the nested random forest, the missing feature values ​​of the missing sample group corresponding to the current nested layer are filled, including:

[0013] When there is only a single sample in the current nested layer, the non-missing sample set corresponding to the current nested layer is used as a training set to train the current nested layer of the nested forest, and then the missing feature value of the single sample corresponding to the current nested layer is filled.

[0014] In one embodiment, after using the non-missing sample set corresponding to the current nested layer as a training set to train the current nested layer of the nested random forest, the missing sample group corresponding to the current nested layer is filled with missing feature values, further comprising:

[0015] When there are more than two samples in the current nested layer, the non-missing sample set corresponding to the current nested layer is used as the training set to train more than two independent random forests of the current nested layer respectively, and the missing feature values ​​of more than two samples corresponding to the current nested layer are filled respectively.

[0016] In one embodiment, after using the non-missing sample set corresponding to the current nested layer as a training set to train the current nested layer of the nested random forest, and filling the missing feature values ​​of the missing samples corresponding to the current nested layer, the method further includes:

[0017] The samples corresponding to the current nested layer of each nested random forest are filled with feature values, and the samples corresponding to the current nested layer are taken together as the non-missing sample set corresponding to the next nested layer of each nested forest.

[0018] In one embodiment, the using the non-missing sample set corresponding to the current nested layer as a training set to train the current nested layer of the nested random forest includes:

[0019] Resampling the non-missing sample set corresponding to the current nested layer to obtain a plurality of non-missing sample subsets;

[0020] A number of features are randomly selected from each of the non-missing sample subsets, and the best decision features are selected from them to construct each decision tree of the random forest in the current nested layer, and each of the non-missing sample subsets is used to train each decision tree of each random forest in the current nested layer.

[0021] A missing value filling device based on random forest, the device comprising:

[0022] An acquisition module, used for acquiring a target sample set; the target sample set includes a non-missing sample set with no missing feature values ​​and a missing sample set with missing feature values;

[0023] A partitioning module is used to partition the missing sample set according to the missing feature value type to obtain a plurality of nested missing sample groups; the nested missing sample groups include a plurality of missing samples arranged according to the number of missing feature values; the missing feature value type of the missing sample in each nested missing sample group includes the missing feature value type of the previous missing sample;

[0024] A construction module, used to construct a nested random forest according to the nested missing sample group; each nested layer of the nested random forest corresponds to a missing sample;

[0025] A filling module is used to fill missing feature values ​​of missing samples corresponding to the current nested layer after training the current nested layer of the nested random forest using the non-missing sample set corresponding to the current nested layer as a training set; the non-missing sample set corresponding to the current nested layer is the samples filled in the previous nested layer of each nested random forest and the non-missing sample set corresponding to the previous nested layer.

[0026] In one embodiment, the building block is further used to:

[0027] When there are more than two missing samples with the same number and type of missing eigenvalues ​​in the nested missing sample group, more than two independent random forests are constructed in the corresponding nested layer.

[0028] In one embodiment, the filling module is further used for:

[0029] When there is only a single sample in the current nested layer, the non-missing sample set corresponding to the current nested layer is used as a training set to train the current nested layer of the nested forest, and then the missing feature value of the single sample corresponding to the current nested layer is filled;

[0030] When there are more than two samples in the current nested layer, the non-missing sample set corresponding to the current nested layer is used as the training set to train more than two independent random forests of the current nested layer respectively, and the missing feature values ​​of more than two samples corresponding to the current nested layer are filled respectively.

[0031] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0032] Acquire a target sample set; the target sample set includes a non-missing sample set with no missing feature values ​​and a missing sample set with missing feature values;

[0033] The missing sample set is divided according to the type of missing feature values ​​to obtain a plurality of nested missing sample groups; the nested missing sample groups include a plurality of missing samples arranged according to the number of missing feature values; the missing feature value type of the missing sample in each nested missing sample group includes the missing feature value type of the previous missing sample;

[0034] Constructing a nested random forest according to the nested missing sample group; each nested layer of the nested random forest corresponds to a missing sample;

[0035] After training the current nested layer of the nested random forest using the non-missing sample set corresponding to the current nested layer as the training set, the missing samples corresponding to the current nested layer are filled with missing feature values; the non-missing sample set corresponding to the current nested layer is the samples filled in the previous nested layer of each nested random forest and the non-missing sample set corresponding to the previous nested layer.

[0036] The above-mentioned missing value filling method, device and computer equipment based on random forest divide the missing sample set of the target sample set according to the missing feature value type, and obtain several nested missing sample groups containing multiple missing samples arranged according to the number of missing feature values ​​and the missing feature value type of the missing sample includes the missing feature value type of the previous missing sample, and then construct a nested random forest based on the nested missing sample group, wherein each nested layer of the nested random forest corresponds to the missing sample, and finally the random forest in the current nested layer of the nested random forest is trained using the non-missing sample set corresponding to the current nested layer, and the missing feature values ​​of the missing samples corresponding to the current nested layer are filled. The present invention divides the missing sample set of the target sample set multiple times according to the missing feature value type, and constructs several nested random forests based on the obtained nested missing sample groups, so as to fill the missing values ​​step by step, and while considering the overall distribution of the known data, fully utilizes the individual and local characteristics of the data, and realizes refined missing value filling. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 A schematic diagram of a process of a missing value filling method based on random forest in one embodiment;

[0038] Figure 2 A schematic diagram of a ladder structure of a nested missing sample group in one embodiment;

[0039] Figure 3 A schematic diagram of a special case relationship between missing data in an embodiment;

[0040] Figure 4 A schematic diagram of a nested random forest in an example database in an embodiment;

[0041] Figure 5 is a structural block diagram of a missing value filling device based on random forest in one embodiment;

[0042] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0044] In one embodiment, Figure 1 As shown, a missing value filling method based on random forest is provided, including the following steps:

[0045] Step 102: Obtain a target sample set.

[0046] The target sample set refers to a sample set with missing data and to be filled with data. The target sample set can be a radar data sample set. For example, due to interference and measurement errors in the detection equipment itself, some characteristic parameters are missing in the data collected by the radar. This method can be used to fill in the missing characteristic values. The target sample set can also be a social network user sample set. A sample includes several attributes of a user and the corresponding attribute values. The target sample set can be presented in the form of a table or matrix.

[0047] The target sample library includes a non-missing sample set with no missing feature values ​​and a missing sample set with missing feature values. A sample may contain feature attributes of multiple dimensions. If the sample has corresponding feature values ​​on all feature attributes, then the sample belongs to the non-missing sample set. Correspondingly, if the sample only has a missing feature value on one feature attribute, the sample belongs to the missing sample set.

[0048] Step 104 , dividing the missing sample set according to the missing feature value type to obtain a plurality of nested missing sample groups.

[0049] The nested missing sample group contains multiple missing samples arranged according to the number of missing feature values, and the missing feature value type of the missing sample in each nested missing sample group contains the missing feature value type of the previous missing sample.

[0050] The nested missing sample group can be regarded as a ladder structure, where different steps represent different numbers of missing eigenvalues, and the missing samples at the upper steps have smaller numbers of missing eigenvalues. At the same time, the height difference between each step may be inconsistent, that is, there may be more than two missing samples with exactly the same missing eigenvalue type in a certain step, for example, the number of missing eigenvalues ​​of the 7th and 8th data in Table 1 are both 4, and the missing eigenvalue types are the same.

[0051] Table 1 Examples of missing eigenvalues

[0052] Data 1 √ √ √ √ √ × Data 2 √ √ √ √ × √ Data 3 √ √ √ √ × × Data 4 √ √ √ × × √ Data 5 √ √ × × √ √ Data 6 √ √ √ × × × Data 7 √ √ × × × × Data 8 √ √ × × × ×

[0053] When the number of missing feature values ​​of samples is the same, but the missing types are not exactly the same, for example, the number of missing features of data 1 and data 2 in Table 1 is 1, but the missing types are different, or the number of missing features of data 3, data 4, and data 5 is 2, the missing types may overlap, but they are not exactly the same. For such samples, they are divided into different nested sample groups. Figure 2The ladder structure of one of the nested missing sample groups {data 1, data 3, data 6, data 7, data 8} obtained after the division is presented in . It can be seen that the missing type of the characteristic value of the missing samples in this nested missing sample group covers the missing type of the characteristic value of the missing samples in the previous ladder. Similarly, the nested missing sample group {data 2, data 4, data 6, data 7, data 8} can also be obtained. It can be seen that the missing samples between the nested sample groups can overlap, such as {data 1, data 3, data 6, data 7, data 8} and {data 2, data 4, data 6, data 7, data 8} both contain data 6, data 7 and data 8.

[0054] Step 106, constructing a nested random forest based on the nested missing sample group.

[0055] Each nested missing sample group has a corresponding nested random forest. Each nested layer of the nested random forest corresponds to a missing sample. The number and type of missing eigenvalues ​​of samples in the same nested layer of the same nested random forest are the same.

[0056] Step 108, after using the non-missing sample set corresponding to the current nested layer as the training set to train the current nested layer of the nested random forest, the missing feature values ​​of the missing sample group corresponding to the current nested layer are filled.

[0057] The non-missing sample set for training corresponding to the current nested layer is the sample obtained by filling in the previous nested layer and the non-missing sample set corresponding to the previous nested layer. That is to say, after each nested layer fills the missing values, the corresponding missing samples no longer have missing values, and such filled samples and the missing sample set used in the training of this nested layer are used as the training sample set of the random forest in the next nested layer, and so on. From this, we can know that the deeper the nested layer, the more complete and rich the samples of the training set, and the more effective the training results of the random forest in the deeper nested layer.

[0058] In the above-mentioned missing value filling method based on random forest, the missing sample set of the target sample set is divided according to the missing feature value type, and several nested missing sample groups are obtained, which contain multiple missing samples arranged according to the number of missing feature values ​​and the missing feature value type of the missing sample contains the missing feature value type of the previous missing sample. Then, a nested random forest is constructed according to the nested missing sample group, wherein each nested layer of the nested random forest corresponds to the missing sample, and finally, the random forest in the current nested layer of the nested random forest is trained using the non-missing sample set corresponding to the current nested layer, and the missing feature values ​​of the missing samples corresponding to the current nested layer are filled. The present invention performs multiple divisions of the missing sample set of the target sample set according to the missing feature value type, and constructs several nested random forests according to the obtained nested missing sample group, so as to fill the missing values ​​step by step, and while considering the overall distribution of the known data, fully utilizes the individual and local characteristics of the data, and realizes refined missing value filling.

[0059] A common data filling method is to use the distribution of known data to estimate the true overall distribution, and then fill it with a certain indicator or parameter of the whole, without considering the individual characteristics of the single data itself. For example, the current random forest data filling method has achieved certain results in estimating missing data. Its purpose is to avoid overfitting, rather than making full use of every existing value. In the present invention, this method is considered to be a coarse-grained filling method.

[0060] The personalized data analysis in the present invention refers to using real data as the only standard, without considering the application purpose of the data, without making any classification or prediction assumptions on the data, and most importantly, never giving up the influence of any known value on a single data, restoring the personalized characteristics of the data as much as possible, and the overall distribution index is only used as an important reference rather than a decision-making basis.

[0061] In one embodiment, constructing a nested random forest based on the nested missing sample group includes:

[0062] When there are more than two missing samples with the same number and type of missing eigenvalues ​​in the nested missing sample group, more than two independent random forests are constructed at the corresponding nested layer.

[0063] The independence of random forests means that the training and missing value filling processes of random forests of different samples in the missing sample group do not affect each other. In practical applications, in order to save time and resources, random forests of different samples in the same nested layer can be trained simultaneously, but the training processes are independent of each other; the missing value filling process does not affect each other, which means that different samples in the same nested layer are not used as reference values ​​for each other when filling missing values. For example, in Table 1, data 7 and data 8 are in the same nested missing sample group, but their training and missing value filling processes are independent of each other, and they are not used as existing data to be considered when filling missing values ​​for each other.

[0064] In one embodiment, after using the non-missing sample set corresponding to the current nested layer as the training set to train the current nested layer of the nested random forest, the missing feature values ​​of the missing sample group corresponding to the current nested layer are filled, including:

[0065] When there is only a single sample in the current nested layer, the non-missing sample set corresponding to the current nested layer is used as the training set to train the current nested layer of the nested forest, and then the missing feature value of the single sample corresponding to the current nested layer is filled.

[0066] When there are more than two samples in the current nested layer, the non-missing sample set corresponding to the current nested layer is used as the training set to train more than two independent random forests of the current nested layer, and the missing feature values ​​of more than two samples corresponding to the current nested layer are filled.

[0067] The samples corresponding to the current nested layer of each nested random forest are filled with feature values, and the samples corresponding to the current nested layer are taken together as the non-missing sample set corresponding to the next nested layer of each nested forest.

[0068] That is to say, the calculation process of several nested random forests can be carried out in parallel, and the training set - non-missing sample set used in each nested layer of each nested random forest is consistent and updated as the missing values ​​are filled. For example, the two nested missing sample groups {data 1, data 3, data 6, data 7, data 8} and {data 2, data 4, data 6, data 7, data 8} obtained by division in Table 1, the first nested layers of the corresponding two nested random forests fill in the missing feature values ​​of data 1 and data 2 respectively, and the complete data 1′ and data 2′ obtained after filling can be used together with the training set used by the first nested layer as the training set of the random forest of the next nested layer of each nested random forest.

[0069] In one embodiment, the current nested layer of the nested random forest is trained using a non-missing sample set corresponding to the current nested layer as a training set, including:

[0070] The non-missing sample set corresponding to the current nested layer is resampled to obtain several non-missing sample subsets, several features are randomly selected in each non-missing sample subset, and the best decision feature is selected from them to construct each decision tree of the random forest of the current nested layer, and each non-missing sample subset is used to train each decision tree of each random forest in the current nested layer.

[0071] The specific implementation of the present invention will be described below in conjunction with a simple sample library.

[0072] Table 1 Sample library

[0073]

[0074] For ease of understanding, a linear transformation is performed on the example samples shown in Table 1 to obtain the sample library in Table 2.

[0075] Table 2 Sample library

[0076]

[0077] Data 1, data 3, and data 5 are regarded as non-missing data. Taking the filling of data 2 as an example, in the common filling method, the filling value of feature 4 is 15.0 and the filling value of feature 6 is 2.8. From the perspective of personalized data estimation, this method is relatively rough and does not fully consider the characteristics of each existing data, nor does it make full use of the value of each existing data.

[0078] The important basis for personalized filling is 7.5 of feature 3 and 11.9 of feature 5. In the non-missing data (data 1, data 3, data 5), ​​feature 1, feature 2, and feature 5 are stable. By analyzing the numerical relationship between feature 3, feature 4, and feature 6, 17.0 and 2.2 are more suitable for filling in feature 4 and feature 6 of data 2, rather than filling in 15.0 and 2.8 in the ordinary way of calculating the average. When filling in the missing value of data 2, due to insufficient data, the value 11.9 of feature 5 of data 2 seems to have no value, but when classifying feature 5 of data 4, it determines that the filling value of feature 5 of data 4 is more inclined to 11.9 rather than 12.0.

[0079] Similarly, 7.x may be better than 8.x in filling feature 3 in data 7, and when filling feature 1 in data 6, the probability of 3.1 is greater than 2.6. In other words, data 2 can be regarded as a possible filling result of data 4, and data 4 is a possible filling result of data 7, and they are all specific examples of data 6. Figure 2 As shown in Figure 2, there are special relationships between these missing data after they are divided according to the number of missing eigenvalues.

[0080] As can be seen from Table 2, data 6 is a data with completely missing feature values. It is reasonable to fill data 6 according to the overall distribution of each data feature. The filling value of data 6 obtained by the ordinary average method may be 3.0. Such filling is generally considered reasonable because it is within the allowable error range. However, this is exactly the focus of personalized filling. Without considering the semantics of data features, judging whether the error is reasonable only from the value itself is actually a judgment with a large error. This method emphasizes that the existence of each real data is of great significance. When the real data record is generated, it reflects the state of the data subject at that time. It is not simply determined by the distribution of the entire data body, but depends more on the data subject itself. Therefore, the diversity of the overall data and the characteristics of each data itself should be considered comprehensively. The present invention believes that when data is generated, it cannot be divided into each data feature, but is a manifestation of the state of the data generation subject. As long as the data is recorded in a certain form, it must be missing, and there must be something that has not been considered or recorded. This is also the reason why data modeling cannot solve the problem as accurately as mathematical modeling. Therefore, in the view of the present invention, each real value is a reflection of the data subject when generating data, and should be reasonably considered. This is exactly the concept of filling missing data proposed by this method, so that the filled data can be truly close to the original data.

[0081] A random forest can be viewed as a combination of multiple decision trees. The nested random forest proposed in this method regards a forest as consisting of several small nested random forests according to the type of missing feature values. The sub-forests participate in the training process of the large forest and the process of filling missing values. Combined with the actual situation of the target database, the nested random forest with fine-grained attribution is constructed by nesting at each level.

[0082] This method regards data 7 in Table 2 as a special case of data 6, that is, data 6 should be a special case model nested under the data filling model of data 7. The filling model of data 7 can be used as a reference for the filling process of data 6, so this method regards the filling model of data 7 as the nested model of data 6, that is, the entire random forest of data 7 is regarded as the nested random forest of data 6.

[0083] Therefore, we can construct a nested random forest for the missing data set {data 2, data 4, data 7, data 6} in Table 2 according to the number of missing feature values. Since the data presented in Table 2 is relatively simple, we can easily get the corresponding random nested forest, such as Figure 3 shown.

[0084] Each existing data is a specific data point, while each missing data is a range according to its own type, and these ranges are strictly nested. The entire model can make full use of every objective valid value to help with the integrity of data induction. In theory, first train the random forest of data 2, and then integrate the model of data 2 into the voting process of the data 4 model, and so on. In practice, due to the low coupling relationship between the tree structures of the forest models, some trainings can be carried out in parallel, which can improve the actual parallel degree of the computing program and save a large amount of training time.

[0085] The nested random forest classifies the missing data into different types and makes full use of each non-missing value according to the specific situation. While considering the overall distribution of the known data, it makes full use of the individual and local characteristics of the data, realizes refined missing value filling, and obtains better filling results than the existing methods.

[0086] In one embodiment, for an m×n data matrix, after linear translation, there is a matrix of size m′×n′ containing missing values, where n'≤n and m'<m. (1) When m' = m, it means that all data have missing features and there is no complete data that can be used as a reference, and the working error of the model is relatively large. (2) In theory, if the data with the same missing features are divided into one filling type, there will be at most 2n' types. When n′→∞, the NP problem appears. However, in an actual data set, to reach this non-computability, there also needs to be a sufficient number of missing data entries, that is, m'>2n'. These two factors must be satisfied simultaneously for the above-mentioned calculation amount problem to occur. Although this is a small probability event, the solution should be effective and feasible. Even in this special case, due to the parallel feasibility of the sub-forests discussed above, parallel acceleration can be achieved by expanding the computing resources. In fact, the actual missing value data features usually overlap, which means that the actual number of missing data types k<<2n'. In practical applications, if the time complexity of the random forest model is O(mn logm), then the time complexity of the non-parallel nested random forest is k×0(mn log m )), where k is a constant.

[0087] In order to verify the applicability of this method, we selected a machine learning public dataset from the University of California (Irvine) and tested it on real datasets from different industries such as medical, finance and transportation. The Haberman's Survival (HM) dataset contains 4-dimensional data of 306 lung cancer patients. The Spambase Data Set (SB) dataset contains 57-dimensional data of 268,079 spam emails. This method readjusted the missing data ratio of the training data of the above datasets to better compare the methods. The datasets were set to have missing values ​​accounting for 10%, 30%, 50%, 70% and 90%, and the row and column positions of the missing data values ​​were randomly selected each time until the total number of missing values ​​was met.

[0088] In order to verify the stability of this method, the mean absolute error (MAE) and mean square error (MSE) were selected to simultaneously judge the data filling error, and the error between the data matrix filled by the algorithm and the real complete data was compared, as shown in formulas (1) and (2).

[0089]

[0090]

[0091] Among them, filling-value is the filling value, and true-value is the true value. Because the evaluation method focuses on the comparison of filling data errors, MAE focuses on the average filling effect, while MSE focuses more on the consideration of individual outliers. If the MAE value is the same but the MSE value is larger, it means that the filling method is relatively unstable.

[0092] Five existing missing value filling methods are used as baseline methods to compare with this method. The baseline algorithms and this method are presented as follows:

[0093] (1) Common statistical algorithms: mean filling (Mean), random filling (Random), K nearest neighbor filling (KNN), expectation maximization (EM)

[0094] (2) Generative Adversarial Neural Network (GAN) series of algorithms: GAIN

[0095] (3) This method is the nested random forest method (NRF)

[0096] The following tables present the average error results of 500 random value extraction experiments, where Table 3 and Table 4 present the MAE error and MSE error values ​​of the HM dataset, respectively, and Table 5 and Table 6 present the MAE error and MSE error values ​​of the SB dataset, respectively. Missing-Num in the table indicates the number of missing feature values.

[0097] Table 3 MAE error values ​​of HM dataset

[0098]

[0099] Table 4 MSE error values ​​of HM dataset

[0100]

[0101] Table 5 MAE error values ​​of SB dataset

[0102]

[0103] Table 6 MSE error values ​​of SB dataset

[0104]

[0105] It can be seen from Table 5 and Table 6 that in the SB data set, the amount of data has increased significantly, and the effects of the GAIN and NRF methods have obvious advantages, among which the NRF method of the present invention has the best effect. From Table 5, GAIN and NRF each have their own advantages, and from Table 6, it can be seen that NRF is more stable than the GAIN method and has smaller error fluctuations.

[0106] The average values ​​of the experimental data errors of the above data sets are taken and summarized and ranked, as shown in Table 7. It can be seen that the NRF method has obvious advantages in comprehensive performance.

[0107] Table 7 Ranking of the mean total error of each data set

[0108]

[0109] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0110] In one embodiment, Figure 4 As shown, a missing value filling device based on random forest is provided, comprising: an acquisition module, a division module, a construction module and a filling module, wherein:

[0111] The acquisition module is used to obtain the target sample set.

[0112] The target sample set includes a non-missing sample set with no missing feature values ​​and a missing sample set with missing feature values.

[0113] A construction module is used to divide the missing sample set according to the missing feature value type to obtain several nested missing sample groups.

[0114] The nested missing sample group contains multiple missing samples arranged according to the number of missing feature values, and the missing feature value type of the missing sample in each nested missing sample group contains the missing feature value type of the previous missing sample;

[0115] Partitioning module for constructing nested random forests based on nested missing sample groups.

[0116] Each nested layer of the nested random forest corresponds to missing samples.

[0117] The filling module is used to fill the missing feature values ​​of the missing samples corresponding to the current nested layer after training the current nested layer of the nested random forest using the non-missing sample set corresponding to the current nested layer as the training set.

[0118] The non-missing sample set corresponding to the current nested layer is the samples filled in the previous nested layer of each nested random forest and the non-missing sample set corresponding to the previous nested layer.

[0119] In one embodiment, the construction module is further used to construct corresponding more than two independent random forests at the corresponding nested layer when there are more than two missing samples with the same number and type of missing feature values ​​in the nested missing sample group.

[0120] In one embodiment, the filling module is also used to fill the missing feature values ​​of the single sample corresponding to the current nested layer after using the non-missing sample set corresponding to the current nested layer as the training set to train the current nested layer of the nested forest when there is only a single sample in the current nested layer.

[0121] In one embodiment, the filling module is further configured to:

[0122] When there is only a single sample in the current nested layer, the non-missing sample set corresponding to the current nested layer is used as the training set to train the current nested layer of the nested forest, and then the missing feature value of the single sample corresponding to the current nested layer is filled;

[0123] When there are more than two samples in the current nested layer, the non-missing sample set corresponding to the current nested layer is used as the training set to train more than two independent random forests of the current nested layer, and the missing feature values ​​of more than two samples corresponding to the current nested layer are filled.

[0124] For the specific definition of the missing value filling device based on random forest, please refer to the definition of the missing value filling method based on random forest above, which will not be repeated here. Each module in the above-mentioned missing value filling device based on random forest can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0125] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store target data to be filled. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a missing value filling method based on random forest is implemented.

[0126] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0127] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0128] Obtain a target sample set; the target sample set includes a non-missing sample set with no missing feature values ​​and a missing sample set with missing feature values;

[0129] The missing sample set is divided according to the missing feature value type to obtain a number of nested missing sample groups; the nested missing sample group contains a number of missing samples arranged according to the number of missing feature values; the missing feature value type of the missing sample in each nested missing sample group contains the missing feature value type of the previous missing sample;

[0130] Construct a nested random forest based on the nested missing sample group; each nested layer of the nested random forest corresponds to the missing sample;

[0131] After training the current nested layer of the nested random forest using the non-missing sample set corresponding to the current nested layer as the training set, the missing samples corresponding to the current nested layer are filled with missing feature values; the non-missing sample set corresponding to the current nested layer is the sample filled in the previous nested layer of each nested random forest and the non-missing sample set corresponding to the previous nested layer.

[0132] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0133] Obtain a target sample set; the target sample set includes a non-missing sample set with no missing feature values ​​and a missing sample set with missing feature values;

[0134] The missing sample set is divided according to the missing feature value type to obtain a number of nested missing sample groups; the nested missing sample group contains a number of missing samples arranged according to the number of missing feature values; the missing feature value type of the missing sample in each nested missing sample group contains the missing feature value type of the previous missing sample;

[0135] Construct a nested random forest based on the nested missing sample group; each nested layer of the nested random forest corresponds to the missing sample;

[0136] After training the current nested layer of the nested random forest using the non-missing sample set corresponding to the current nested layer as the training set, the missing samples corresponding to the current nested layer are filled with missing feature values; the non-missing sample set corresponding to the current nested layer is the sample filled in the previous nested layer of each nested random forest and the non-missing sample set corresponding to the previous nested layer.

[0137] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0138] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0139] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A missing value filling method based on random forest, characterized in that: The method comprises: Acquire a target sample set; the target sample set includes a non-missing sample set with no missing feature values ​​and a missing sample set with missing feature values; the target sample set includes a radar data sample set, and the missing feature values ​​include the missing of certain feature parameters in the data collected by the radar; The missing sample set is divided according to the type of missing feature values ​​to obtain a plurality of nested missing sample groups; the nested missing sample groups include a plurality of missing samples arranged according to the number of missing feature values; the missing feature value type of the missing sample in each nested missing sample group includes the missing feature value type of the previous missing sample; Constructing a nested random forest according to the nested missing sample group; each nested layer of the nested random forest corresponds to a missing sample; After training the current nested layer of the nested random forest using the non-missing sample set corresponding to the current nested layer as the training set, the missing samples corresponding to the current nested layer are filled with missing feature values; the non-missing sample set corresponding to the current nested layer is the sample filled in the previous nested layer of each nested random forest and the non-missing sample set corresponding to the previous nested layer; Wherein, constructing a nested random forest according to the nested missing sample group includes: When there are more than two missing samples with the same number and type of missing feature values ​​in the nested missing sample group, constructing more than two independent random forests at the corresponding nested layer; The method of using the non-missing sample set corresponding to the current nested layer as a training set to train the current nested layer of the nested random forest includes: Resampling the non-missing sample set corresponding to the current nested layer to obtain a plurality of non-missing sample subsets; A number of features are randomly selected from each of the non-missing sample subsets, and the best decision features are selected from them to construct each decision tree of the random forest in the current nested layer, and each of the non-missing sample subsets is used to train each decision tree of each random forest in the current nested layer.

2. The method according to claim 1, characterized in that After the non-missing sample set corresponding to the current nested layer is used as a training set to train the current nested layer of the nested random forest, the missing feature values ​​of the missing sample group corresponding to the current nested layer are filled, including: When there is only a single sample in the current nested layer, the non-missing sample set corresponding to the current nested layer is used as a training set to train the current nested layer of the nested forest, and then the missing feature value of the single sample corresponding to the current nested layer is filled.

3. The method according to claim 1, characterized in that After training the current nested layer of the nested random forest using the non-missing sample set corresponding to the current nested layer as a training set, filling the missing feature values ​​of the missing sample group corresponding to the current nested layer also includes: When there are more than two samples in the current nested layer, the non-missing sample set corresponding to the current nested layer is used as the training set to train more than two independent random forests of the current nested layer respectively, and the missing feature values ​​of more than two samples corresponding to the current nested layer are filled respectively.

4. The method according to claim 1, characterized in that: After using the non-missing sample set corresponding to the current nested layer as a training set to train the current nested layer of the nested random forest, and filling the missing feature values ​​of the missing samples corresponding to the current nested layer, the method further includes: The samples corresponding to the current nested layer of each nested random forest are filled with feature values, and the samples corresponding to the current nested layer are taken together as the non-missing sample set corresponding to the next nested layer of each nested forest.

5. A missing value filling device based on random forest, characterized in that: The device comprises: An acquisition module is used to acquire a target sample set; the target sample set includes a non-missing sample set with no missing feature values ​​and a missing sample set with missing feature values; the target sample set includes a radar data sample set, and the missing feature values ​​include the missing of certain feature parameters in the data collected by the radar; A partitioning module is used to partition the missing sample set according to the missing feature value type to obtain a plurality of nested missing sample groups; the nested missing sample groups include a plurality of missing samples arranged according to the number of missing feature values; the missing feature value type of the missing sample in each nested missing sample group includes the missing feature value type of the previous missing sample; A construction module, used to construct a nested random forest according to the nested missing sample group; each nested layer of the nested random forest corresponds to a missing sample; A filling module is used to fill missing feature values ​​of missing samples corresponding to the current nested layer after training the current nested layer of the nested random forest using the non-missing sample set corresponding to the current nested layer as a training set; the non-missing sample set corresponding to the current nested layer is the sample filled in the previous nested layer of each nested random forest and the non-missing sample set corresponding to the previous nested layer; Wherein, constructing a nested random forest according to the nested missing sample group includes: When there are more than two missing samples with the same number and type of missing feature values ​​in the nested missing sample group, constructing more than two independent random forests at the corresponding nested layer; The method of using the non-missing sample set corresponding to the current nested layer as a training set to train the current nested layer of the nested random forest includes: Resampling the non-missing sample set corresponding to the current nested layer to obtain a plurality of non-missing sample subsets; A number of features are randomly selected from each of the non-missing sample subsets, and the best decision features are selected from them to construct each decision tree of the random forest in the current nested layer, and each of the non-missing sample subsets is used to train each decision tree of each random forest in the current nested layer.

6. The device according to claim 5, characterized in that The filling module is also used for: When there is only a single sample in the current nested layer, the non-missing sample set corresponding to the current nested layer is used as a training set to train the current nested layer of the nested forest, and then the missing feature value of the single sample corresponding to the current nested layer is filled; When there are more than two samples in the current nested layer, the non-missing sample set corresponding to the current nested layer is used as the training set to train more than two independent random forests of the current nested layer respectively, and the missing feature values ​​of more than two samples corresponding to the current nested layer are filled respectively.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.