A method, system, device, and medium for fitting and predicting machine learning models.
By constructing multiple target training sets and training validation sets, and using multiple machine learning sub-models to train and determine fitting weights, the problem of fitting prediction discrepancies caused by training differences in machine learning sub-models is solved, thereby improving the accuracy and reliability of prediction results.
Patent Information
- Application Number
- CN202410956549.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-07-17
AI Technical Summary
Existing technologies do not consider the differences in fitting predictions caused by training differences among different machine learning sub-models, resulting in low accuracy of binary fitting prediction results.
Multiple target training sets and training validation sets are constructed. Multiple machine learning sub-models are trained to determine the fitting weights of each sub-model, and weighted fitting predictions are performed based on the prediction set.
It improves the accuracy and reliability of the fitted prediction results, enhances the generalization ability of the model, and reduces the randomness of the results.
Smart Images

Figure CN119046676B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machine learning technology, and in particular to a method, system, device and medium for fitting and predicting machine learning models. Background Technology
[0002] Machine learning algorithms are increasingly being applied across various industries. Driven by data, they can perform various data fitting and prediction tasks. Obtaining reasonable machine learning fitting and prediction accuracy, and acquiring reliable machine learning fitting and prediction results, is of great significance for evaluating the effectiveness of machine learning models and their practical applications. The general training data organization structure for machine learning is as follows: ① The original training set is randomly divided into n subsets using cross-validation. n-1 subsets are used as the training set, and the remaining subset is used as the training validation set. This process is repeated to form n sets of training-training validation sets; ② A specific machine learning algorithm is selected, and through n training-validation iterations, n machine learning sub-models and their corresponding validation accuracies are obtained. The average validation accuracies of the n machine learning sub-models are used to evaluate the overall performance of the machine learning model; ③ The machine learning algorithm is selected again and retrained using the original training set to obtain the final machine learning model; ④ Using the final machine learning model and the prediction set, a fitting and prediction task is performed to obtain a single fitting and prediction result. Machine learning binary fitting prediction refers to a prediction where the dependent variable in the original training set is binary (0 for non-existence, 1 for existence, such as mineral deposits, disasters, erosion gullies, etc.). For this task, the original training set consists of positive samples (locations where mineral deposits, disasters, or erosion gullies are known, i.e., the dependent variable is 1) and negative samples (locations where mineral deposits, disasters, or erosion gullies are known, i.e., the dependent variable is 0). In step ①, the cross-validation method only considers the randomness of the spatial location of samples in the training and validation sets, without considering the uniformity of the positive and negative attributes (0, 1) of the samples. This affects the performance of the trained machine learning sub-model and the reasonableness of the validation accuracy. Furthermore, the machine learning model trained using the entire original training set in step ③ and the prediction results obtained by fitting the prediction set in step ④ have a greater risk of randomness or overfitting, affecting the reliability of the prediction results. Therefore, it is necessary to improve the organization of training data and fitting results in the general binary fitting prediction process of machine learning, so as to obtain a more reasonable model validation accuracy and a more generalized machine learning model with reduced randomness, and obtain more reliable final fitting prediction results.
[0003] Although the accuracy of the sub-models of the machine learning model has been verified in the existing technology, only the machine learning model with the final accuracy obtained by training is used when fitting and predicting the prediction set. The difference in fitting and prediction caused by the training difference of different machine learning sub-models is not taken into account, so the accuracy of the result obtained by fitting and predicting the prediction set using only one machine learning model is low. Summary of the Invention
[0004] To overcome the problem that existing technologies do not take into account the differences in fitting and prediction caused by the training differences of different machine learning sub-models, resulting in low accuracy of the results obtained by fitting and predicting the prediction set using only one machine learning model, this application provides a method, system, device and medium for fitting and predicting machine learning models.
[0005] Firstly, in order to solve the aforementioned technical problems, this application provides a method for fitting and predicting machine learning models, including:
[0006] Obtain the original training set;
[0007] Based on the original training set, construct multiple target training sets and a corresponding training and validation set for each target training set;
[0008] Multiple machine learning models are trained separately using multiple target training sets to obtain multiple machine learning sub-models.
[0009] Based on multiple training and validation sets, determine the fitting weights for each machine learning sub-model;
[0010] Obtain the prediction set, and based on the prediction set, multiple machine learning sub-models, and multiple fitting weights, determine the target fitting prediction result.
[0011] Secondly, this application also provides a fitting and prediction system for a machine learning model, comprising:
[0012] The acquisition module is used to acquire the original training set;
[0013] The building module is used to construct multiple target training sets and a corresponding training and validation set for each target training set based on the original training set.
[0014] The training module is used to train the machine learning model to be trained using multiple target training sets to obtain multiple machine learning sub-models.
[0015] The weight determination module is used to determine the fitting weights for each machine learning sub-model based on multiple training and validation sets.
[0016] The fitting result determination module is used to obtain the prediction set and, based on the prediction set, multiple machine learning sub-models, and multiple fitting weights, determine the target fitting prediction result.
[0017] Thirdly, this application also provides a computing device, including a memory, a processor, and a program stored in the memory and running on the processor, wherein the processor executes the program to implement the steps of the fitting and prediction method of a machine learning model as described above.
[0018] Fourthly, this application also provides a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to perform steps of a fitting and prediction method for a machine learning model.
[0019] The beneficial effects of this application are as follows: By constructing multiple target training sets and corresponding training and validation sets for each target training set, and using these multiple target training sets to train the machine learning model to be trained, multiple machine learning sub-models are obtained. Then, based on the multiple training and validation sets, the fitting weights for each machine learning sub-model are determined. Finally, based on the prediction set, the multiple machine learning sub-models, and the multiple fitting weights, the target fitting prediction result is determined. In this way, the fitting prediction results of the prediction set across different machine learning sub-models are weighted, taking into account the fitting prediction differences caused by the training differences of each machine learning sub-model, thereby improving the accuracy of the final weighted target fitting prediction result. Attached Figure Description
[0020] Figure 1 This is a flowchart illustrating a machine learning model fitting and prediction method according to this application.
[0021] Figure 2 This is a schematic diagram illustrating the construction process of the target training set and training validation set for this application;
[0022] Figure 3 This is another flowchart illustrating a fitting and prediction method for a machine learning model according to this application;
[0023] Figure 4 This is a schematic diagram illustrating the performance evaluation process of each machine learning sub-model in this application;
[0024] Figure 5 Here is a map showing the distribution of erosion gullies and random circles in the example area;
[0025] Figure 6 This is an example of the elevation difference distribution in the area.
[0026] Figure 7 Example area slope factor distribution;
[0027] Figure 8 The slope length factor distribution is shown in the example area;
[0028] Figure 9 This is an example of the catchment density distribution in the region.
[0029] Figure 10 This is an example of the distribution of distances from the catchment line in the region;
[0030] Figure 11 A schematic diagram of the target fitting prediction results for the risk of erosion gullies occurring in the example area;
[0031] Figure 12 This is a zoning map showing the risk distribution of gully erosion in the example area;
[0032] Figure 13 The mean distribution curve of the predicted results is fitted to the final target within the erosion gully;
[0033] Figure 14 The mean distribution curve of the prediction results fitted to the final target within the random circle;
[0034] Figure 15 This is a schematic diagram of the structure of a machine learning model fitting and prediction system according to this application. Detailed Implementation
[0035] The following embodiments are further explanations and supplements to this application and do not constitute any limitation on this application.
[0036] The following describes, with reference to the accompanying drawings, a method, system, device, and medium for fitting and predicting a machine learning model according to an embodiment of this application.
[0037] This application discloses a method for fitting and predicting a machine learning model. This method is applied to a terminal device. The solution described in this application uses the terminal device as the execution subject. The terminal device is used to execute the steps of a method for fitting and predicting a machine learning model.
[0038] like Figure 1 As shown, this application provides a method for fitting and predicting machine learning models, including:
[0039] S11, Obtain the original training set;
[0040] S12, based on the original training set, construct multiple target training sets and training and validation sets corresponding to each target training set;
[0041] S13, using multiple target training sets to train the machine learning model to be trained, resulting in multiple machine learning sub-models;
[0042] S14, based on multiple training and validation sets, determine the fitting weights for each machine learning sub-model;
[0043] S15: Obtain the prediction set, and based on the prediction set, multiple machine learning sub-models, and multiple fitting weights, determine the target fitting prediction result.
[0044] This embodiment presents a method for fitting and predicting a machine learning model. It constructs multiple target training sets and corresponding training and validation sets for each target training set, and trains the machine learning model to be trained using these sets, resulting in multiple machine learning sub-models. Based on these training and validation sets, a fitting weight is determined for each sub-model. Then, based on the prediction set, the multiple sub-models, and the fitting weights, a target fitting prediction result is determined. This weighting of the fitting prediction results across different sub-models takes into account the differences in fitting predictions caused by the training differences of each sub-model, thereby improving the accuracy of the final weighted target fitting prediction result. Furthermore, weighting the fitting prediction results of multiple sub-models enhances the generalization ability of the machine learning model to be trained, reduces the randomness of the results, and improves the reliability of the fitting prediction result.
[0045] The prediction model used in this application for fitting and predicting the prediction set is a model composed of multiple machine learning sub-models corresponding to the machine learning model to be trained.
[0046] Optionally, the machine learning model to be trained can be a random forest algorithm model, a neural network model, or a support vector machine, etc.
[0047] Optionally, based on the original training set, multiple target training sets and a corresponding training and validation set for each target training set are constructed, including:
[0048] Divide the positive sample set in the original training set into n positive sample subsets, and divide the negative sample set in the original training set into n negative sample subsets;
[0049] Based on n positive sample subsets and n negative sample subsets, construct n 2 Each target training set and the corresponding training and validation set for each target training set;
[0050] The target training set includes n-1 positive sample subsets and n-1 negative sample subsets, while the training validation set includes 1 positive sample subset and 1 negative sample subset.
[0051] In this embodiment, the difference in the number of positive samples between any two positive sample subsets in the n positive sample subsets is less than or equal to 1, and the difference in the number of negative samples between any two negative sample subsets in the n negative sample subsets is less than or equal to 1, thus achieving a uniform division of positive and negative samples in the original training set. Simultaneously, by uniformly dividing the positive and negative samples in the original training set, the resulting multiple target training sets and multiple training validation sets possess both randomness in sample spatial location and uniformity in the positive and negative attributes of the samples. Using each target training set and its corresponding training validation set to train the machine learning model improves the efficiency and the reasonableness of the validation accuracy of the resulting multiple machine learning sub-models.
[0052] In some embodiments, n is constructed based on n positive sample subsets and n negative sample subsets. 2 The specific implementation involves n target training sets and corresponding training and validation sets for each target training set. Specifically, n-1 subsets are selected from n positive sample subsets, and n-1 subsets are selected from n negative sample subsets to form one target training set. The remaining positive and negative sample subsets form one training and validation set for that target training set. This process is repeated until n sets are constructed using permutations and combinations. 2 Next, forming n 2 This involves combining target training sets and training / validation sets. This approach fully utilizes all sample information during training of the machine learning model, while ensuring the randomness of the spatial location of samples in each target training set and the uniformity of the positive and negative attributes of the samples.
[0053] In other embodiments, based on the original training set, multiple target training sets and corresponding training and validation sets are constructed. Pre-defined construction rules can be compiled into a computer program within the system. This computer program selects the positive and negative sample sets from the original training set and sets the number of combinations of target training sets and corresponding training and validation sets, resulting in a predetermined number of target training sets and corresponding training and validation sets. The corresponding construction process is as follows: Figure 2 As shown:
[0054] S21. Locate the storage locations of the positive sample set (.xlsx) and negative sample set (.xlsx) files in the original training set, and select both files. In each file (positive sample set.xlsx, negative sample set.xlsx), one line represents one sample. The first column represents the dependent variable, and the columns starting from the second column represent the independent variables. Examples of positive samples in positive sample set.xlsx are shown in Table 1, and examples of negative samples in negative sample set.xlsx are shown in Table 2.
[0055] Table 1
[0056] Dependent variable Independent variable 1 Independent variable 2 Independent variable 3 Independent variable 4 Independent variable 5 1 15.53960037 0.470144987 66.2233963 4.541600227 47.07550049 1 24.25460052 0.465092003 3.49657011 4.481999874 86.84590149 1 22.19059944 0.313850999 13.70349979 4.295949936 131.5740051 1 25.2364006 0.64349997 6.107590199 4.414430141 107.2369995 1 24.81979942 0.571857989 5.559510231 4.416269779 53.94829941 1 24.47489929 0.351182014 4.681280136 4.44547987 54.6916008 1 21.7935009 0.258892 4.714119911 4.274099827 24.40970039 1 33.84460068 0.640610993 5.249149799 4.223239899 101.3960037 1 30 0.718163013 2.155699968 4.168570042 84.60379791 1 28.69319916 0.330980003 12.45460033 3.972259998 54.63700104
[0057] Table 2
[0058] Dependent variable Independent variable 1 Independent variable 2 Independent variable 3 Independent variable 4 Independent variable 5 0 27.53440094 0.512803018 4.010310173 3.843610048 133.9720001 0 38.08620071 0.358846009 13.82479954 3.783220053 31.21430016 0 28.10160065 0.332091004 3.755609989 3.79531002 54.34899902 0 28.99819946 0.737709999 9.468190193 4.042840004 31.36330032 0 27.89889908 0.80170399 1.766160011 3.917010069 99.90380096 0 29.25600052 0.775602996 12.40429974 3.863100052 19.58749962 0 29.92329979 0.725737989 8.69287014 3.838419914 94.81600189 0 29.89520073 0.809448004 3.71329999 3.801949978 63.26169968 0 28.97669983 0.522445977 4.028409958 3.844969988 26.43549919 0 27.34280014 0.571399987 4.784480095 3.762700081 84.4763031
[0059] S22, Set the number of combinations of the target training set and the corresponding training and validation sets to be output in the system;
[0060] S23, Enter the output location of the combined set of the target training set and the corresponding training and validation set in the system.xlsx file;
[0061] S24, click Start Building to get the expected target training set and the corresponding training and validation set.xlsx.
[0062] Optionally, based on multiple training and validation sets, the fitting weights for each machine learning sub-model are determined, including:
[0063] Multiple independent variables from each training and validation set are input into the corresponding machine learning sub-model to obtain multiple first-fit prediction results equal to the number of independent variables.
[0064] Based on the training and validation sets corresponding to multiple machine learning sub-models and multiple first-fit prediction results, the fitting weights of each machine learning sub-model are obtained.
[0065] In this embodiment, the independent variables in the training and validation sets corresponding to the machine learning sub-models are used for fitting and prediction to obtain multiple first fitting prediction results. Based on each first fitting prediction result and the corresponding training and validation sets, the fitting prediction performance and fitting differences of each machine learning sub-model can be understood. This allows for the determination of the proportion of true accuracy of the fitting prediction results in each specific machine learning sub-model, i.e., the fitting weight. This facilitates subsequent prediction of the prediction set using all machine learning sub-models and combines the fitting weights of each machine learning sub-model, taking into account the fitting prediction differences caused by the training differences of each machine learning sub-model, thereby improving the accuracy of the obtained target fitting prediction results.
[0066] Optionally, based on the training and validation sets corresponding to multiple machine learning sub-models and multiple first-fit prediction results, the fitting weights of each machine learning sub-model are obtained, including:
[0067] Based on multiple dependent variables and multiple first-fit prediction results in the training and validation sets corresponding to each machine learning sub-model, the performance parameters of the corresponding machine learning sub-model are determined.
[0068] Based on the performance parameters of each of the multiple machine learning sub-models, the fitting weights of each machine learning sub-model are determined.
[0069] In this embodiment, the performance parameters obtained from multiple dependent variables and multiple first fitting prediction results in the training and validation sets corresponding to each machine learning sub-model can reflect the learning ability, prediction accuracy, and other performance of the corresponding machine learning sub-model. Based on the performance parameters of each of the multiple machine learning sub-models, the fitting weight of each machine learning sub-model is determined, which can take into account the prediction differences of each machine learning sub-model, thereby improving the accuracy of the target fitting prediction results of the subsequent prediction set.
[0070] Optionally, based on the performance parameters of each of the multiple machine learning sub-models, the fitting weights of each machine learning sub-model are determined, including:
[0071] For each machine learning sub-model, the difference between the performance parameter and 1 is calculated to obtain the performance difference value; where the performance parameter is the mean absolute error, mean square error, or root mean square error.
[0072] Based on the performance differences of multiple machine learning sub-models, the sum of error parameters is obtained;
[0073] Based on the sum of multiple performance differences and error parameters, the fitting weights of each of the multiple machine learning sub-models are obtained.
[0074] In this embodiment, based on the performance difference of each machine learning sub-model and the sum of error parameters corresponding to multiple machine learning sub-models, it is possible to understand the weight of the accuracy (model fitting precision) of the fitting prediction result of each machine learning sub-model in the accuracy (model fitting precision) of all fitting prediction results. This allows us to obtain the fitting weight of each machine learning sub-model, which facilitates subsequent prediction of the prediction set based on each machine learning sub-model and weights the prediction results based on the corresponding fitting weights, thereby improving the accuracy of the target fitting prediction result.
[0075] Optionally, based on the prediction set, multiple machine learning sub-models, and multiple fitting weights, the target fitting prediction result is determined, including:
[0076] By inputting multiple independent variables from the prediction set into each machine learning sub-model, multiple second-fit prediction results are obtained, which are equal in number to the number of independent variables.
[0077] Based on the multiple second fitting prediction results and fitting weights corresponding to multiple machine learning sub-models, the target fitting prediction result is obtained.
[0078] In this embodiment, each machine learning sub-model predicts multiple independent variables of the prediction set separately, resulting in multiple second fitting prediction results equal in number to the multiple independent variables. The multiple second fitting prediction results are then weighted based on the fitting weight of each machine learning sub-model, thereby improving the accuracy of the target fitting prediction result.
[0079] Figure 3 This is another flowchart illustrating a machine learning model fitting and prediction method according to this application, as shown below. Figure 3 As shown, it includes:
[0080] S31, n is calculated respectively 2 The performance parameters of the i-th machine learning sub-model in the n machine learning sub-models are: mean absolute error (MAE_i), mean squared error (MSE_i), or root mean square error (RMSE_i); where i is greater than or equal to 1 and less than or equal to n. 2 Any value in;
[0081] S32, n is calculated respectively 2 The performance difference is the difference between the performance parameter of the i-th machine learning sub-model and 1, which is: 1-MAE_i, or 1-MSE_i, or 1-RMSE_i.
[0082] S33, n 2 The performance differences of the individual machine learning sub-models are summed to obtain the total error parameter, calculated using the following formula:
[0083] or,
[0084] or,
[0085]
[0086] Where sum(1-MAE) is the sum of error parameters of the performance difference 1-MAE of all machine learning sub-models, sum(1-MSE) is the sum of error parameters of the performance difference 1-MSE of all machine learning sub-models, sum(1-RMSE) is the sum of error parameters of the performance difference 1-RMSE of all machine learning sub-models, and n is the positive sample set (D) of the original training set (D). + ) divided into a positive sample subset (D) + 1. D + 2、…、D + n-1 D + n The number of negative samples (D-) that will be divided into negative sample subsets (D-) from the original training set (D) is denoted by n. - 1. D - 2、…、D - n-1 D - n The quantity of );
[0087] S34, based on the sum of multiple performance differences and error parameters, obtains the fitting weights for each of the multiple machine learning sub-models. The fitting weight K of the i-th machine learning sub-model... i The calculation formula is as follows:
[0088] or,
[0089] or,
[0090]
[0091] Among them, K i Represents the fitting weights of the i-th machine learning sub-model;
[0092] S35, using the prediction set respectively in n 2 Each of the machine learning sub-models performs a fitting prediction to obtain its respective second fitting prediction result.
[0093] S36, based on n 2 The second-fit prediction result and the fitting weights of each machine learning sub-model, for n 2 The second fitting prediction results are weighted and calculated to obtain the final target fitting prediction result.
[0094] The formula for calculating the target fitting prediction result is as follows:
[0095]
[0096] Among them, V PP To fit the prediction results to the final target, K represents the second fitted prediction result of the i-th machine learning sub-model. i This represents the fitting weight of the i-th machine learning sub-model.
[0097] The method in this application utilizes n 2 A number of machine learning sub-models are used to improve the generalization of the target fitting prediction results. While reducing the randomness of the target fitting prediction results, the different performance of different machine learning sub-models are also taken into account.
[0098] Optionally, performance parameters include mean absolute error, mean square error, root mean square error, and coefficient of determination; the method also includes:
[0099] Based on the training and validation sets, the mean absolute error, mean square error, root mean square error, and coefficient of determination for each machine learning sub-model are determined.
[0100] Determine the first average of multiple mean absolute errors;
[0101] The formula for calculating the first average is as follows:
[0102]
[0103] Among them, MAE i Let represent the mean absolute error of the i-th machine learning sub-model, and m represent the number of samples in the i-th training and validation set. This represents the second fitted prediction result of the i-th machine learning sub-model for the i-th training and validation set. This represents the true value (dependent variable) in the i-th training and validation set corresponding to the i-th machine learning sub-model;
[0104] Determine the second average of multiple mean square errors;
[0105] The formula for calculating the second average is as follows:
[0106]
[0107] Among them, MSE i Let represent the mean squared error of the i-th machine learning sub-model, and m represent the number of samples in the i-th training and validation set. This represents the second fitted prediction result of the i-th machine learning sub-model for the i-th training and validation set. This represents the true value (dependent variable) in the i-th training and validation set corresponding to the i-th machine learning sub-model;
[0108] Determine the third average of multiple root mean square errors;
[0109] The formula for calculating the third average is as follows:
[0110]
[0111] Among them, RMSE i Let represent the root mean square error of the i-th machine learning sub-model, and m represent the number of samples in the i-th training and validation set. This represents the second fitted prediction result of the i-th machine learning sub-model for the i-th training and validation set. This represents the true value (dependent variable) in the i-th training and validation set corresponding to the i-th machine learning sub-model;
[0112] Determine the fourth average of multiple coefficients of determination;
[0113] The formula for calculating the fourth average is as follows:
[0114]
[0115] in, Let represent the determination coefficient of the i-th machine learning sub-model, and m represent the number of samples in the i-th training and validation set. This represents the second fitted prediction result of the i-th machine learning sub-model for the i-th training and validation set. Let represent the true value (dependent variable) in the i-th training and validation set corresponding to the i-th machine learning sub-model. It is the average of the true values (dependent variables) in the i-th training and validation set corresponding to the i-th machine learning sub-model;
[0116] Based on the first average, second average, third average, and fourth average, the model accuracy of the prediction model composed of multiple machine learning sub-models is obtained.
[0117] In this embodiment, the efficiency, accuracy, and performance of each machine learning sub-model are measured using MAE. i MSE i RMSE i , This is reflected in the mean absolute error (MAE). i First mean, mean square error (MSE) i Second mean and root mean square error RMSE i The lower the third mean, the lower the coefficient of determination. The higher the fourth average value, the higher the accuracy of the machine learning model to be trained after combining the various machine learning sub-models in this fitting and prediction process, that is, the better the overall performance of the machine learning model to be trained.
[0118] This application evaluates the accuracy of the performance parameters of each machine learning sub-model, reflecting the performance of each sub-model. This allows us to understand the accuracy of the model after combining the sub-models and obtain the overall performance of the corresponding machine learning model to be trained. This can help us decide whether to change the machine learning algorithm to be trained, facilitate finding a suitable machine learning model for a certain type of dataset, and improve the accuracy of fitting and predicting for that type of dataset.
[0119] Figure 4 This is a schematic diagram illustrating the performance evaluation process of each machine learning sub-model in this application, such as... Figure 4 As shown, it includes:
[0120] S41, take the positive sample set (D) from the original training set (D) + ) divided into D + 1. D + 2、…、D + n-1 D + n There are n positive sample subsets in total; the negative sample subsets (D) in the original training set (D) are... - ) divided into D - 1. D - 2、…、D - n-1 D - n There are n negative sample subsets in total; among them, the difference in the number of positive samples between any two positive sample subsets in the n positive sample subsets is less than or equal to 1, and the difference in the number of negative samples between any two negative sample subsets in the n negative sample subsets is less than or equal to 1.
[0121] S42, taking n=5 as an example, select 4 subsets (such as D) from the 5 positive sample subsets respectively. + 1. D + 2. D +3. D + 4) Select 4 subsets from the 5 negative sample subsets (e.g., D) - 1. D - 2. D - 3. D - 4), forming a target training set (composed of D) + 1. D + 2. D + 3. D + 4. D - 1. D - 2. D - 3. D - Composed of 4 groups); the remaining positive sample subset (such as D) + 5) and a negative sample subset (e.g., D) - 5) Construct a training and validation set (composed of D) + 5. D - (5 components); and so on, constructing n combinations in total. 2 Next, forming n 2 A combination of target training sets and training validation sets; taking n=5 as an example, this forms a combination of 25 target training sets and corresponding training validation sets;
[0122] S43, in n 2 Based on the target training set and the corresponding training and validation sets, select a machine learning algorithm, such as random forest, neural network, or support vector machine, and utilize n... 2 The target training set and the corresponding target training set in the training and validation sets are used to train n. 2 Each of the machine learning sub-models will then be divided into n... 2 The independent variables of the training set and the corresponding training and validation sets are input into the corresponding machine learning sub-model to obtain n. 2 The first group of fitted prediction results, and using n 2 The true values of the training and validation sets (the dependent variables known in the training and validation sets) and the corresponding n 2 For each group of first-fit prediction results, the performance parameters of each machine learning sub-model are calculated. Each group of first-fit prediction results includes multiple first-fit prediction results with an equal number of independent variables as those in the corresponding training and validation sets. Performance parameters include mean absolute error (MAE), mean squared error (MSE), root mean squared error (RMSE), and coefficient of determination (R²). 2 ;
[0123] The formula for calculating the performance parameters of the i-th machine learning sub-model is as follows:
[0124]
[0125] Among them, MAEi MSE i RMSE i , Let represent the mean absolute error, mean squared error, root mean squared error, and coefficient of determination of the i-th machine learning sub-model, respectively; m represents the number of samples in the i-th training and validation set. This represents the fitted prediction result of the i-th machine learning sub-model for the i-th training and validation set. This represents the true value (a known dependent variable) in the i-th training and validation set corresponding to the i-th machine learning sub-model. It is the average of the true values (known dependent variables) in the i-th training and validation set corresponding to the i-th machine learning sub-model;
[0126] S44, calculate n 2 The mean absolute error (MAE_mean), mean squared error (MSE_mean), root mean squared error (RMSE_mean), and coefficient of determination (R²) of each machine learning sub-model are: the first mean (MAE_mean), the second mean (MSE_mean), the third mean (RMSE_mean), and the third mean (RMSE_mean). 2 The corresponding fourth average (R) 2 (mean).
[0127]
[0128]
[0129] Among them, Mean(MAE i Mean (MSE) i Mean (MSE) i ), These represent the first average value corresponding to the mean absolute error (MAE) of the i-th machine learning sub-model, the second average value corresponding to the mean squared error (MSE), the third average value corresponding to the root mean square error (RMSE), and the fourth average value corresponding to the coefficient of determination (MCO). i MSE i RMSE i , Let N represent the mean absolute error, mean squared error, root mean squared error, and coefficient of determination of the i-th machine learning sub-model, respectively; n is the set of positive samples (D) from the original training set (D). + ) divided into a positive sample subset (D) + 1. D + 2、…、D + n-1 D + n The quantity of ).
[0130] Using the first mean (MAE_mean): Mean(MAE) iSecond average (MSE_mean): Mean(MSE) i ), Third Mean (RMSE_mean): Mean(MSE) i ), and the fourth average (R 2 (Mean) To jointly evaluate the overall performance of the i-th machine learning sub-model, i.e., Mean(MSE) i Mean (MSE) i Mean (RMSE) i The lower, The higher the value, the higher the accuracy of the machine learning sub-model in this fitting and prediction process, and the better the overall performance of the machine learning sub-model.
[0131] In some embodiments, taking the potential development location of erosion gullies based on a random forest algorithm model in a certain area as an example area, the fitting prediction is performed. The application process of the method in this application is as follows:
[0132] 1) The example area is as follows:
[0133] The total area of the example zone is approximately 1600 km². 2 The elevation ranges from 150 to 470 meters, generally higher in the northeast and lower in the southwest. The landforms include low mountains and hills, plains, and rolling hills in transitional zones. It has a mid-latitude continental monsoon climate, with an average annual temperature of 3.3℃ and an average annual precipitation of approximately 560 mm. Rainfall is concentrated from June to September, while snowfall is concentrated from November to January of the following year. Overall, the four seasons are distinct.
[0134] 2) Data Acquisition:
[0135] Using high-resolution satellite true-color composite imagery, approximately 5700 erosion grooves were derived from visual interpretation within the example area. Simultaneously, 5000 random circles with a diameter of 20m were randomly generated outside the 200m buffer zone of the erosion grooves. The distribution of the erosion grooves and random circles is as follows: Figure 5 As shown. Simultaneously, using ALOSDEM (Advanced Land Observing Satellite-1 Digital Elevation Model) and annual precipitation data, derived data variables within the example area were obtained through geographic analysis: elevation difference, slope factor, slope length factor, catchment density, and distance from the catchment line, etc. The elevation difference distribution in the example area is shown below. Figure 6 As shown, the slope factor distribution in the example area is as follows: Figure 7 As shown, the slope length factor distribution in the example area is as follows: Figure 8 As shown, the catchment density distribution in the example area is as follows: Figure 9As shown, the distance distribution of the example area from the waterline is as follows: Figure 10 As shown.
[0136] The obtained derived data is shown in Table 3.
[0137] Table 3
[0138]
[0139] 3) The process of constructing the target training set and training validation set for the potential development location of erosion gullies using the random forest algorithm model.
[0140] ① Construct a random forest algorithm model to obtain the original training set for potential development locations of erosion gullies.
[0141] The mean values of elevation difference, slope factor, slope length factor, catchment density, and distance from the catchment line within the range of 5700 erosion gullies were used as the independent variables of the positive samples in the original training set, and each erosion gully was used as the dependent variable of the positive samples in the original training set. The positive sample data of the original training set are shown in Table 4.
[0142] Table 4
[0143]
[0144]
[0145] The mean values of elevation difference, slope factor, slope length factor, catchment density, and distance from the catchment line within the range of 5000 random circles were used as independent variables for the negative samples of the original training set, and each random circle was used as the dependent variable for the negative samples of the original training set. The negative sample data of the original training set are shown in Table 5.
[0146] Table 5
[0147] Id Random circle Elevation difference Slope factor slope length factor Catchment density Distance from the waterline 1 0 27.91410065 0.502646983 2.768340111 5.023409843 65.62940216 2 0 18.16090012 0.613398015 2.380179882 4.69674015 48.40420151 3 0 20.40250015 0.359719008 1.040009975 4.38436985 69.49890137 4 0 23.44750023 0.381687999 3.282409906 4.528240204 19.68510056 5 0 25.71829987 0.57050699 7.499820232 4.497590065 67.18260193 6 0 18 0.282227993 2.089370012 4.884150028 26.68530083 7 0 20.25440025 0.36639899 5.627900124 4.944930077 16.41410065 8 0 30 0.715867996 11.11229992 4.38808012 72.48750305 9 0 28 0.182185993 4.35063982 4.750549793 38.74000168 10 0 27.06780052 0.566365004 10.8913002 4.751890182 5.984340191
[0148] ② Divide the positive and negative sample sets: The 5700 erosion gullies were randomly divided into 5 positive sample subsets with a difference of less than or equal to 1 based on their spatial location, and the 5000 random circles were randomly divided into 5 negative sample subsets with a difference of less than or equal to 1 based on their spatial location.
[0149] ③ Constructing the target training set and training / validation set: Four subsets are selected from each of the five positive sample subsets, and four subsets are selected from each of the five negative sample subsets to form one target training set (consisting of 4560 erosion gullies and 4000 random circles, with dependent variables of 1 and 0 for erosion gullies and random circles, respectively, and independent variables of elevation difference, slope factor, slope length factor, catchment density, and mean distance from the catchment line within the range for both erosion gullies and random circles); the remaining one positive sample subset and one negative sample subset form one training / validation set (consisting of 1140 erosion gullies and 1000 random circles, with dependent variables of 1 and 0 for erosion gullies and random circles, respectively, and independent variables of elevation difference, slope factor, slope length factor, catchment line density, and mean distance from the catchment line within the range for both erosion gullies and random circles); a total of 5 training / validation sets are constructed using permutations and combinations. 2 ④ Training and validation of random forest sub-models: Using the target training set from the combination of the 25 target training sets and training validation sets, the random forest algorithm is used to train 25 random forest sub-models respectively; then, using the independent variables of the training validation set from the combination of the 25 target training sets and training validation sets, the 25 trained random forest sub-models are used to fit 25 sets of first fitting prediction results for validation; then, the 25 sets of first fitting prediction results for validation are compared with the dependent variables in the corresponding training validation sets, and the mean absolute error (MAE), mean square error (MSE), root mean square error (RMSE), and coefficient of determination (R²) of each random forest sub-model are calculated. 2 ⑤ Performance evaluation of the random forest sub-model: Utilizing multiple MAE, multiple MSE, multiple RMSE, and multiple R-values of one of the 25 random forest sub-models. 2 The calculated average values for MAE, MSE, and RMSE are: 0.29, 0.14, 0.38, and R... 2 The fourth average value is 0.69, indicating that the accuracy of this random forest sub-model can reach 71%, and the ability of elevation difference, slope factor, slope length factor, runoff density, and distance from the runoff line to assess the risk of gully erosion is good.
[0150] 4) Twenty-five random forest sub-models were selected to fit and predict the potential development location of erosion gullies.
[0151] ① Calculate the performance difference: The 1-MAE (performance difference) of the 25 random forest sub-models were calculated as follows: 0.72, 0.73, 0.68, 0.68, 0.75, 0.72, 0.72, 0.70, 0.69, 0.68, 0.74, 0.69, 0.70, 0.75, 0.76, 0.71, 0.66, 0.73, 0.70, 0.75, 0.68, 0.74, 0.71, 0.69, 0.67;
[0152] ② Determine the total error parameter: Sum the 25 1-MAE values to get 17.75;
[0153] ③ Determine the fitting weights of the random forest sub-models: Divide each of the 25 1-MAE values by 17.75 to obtain the fitting weights of the 25 random forest sub-models: 0.0406, 0.0411, 0.0383, 0.0383, 0.0423, 0.0406, 0.0406, 0.0394, 0.0389, 0.0383, 0.0417, 0.0389, 0.0394, 0.0423, 0.0428, 0.0400, 0.0372, 0.0411, 0.0394, 0.0423, 0.0383, 0.0417, 0.0400, 0.0389, 0.0377;
[0154] ④ Obtain the second fitting prediction results of 25 machine learning sub-models respectively: Using the independent variables in the prediction set, 25 machine learning sub-models are used to carry out fitting predictions to obtain 25 sets of second fitting prediction results. The value range is 0 to 1. The higher the value, the higher the risk of erosion gully occurrence.
[0155] ⑤ Obtain the target fitting prediction result: The 25 sets of second fitting prediction results are weighted according to the fitting weights of the corresponding 25 random forest sub-models to obtain the final target fitting prediction result of the random forest model, such as... Figure 11 As shown.
[0156] 5) Results and Analysis:
[0157] To reflect the overall risk characteristics of gully formation in the region, the 70%, 80%, and 90% quantiles of the final fitted prediction values (0–1) were used as the lower thresholds for general risk, medium risk, and high risk areas, respectively. Figure 12 As shown in the figure. The results show that the risk areas are generally distributed in relatively continuous strips. In terms of regional topography, the concentrated distribution areas belong to the plains and hills transition zone, and in terms of local topography, they are located near the secondary watersheds on both sides of the river terraces.
[0158] To further verify the accuracy of the target fitting prediction results, the average values of the final fitting prediction results within 5700 known erosion gullies and 5000 random circles were calculated. Ideally, the average value of the final fitting prediction results within the known erosion gullies should be 1, and the average value of the final fitting prediction results within the random circles should be 0. Figure 13 The mean distribution curve of the predicted results is fitted to the final target within the erosion gully, as shown in the figure. Figure 13 As shown, the peak value of the final target fitting prediction result within the known erosion gully is 0.77. Figure 14 The mean distribution curve of the predicted results fitted to the final target within the random circle is shown in the figure. Figure 14 As shown, the peak value of the final target fitting prediction result within the random circle is 0.17. The 70%, 80%, and 90% quantiles of the final fitting prediction result (0-1) are used as the lower thresholds for general risk, medium risk, and high risk areas, respectively. This determines the risk level of the erosion gully in this embodiment as general risk and medium risk, and the risk level within the random circle of the erosion gully as general risk. Since the formation of erosion gullies is influenced by various factors such as rainfall, freeze-thaw cycles, vegetation canopy density, soil composition, and landform, it is difficult to ensure that the fitting prediction result is completely consistent with known erosion gullies. The fitting prediction method of this application can obtain more scientific and reasonable verification accuracy and fitting prediction results during the machine learning binary fitting process.
[0159] This application addresses the need for fitting and predicting the potential development location of erosion gullies in the example area. It explores how to ensure the uniform and random distribution of positive and negative samples in the target training set and training validation set constructed during the machine learning-based binary fitting process. This solves the problem that while the randomness of the spatial location of samples in the target training set and training validation set is achieved, the positive and negative attributes of the samples within the target training set and training validation set are not uniform, thus affecting the training effect and validation accuracy of the machine learning model. At the same time, it explores how to improve the accuracy of the target fitting prediction results in the machine learning-based binary fitting process. This solves the problem that when using a single machine learning model to obtain fitting prediction results, the machine learning model is more susceptible to the randomness of algorithm iteration and more prone to overfitting, resulting in lower accuracy of the final fitting prediction results.
[0160] This application constructs target training sets and training validation sets that balance the randomness of training sample spatial locations with the uniformity of positive and negative attributes. Simultaneously, a scientific weighting method is employed to enhance the generalization ability and reduce randomness of the machine learning model, resulting in higher accuracy in the final target fitting prediction. Specifically: Based on the original training set, multiple target training sets and corresponding training validation sets are constructed. Multiple machine learning sub-models are trained and validated on each set. The average validation accuracy of the multiple sub-models is used to evaluate the overall performance of the machine learning model. Compared to a single model, the combination of trained machine learning sub-models yields a more reasonable validation accuracy. Fitting predictions are performed using each sub-model and the prediction set, resulting in multiple second-order fitting predictions. The fitting weight of each sub-model is determined based on its validation accuracy. The multiple second-order fitting predictions are then weighted according to their fitting weights to obtain the final target fitting prediction. Compared to a single model, the combination of trained machine learning sub-models reduces randomness during algorithm iteration and improves the generalization ability of the machine learning model.
[0161] like Figure 15 As shown, this application provides a fitting and prediction system for a machine learning model, comprising:
[0162] The acquisition module is used to acquire the original training set;
[0163] The building module is used to construct multiple target training sets and a corresponding training and validation set for each target training set based on the original training set.
[0164] The training module is used to train the machine learning model to be trained using multiple target training sets to obtain multiple machine learning sub-models.
[0165] The weight determination module is used to determine the fitting weights for each machine learning sub-model based on multiple training and validation sets.
[0166] The fitting result determination module is used to obtain the prediction set and, based on the prediction set, multiple machine learning sub-models, and multiple fitting weights, determine the target fitting prediction result.
[0167] Optionally, building modules are specifically used for:
[0168] Divide the positive sample set in the original training set into n positive sample subsets, and divide the negative sample set in the original training set into n negative sample subsets;
[0169] Based on n positive sample subsets and n negative sample subsets, construct n 2 Each target training set and the corresponding training and validation set for each target training set;
[0170] The target training set includes n-1 positive sample subsets and n-1 negative sample subsets, while the training validation set includes 1 positive sample subset and 1 negative sample subset.
[0171] Optionally, the weight determination module is specifically used for:
[0172] Multiple independent variables from each training and validation set are input into the corresponding machine learning sub-model to obtain multiple first-fit prediction results equal to the number of independent variables.
[0173] Based on the training and validation sets corresponding to multiple machine learning sub-models and multiple first-fit prediction results, the fitting weights of each machine learning sub-model are obtained.
[0174] Optionally, the weight determination module is specifically used for:
[0175] Based on multiple dependent variables and multiple first-fit prediction results in the training and validation sets corresponding to each machine learning sub-model, the performance parameters of the corresponding machine learning sub-model are determined.
[0176] Based on the performance parameters of each of the multiple machine learning sub-models, the fitting weights of each machine learning sub-model are determined.
[0177] Optionally, the weight determination module is specifically used for:
[0178] For each machine learning sub-model, the difference between the performance parameter and 1 is calculated to obtain the performance difference value;
[0179] Based on the performance differences of multiple machine learning sub-models, the sum of error parameters is obtained;
[0180] Based on the sum of multiple performance differences and error parameters, the fitting weights of each of the multiple machine learning sub-models are obtained.
[0181] Optionally, the fitting result determination module is specifically used for:
[0182] By inputting multiple independent variables from the prediction set into each machine learning sub-model, multiple second-fit prediction results are obtained, which are equal in number to the number of independent variables.
[0183] Based on the multiple second fitting prediction results and fitting weights corresponding to multiple machine learning sub-models, the target fitting prediction result is obtained.
[0184] Optionally, performance parameters include mean absolute error, mean square error, root mean square error, and coefficient of determination; the system also includes an accuracy evaluation module, which is specifically used for:
[0185] Based on the training and validation sets, the mean absolute error, mean square error, root mean square error, and coefficient of determination for each machine learning sub-model are determined.
[0186] Determine the first average of multiple mean absolute errors;
[0187] Determine the second average of multiple mean square errors;
[0188] Determine the third average of multiple root mean square errors;
[0189] Determine the fourth average of multiple coefficients of determination;
[0190] Based on the first average, second average, third average, and fourth average, the model accuracy of the prediction model composed of multiple machine learning sub-models is obtained.
[0191] A computing device according to an embodiment of this application includes a memory, a processor, and a program stored in the memory and running on the processor. When the processor executes the program, it implements some or all of the steps of the above-described fitting and prediction method for a machine learning model.
[0192] The computing device can be a computer, and the corresponding program is computer software. The parameters and steps in the computing device described above can be referred to the parameters and steps in the embodiment of the fitting and prediction method of a machine learning model in the above text, and will not be repeated here.
[0193] This application provides a computer-readable storage medium storing instructions that, when executed, perform the steps of the above-described fitting and prediction method for a machine learning model.
[0194] The computer-readable storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
[0195] The technical solutions of this disclosure can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of this disclosure. The aforementioned computer-readable storage medium can be a non-transitory computer-readable storage medium, including: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, and other media capable of storing program code; it can also be a transient computer-readable storage medium.
[0196] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0197] Those skilled in the art will recognize that this application can be implemented as a system, method, or computer program product. Therefore, this disclosure can be implemented in the following forms: it can be entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "module" or "system." Furthermore, in some embodiments, this application can also be implemented as a computer program product contained in one or more computer-readable media, which contains computer-readable program code. Computer-readable storage media can be, for example, but not limited to—electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof.
[0198] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0199] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A method for fitting and predicting machine learning models, characterized in that, Fitting predictions applied to the potential development location of erosion gullies include: Obtain the original training set, which includes gully-derived data and random circle-derived data of potential development locations of the gullies. Both the gully-derived data and the random circle-derived data include elevation difference, slope factor, slope length factor, catchment line density, and distance from the catchment line. The original training set is divided into n positive sample subsets and n negative sample subsets. n-1 positive sample subsets are selected from the n positive sample subsets, and n-1 negative sample subsets are selected from the n negative sample subsets to form one target training set. The remaining one positive sample subset and one negative sample subset form one training validation set corresponding to the target training set. This process is repeated n² times to form n² combinations of target training sets and training validation sets. Multiple target training sets are used to train the machine learning model to be trained, resulting in multiple machine learning sub-models; wherein, the machine learning model to be trained is a random forest algorithm model, a neural network model, or a support vector machine. Based on multiple training and validation sets, the fitting weights of each machine learning sub-model are determined; wherein the formula for calculating the fitting weights is as follows: ; ; Among them, MAE i Let be the mean absolute error of the i-th machine learning sub-model across multiple training and validation sets, and let sum(1-MAE) be the performance difference (1-MAE) among all machine learning sub-models. i The sum of error parameters, where n is the number of positive sample subsets. Represents the fitting weights of the i-th machine learning sub-model; A prediction set is obtained, and multiple independent variables in the prediction set are input into each of the machine learning sub-models to obtain multiple second fitting prediction results equal in number to the multiple independent variables; based on the multiple second fitting prediction results corresponding to the multiple machine learning sub-models and the fitting weights, a target fitting prediction result is obtained; wherein, the prediction set is of the same data type as the original training set, and the target fitting prediction result is the risk zone distribution of the potential development location of the erosion gully.
2. The method according to claim 1, characterized in that, The step of determining the fitting weights for each of the machine learning sub-models based on multiple training and validation sets includes: Multiple independent variables from each of the training and validation sets are input into the corresponding machine learning sub-model to obtain multiple first fitting prediction results equal to the number of the multiple independent variables; Based on the training and validation sets corresponding to the multiple machine learning sub-models and the multiple first fitting prediction results, the fitting weights of each machine learning sub-model are obtained.
3. The method according to claim 2, characterized in that, The process of obtaining the fitting weights for each machine learning sub-model based on the training and validation sets corresponding to the multiple machine learning sub-models and the multiple first fitting prediction results includes: Based on multiple dependent variables and multiple first fitting prediction results in the training and validation sets corresponding to each machine learning sub-model, the performance parameters of the corresponding machine learning sub-model are determined. The fitting weights of each of the machine learning sub-models are determined based on their respective performance parameters.
4. The method according to claim 3, characterized in that, The step of determining the fitting weights for each of the multiple machine learning sub-models based on their respective performance parameters includes: For each of the machine learning sub-models, the difference between the performance parameter and 1 is calculated to obtain the performance difference value; Based on the performance differences of each of the multiple machine learning sub-models, the sum of error parameters is obtained; Based on the sum of the multiple performance differences and the error parameters, the fitting weights of each of the multiple machine learning sub-models are obtained.
5. The method according to claim 3 or 4, characterized in that, The performance parameters include mean absolute error, mean square error, root mean square error, and coefficient of determination; the method further includes: Based on the training and validation set, the mean absolute error, mean square error, root mean square error, and coefficient of determination for each machine learning sub-model are determined. Determine a first average value of the plurality of said average absolute errors; Determine a second average value of the plurality of mean square errors; Determine a third average value of the plurality of root mean square errors; Determine a fourth average of the plurality of determination coefficients; Based on the first average value, the second average value, the third average value, and the fourth average value, the model accuracy of the prediction model composed of multiple machine learning sub-models is obtained.
6. A fitting and prediction system for a machine learning model, characterized in that, Fitting predictions applied to the potential development location of erosion gullies include: The acquisition module is used to acquire the original training set, which includes erosion gully derived data and random circle derived data of the potential development location of the erosion gully. Both the erosion gully derived data and the random circle derived data include elevation difference, slope factor, slope length factor, water catchment density and distance from the water catchment line. The construction module is used to divide the positive sample set in the original training set into n positive sample subsets and the negative sample set in the original training set into n negative sample subsets; select n-1 positive sample subsets from the n positive sample subsets and n-1 negative sample subsets from the n negative sample subsets to form a target training set; combine the remaining 1 positive sample subset and 1 negative sample subset to form a training and validation set corresponding to the target training set, and so on, constructing n² sets in total according to permutations and combinations to form n² combinations of target training sets and training and validation sets; The training module is used to train the machine learning model to be trained using multiple target training sets to obtain multiple machine learning sub-models; wherein the machine learning model to be trained is a random forest algorithm model, a neural network model, or a support vector machine. The weight determination module is used to determine the fitting weights of each of the machine learning sub-models based on multiple training and validation sets; wherein the formula for calculating the fitting weights is as follows: ; ; Among them, MAE i Let be the mean absolute error of the i-th machine learning sub-model across multiple training and validation sets, and let sum(1-MAE) be the performance difference (1-MAE) among all machine learning sub-models. i The sum of error parameters, where n is the number of positive sample subsets. Represents the fitting weights of the i-th machine learning sub-model; The fitting result determination module is used to obtain a prediction set and input multiple independent variables in the prediction set into each of the machine learning sub-models to obtain multiple second fitting prediction results equal in number to the multiple independent variables; based on the multiple second fitting prediction results corresponding to the multiple machine learning sub-models and the fitting weights, a target fitting prediction result is obtained; wherein, the data type of the prediction set is consistent with that of the original training set, and the target fitting prediction result is the risk zone distribution of the potential development location of the erosion gully.
7. A computing device comprising a memory, a processor, and a program stored in the memory and running on the processor, characterized in that, When the processor executes the program, it implements the steps of a fitting and prediction method for a machine learning model as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a terminal device, cause the terminal device to perform the steps of a fitting and prediction method for a machine learning model as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Multi-source data fusion method based on aircraft, electronic equipment and storage medium
CN116578945A