Deep learning prediction method based on dynamic weighting mechanism
By constructing the source sample database and calculating the confidence of the feature group, and dynamically adjusting the weight of the feature group, the problem of insufficient feature impact evaluation of the deep learning model in multi-factor time series prediction is solved, and the accuracy and credibility of the prediction are improved.
Patent Information
- Application Number
- CN202410722439.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-10-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing deep learning models fail to fully evaluate the specific impact of different features and their types on forecast results in multi-factor time series forecasts, and ignore the interaction and influence differences between features, resulting in inaccurate forecast results.
By constructing a source sample database, calculate the correlation and importance between features and target variables, generate feature groups and calculate their confidence, dynamically adjust the prediction weight of feature groups, and combine gray correlation analysis and decision tree models to evaluate the characteristics of features. influence and confidence to generate more refined prediction results.
It improves the accuracy and reliability of time series prediction, comprehensively considers the impact of each feature, and enhances the model's understanding and processing capabilities of feature differences.
Smart Images

Figure CN118734992A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of deep learning time series prediction, and specifically to a deep learning prediction method based on a dynamic weighting mechanism. Background Art
[0002] In recent years, artificial intelligence technology has made rapid progress, especially deep learning technology, which has made breakthrough progress in many industries. It is widely used in the field of time series prediction, providing unprecedented prediction capabilities for various important industries such as financial analysis, weather forecasting and energy management. These advances are mainly due to the ability of deep learning technology, which can provide more accurate and detailed insights by comprehensively analyzing how multiple factors jointly affect future trends. By deeply exploring the many influencing factors in time series data, deep learning models reveal the deep relationship between the target variable and these factors.
[0003] In the current practice of applying deep learning models to multi-factor time series forecasting, there is still a problem of insufficient feature mining. Specifically, these models fail to fully evaluate the specific impact of different features and their types on the forecast results. In addition, in the forecasting process, the features are often not carefully classified, and there is a lack of confidence assessment of different feature groups and a mechanism for dynamic weight allocation based on the forecast errors of each feature group at different time points. This approach ignores the interaction and influence differences between features, which may lead to the forecast results not fully reflecting the true influence of each feature. To solve this problem, it is necessary to design a more sophisticated feature analysis and weight allocation mechanism. By classifying different feature groups and dynamically adjusting weights based on their confidence and performance in the forecast, the contribution of each feature to the final forecast result can be more accurately captured and reflected. This approach can ensure that the forecast model considers the impact of various features more carefully and comprehensively, thereby improving the accuracy and reliability of time series forecasting.
[0004] After searching, the Chinese patent application number is CN202410177554, and the application publication date is March 22, 2024. It discloses a method and system for predicting radiation pneumonitis by dosimetry and deep learning features. The method includes carefully outlining the normal lung tissue on the positioning CT image before radiotherapy, dividing the two key regions of interest (ROIs) of Lung-PTV and PTV-GTV, and then using a deep learning network to independently extract features from these two ROIs. In order to finely screen these features, Spearman correlation analysis and LASSO methods are used to eliminate redundancy and retain the most representative features. Subsequently, these screened features are used to train the model through a multi-layer perceptron (MLP) method with five-fold cross-validation to determine the best model. On the basis of the selected optimal model, the features screened out by single factor analysis are further combined, and MLP is used to construct a joint model to predict the risk of radiation pneumonitis. Although the patent has achieved a certain improvement in prediction accuracy through feature screening and combination, in the analysis process, the impact of different features and their types on the prediction results is insufficiently evaluated, and the interaction and differences between features are ignored. This approach may fail to fully reveal the true contribution of each feature to the prediction results, affecting the comprehensiveness and accuracy of the prediction.
[0005] After retrieval, the Chinese patent application number is CN202111007838, and the application publication date is September 29, 2023. It discloses a method for power load forecasting based on feature engineering and multi-channel deep learning. The method includes splitting the data set into multiple subsets based on key features, and independently training each subset using a radial basis function network to form multiple specialized prediction models. Some models are selected and their prediction results for the same test data are integrated to obtain more accurate power load prediction results. This approach utilizes the principle of ensemble learning and aims to improve the accuracy and reliability of the final prediction by combining the predictions of multiple models. Although the patent divides the data set and uses the average of multiple prediction results as the final prediction, it fails to fully consider the impact of each feature on the prediction confidence during the prediction process. In addition, it does not distinguish between different feature groups, and dynamically adjusts the weights according to their confidence and prediction performance, which shows certain limitations when dealing with multi-factor predictions.
[0006] Although the above two methods have made corresponding screening combinations or data set segmentation according to the differences of features in deep learning multi-factor prediction tasks, they have not carried out detailed classification of features, lack of confidence assessment of different feature groups and dynamic weight allocation mechanism based on the prediction errors of each feature group at different time points. Therefore, there are certain limitations in the prediction performance. In addition, the current deep learning model has failed to fully evaluate the specific impact of different features and their types on the prediction results in the multi-factor time series prediction task, and has not carried out detailed classification of features in the prediction process, and lacks the problem of dynamic weight allocation based on the confidence of feature groups and the prediction errors of feature groups. Summary of the invention
[0007] The purpose of the present invention is to provide a deep learning prediction method based on a dynamic weighting mechanism to solve the problems raised in the above background technology.
[0008] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0009] Step S1: constructing a source sample database, wherein the source sample database is composed of a source sample data set, wherein the source sample data set records a target variable and an influencing feature of the target variable; based on the influencing feature, generating a mapping relationship between the influencing feature and the feature category, wherein one feature category corresponds to at least one influencing feature;
[0010] Step S2: Calculate the correlation between the influencing features and the target variable through the grey correlation analysis model;
[0011] Step S3: Based on the source sample database, generate a target variable sample set, use the influencing feature as the segmentation feature, use different feature observations of the influencing feature as different nodes of the decision tree, and generate a left observation data set and a right observation data set respectively; based on the impurity measurement function in the decision tree model, calculate the impurity when the influencing feature is used as the segmentation feature;
[0012] Step S4: Based on the impurity, calculate the influence of the feature observation value corresponding to the node; based on the influence and impurity, calculate the importance of the influencing feature;
[0013] Step S5: Calculate the confidence of the influencing feature based on the relevance and importance;
[0014] Step S6: generating a feature group based on the mapping relationship database and the mapping relationship, and calculating the feature group confidence;
[0015] Step S7: Generate an input sample database of the deep learning model by random sampling, and construct a training set and a test set; generate a training set feature group and a test set feature group based on the mapping relationship database and the mapping relationship;
[0016] Step S8: Based on the training set feature group, calculate the feature group confidence corresponding to the training set feature group; based on the test set feature group, calculate the prediction weight of the influencing feature in the source sample data subset under the feature category;
[0017] Step S9: Based on the prediction weights, calculate the prediction results of the source sample data set and output them.
[0018] Furthermore, the step S1 includes:
[0019] Step S11: Establish a source sample database, denoted as R N×(n+1) ={S e |e∈[1,N]}, where S e represents the e-th source sample data set, and S e ={f 1 , f 2 , f 3 , …, f n , P target}, f 1 , f 2 , f 3 , …, f n Represent the 1st, 2nd, 3rd, ..., nth influencing features, P target represents the target variable, N represents the length of the time series, and one source sample data set is generated for each time series, and n represents the total number of influencing features;
[0020] Step S12: Establish a mapping relationship database, recorded as Among them, f i :c j represents the i-th influencing feature f i With the jth feature category c j There is a mapping relationship between them, J represents the total number of feature categories, f i ∈{f 1 , f 2 , f 3 , …, f n}∈S e .
[0021] Furthermore, the step S2 comprises:
[0022] Step S21: Calculate the grey correlation coefficient:
[0023] Among them, ξ i (k) represents the grey correlation coefficient, P target (k) represents the target variable P target The kth target observation value, f i(k) represents the influencing feature f i The kth characteristic observation value of , ρ represents the resolution coefficient, and ρ∈(0,1), Δ ik Represents the target observation value P target (k) and characteristic observation value f i (k) the absolute value of the difference between them, and Δ ik =|P target (k)-f i (k)|, Δmin represents the minimum difference of the second level, and Δmin=min i min k Δ ik , min i min k Indicated in absolute value Δ ik Take the minimum value, Δmax represents the maximum difference of the second level, and Δmax=max i max k Δ ik , max i max k Indicated in absolute value Δ ik Take the maximum value;
[0024] Step S22: Calculate the correlation Corri:
[0025] Furthermore, the step S3 includes:
[0026] Step S31: Based on the source sample database R N×(n+1) , if f i ∈S e , then in the source sample data set S e Extract the target variable P target ; Overall impact characteristics f i Corresponding to all the extracted target variables, and generating the influencing features f i The corresponding target variable sample set is denoted as N s ;
[0027] To affect the feature f i is the segmentation feature to affect the feature f i The k-th feature observation value of is the k-th node of the decision tree, and the target variable sample set N s Randomly split to influence features f i The left and right sides of the target variable are divided into the target variable on the left side to generate the target variable left sample set N left , the target variable on the right is split to generate the target variable right sample set N right ;
[0028] Based on the left sample set N of the target variable left, generate the left observation data set of the target variable, denoted as X left ; Based on the sample set N on the right side of the target variable right , generate the right-hand observation data set of the target variable, denoted as X right ; And for any target variable in the target variable left sample set or the target variable right sample set, select a target observation value respectively, and record them in the left observation value data set and the right observation value data set respectively;
[0029] Step S32: Based on the impurity measurement function H(·) in the decision tree model, the left impurity measurement function H(X left ),and and the right-hand impurity measurement function H(X right ),and Among them, NUM(X left ) represents the left observation data set X left The number of target observations included in NUM(X right ) represents the right-hand observation data set X right The number of target observations included in y a ∈X left ,y b ∈X right , Represents the sample set N on the left side of the target variable left The left-hand side average value calculated from the actual values corresponding to each target variable in , Represents the sample set N on the right side of the target variable right The right-hand side average value calculated from the actual values corresponding to each target variable in ;
[0030] Based on the impurity measurement function, calculate the influencing feature f i Impurity G as a segmentation feature i (k) = G left +G right ; Among them, NUM(N s ) represents the target variable sample set N s The number of target variables contained in NUM(N left ) represents the sample set N on the left side of the target variable left The number of target variables contained in NUM(N right ) represents the sample set N on the right side of the target variable right The number of target variables included in , and
[0031] Further, the step S4 includes:
[0032] Step S41: Based on the impurity, calculate the influence I of the kth feature observation value corresponding to the node k =w k ×G i (k)-w left ×G left -w right ×G right , where w k , w left , w right Respectively represent weight coefficients;
[0033] Step S42: Calculate the importance of the influencing feature:
[0034]
[0035]
[0036] Among them, IMP i Indicates the influencing feature f i The importance of imp i Indicates the influencing feature f i The error degree of m is the maximum code number that affects the feature.
[0037] Furthermore, the step S5 comprises:
[0038] Calculate the impact feature f i Confidence of:
[0039]
[0040] Among them, Conf i Indicates the influencing feature f i The confidence level, is the exponential decay coefficient, w cor 、w imp and w τ Respectively represent weight coefficients;
[0041] and,
[0042]
[0043]
[0044] Further, the step S6 includes:
[0045] Step S61: Based on the mapping relationship database And mapping relationship, generate feature group, recorded as
[0046] FG(c j )={f i|i∈[1,m]};
[0047] Step S62: Based on the feature group FG(c j ), calculate the feature group FG(c j )’s confidence level:
[0048]
[0049] in, represents the confidence of the feature group FG(cj), Interact(C j ) represents the average value of the correlation coefficients between all feature pairs in the feature group FG(cj), and α takes the value of 0 or 1. When α takes the value of 1, it means that the feature group FG(cj) is considered j ) is the influence of the interaction between the feature pairs within the group. When α is 0, it means that the feature group FG(c j ) The impact of interactions between pairs of features within the
[0050] and, Among them, ρ(f p , f q ) represents the influencing feature f p and the influence feature f q The Pearson correlation coefficient of the feature pair composed of j ) is the number of feature pairs formed between each influencing feature.
[0051] Further, the step S7 includes:
[0052] Step S71: Randomly sample the source sample data set from the source sample database. The number of random sampling is Each time random sampling is performed, in the source sample data set S e Randomly select Influencing features, generate a subset of source sample data, denoted as SO e , and SO e ∈S e , then it constitutes the source sample data sub-library, denoted as R T×(u+1) = {SO e |e∈[1,N]}, and R T ×(u+1) ∈R N×(n+1) , and the source sample data sub-library R T×(u+1) , as the input sample database of the deep learning model; the source sample data subset SO e , divided into training set and test set according to the ratio of 6:4, and the training set is denoted as SO e train , and the test set is recorded as SO etest , and SO e train ≠SO e test , SO e train ∪SO e test =SO e ;
[0053] Step S72: Execute step S61, based on the mapping relationship database And mapping relationship, generate training set feature group and test set feature group, and convert the training set SO e train The corresponding training set feature group is recorded as SO e train (c j ), the test set SO e tesi The corresponding test set feature group is recorded as SO e train (c j ).
[0054] Further, the step S8 includes:
[0055] Step S81: Return to step S3 and perform the following operations based on the training set feature group S0 e train (c j ), calculate the training set feature group SO e train (c j ) The corresponding feature group confidence is recorded as
[0056] Step S82: In the test set feature group S0 e train (c j ) arbitrarily select the tth influencing feature f t , get the influencing feature f t The kth characteristic observation value of Get the source sample data subset SO e The corresponding source sample dataset S e The target variable P target The kth target observation value of
[0057] Calculate the source sample data subset SO e Medium impact feature f t In feature category c j The prediction weights for:
[0058]
[0059] The prediction weights are standardized so that in, represents the prediction weight, The normalized prediction weights Recorded as
[0060] Furthermore, the step S9 includes:
[0061] Based on the prediction weights, calculate the source sample data set S e The prediction results are:
[0062]
[0063] in, Represents the source sample dataset S e prediction results.
[0064] Compared with the prior art, the beneficial effects achieved by the present invention are as follows: the present invention discloses a deep learning prediction method based on a dynamic weighting mechanism, which solves the problem of insufficient feature impact assessment in deep learning models in multi-factor time series prediction tasks, the lack of detailed classification of features in the prediction process, and the lack of dynamic weight allocation based on feature group confidence and feature group prediction error; and provides an innovative solution to the key difficulties encountered by deep learning in processing multi-factor time series prediction - insufficient feature impact assessment and lack of feature group classification processing; specifically, the influence of each feature on the prediction result is comprehensively analyzed by combining the two levels of feature correlation and feature importance, and the feature group confidence is calculated as a feature level evaluation. In addition, the present invention also introduces a mechanism for evaluating the confidence of different feature groups, and dynamically adjusting the feature group prediction weights based on the prediction errors of each feature group at different time points in the prediction process; thereby enhancing the model's understanding and processing capabilities for feature differences, and improving the overall accuracy and credibility of the prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0066] Figure 1 This is a flow chart of a deep learning prediction method based on a dynamic weighting mechanism proposed in the present invention. DETAILED DESCRIPTION
[0067] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0068] See also Figure 1 , the present invention provides a technical solution:
[0069] In the first embodiment of the present invention, a deep learning prediction method based on a dynamic weighting mechanism is provided, the method comprising:
[0070] Step S1: constructing a source sample database, wherein the source sample database is composed of a source sample data set, wherein the source sample data set records a target variable and an influencing feature of the target variable; based on the influencing feature, generating a mapping relationship between the influencing feature and the feature category, wherein one feature category corresponds to at least one influencing feature;
[0071] Specifically, a source sample database is established, denoted as R N×(n+1) ={S e |e∈[1,N]}, where S e represents the e-th source sample data set, and S e ={f 1 , f 2 , f 3 , …, f n , P target}, f 1 , f 2 , f 3 , …, f n Represent the 1st, 2nd, 3rd, ..., nth influencing features, P target represents the target variable, N represents the length of the time series, and one source sample data set is generated for each time series, and n represents the total number of influencing features;
[0072] Establish a mapping relationship database, denoted as Among them, f i :c j represents the i-th influencing feature f i With the jth feature category c j There is a mapping relationship between them, J represents the total number of feature categories, f i ∈{f 1 , f 2 , f 3 , …, f n}∈S e ;
[0073] Step S2: Calculate the correlation between the influencing features and the target variable through the grey correlation analysis model;
[0074] Specifically, calculate the grey correlation coefficient:
[0075] Among them, ξ i (k) represents the grey correlation coefficient, P target (k) represents the target variable P target The kth target observation value, f i (k) represents the influencing feature f i The kth characteristic observation value of , ρ represents the resolution coefficient, and ρ∈(0,1), Δ ik Represents the target observation value P target (k) and characteristic observation value f i (k) the absolute value of the difference between them, and Δ ik =|P target (k)-f i (k)|, Δmin represents the minimum difference of the second level, and Δmin=min i min k Δ ik , min i min k Indicated in absolute value Δ ik Take the minimum value, Δmax represents the maximum difference of the second level, and Δmax=max i max k Δ ik , max i max k Indicated in absolute value Δ ik Take the maximum value;
[0076] For example, ρ represents the resolution coefficient, and its value range is between 0 and 1. In most cases, ρ is more suitable to be 0.5. This patent takes ρ=0.5. When the resolution coefficient ρ is smaller, the difference between the correlation coefficients is greater, and the discrimination ability is stronger. Because each feature sequence does not have an obvious weight distinction, the average comprehensive correlation degree is used to calculate the grey correlation degree of each feature subsequence as the correlation with the target variable.
[0077] Calculate the correlation Corr i :
[0078] Step S3: Based on the source sample database, generate a target variable sample set, use the influencing feature as the segmentation feature, use different feature observations of the influencing feature as different nodes of the decision tree, and generate a left observation data set and a right observation data set respectively; based on the impurity measurement function in the decision tree model, calculate the impurity when the influencing feature is used as the segmentation feature;
[0079] Specifically, based on the source sample database R N×(n+1) , if f i ∈S e , then in the source sample data set S e Extract the target variable P target ; Overall impact characteristics f i Corresponding to all the extracted target variables, and generating the influencing features f i The corresponding target variable sample set is denoted as N s ;
[0080] To affect the feature f i is the segmentation feature to affect the feature f i The k-th feature observation value of is the k-th node of the decision tree, and the target variable sample set N s Randomly split to influence features f i The left and right sides of the target variable are divided into the target variable on the left side to generate the target variable left sample set N left , the target variable on the right is split to generate the target variable right sample set N right ;
[0081] Based on the left sample set N of the target variable left , generate the left observation data set of the target variable, denoted as X left ; Based on the sample set N on the right side of the target variable right , generate the right-hand observation data set of the target variable, denoted as X right ; And for any target variable in the target variable left sample set or the target variable right sample set, select a target observation value respectively, and record them in the left observation value data set and the right observation value data set respectively;
[0082] Based on the impurity measurement function H(·) in the decision tree model, the impurity measurement function H(X left ),and and the right-hand impurity measurement function H(X right ),and Among them, NUM(X left ) represents the left observation data set X left The number of target observations included in NUM(X right ) represents the right-hand observation data set X right The number of target observations included in y a ∈X left ,y b ∈X right , Represents the sample set N on the left side of the target variable leftThe left-hand side average value calculated from the actual values corresponding to each target variable in , Represents the sample set N on the right side of the target variable right The right-hand side average value calculated from the actual values corresponding to each target variable in ;
[0083] Based on the impurity measurement function, calculate the influencing feature f i Impurity G as a segmentation feature i (k) = G left +G right ; Among them, NUM(N s ) represents the target variable sample set N s The number of target variables contained in NUM(N left ) represents the sample set N on the left side of the target variable left The number of target variables contained in NUM(N right ) represents the sample set N on the right side of the target variable right The number of target variables included in , and
[0084] For example, a random forest is composed of multiple decision trees. During the construction process, each tree creates nodes by splitting features so that the child nodes can minimize the prediction error of the target variable. In each split operation, the impurity of the target variable is minimized by selecting the best split features and split points.
[0085] Step S4: Based on the impurity, calculate the influence of the feature observation value corresponding to the node; based on the influence and impurity, calculate the importance of the influencing feature;
[0086] Specifically, based on the impurity, the influence I of the kth feature observation value corresponding to the node is calculated k =w k ×G i (k)-w left ×G left -w right ×G right , where w k , w left , w right Respectively represent weight coefficients;
[0087] Calculate the importance of influencing features:
[0088]
[0089]
[0090] Among them, IMP i Indicates the influencing feature f iThe importance of imp i Indicates the influencing feature f i The error degree, m represents the maximum code number that affects the feature;
[0091] The difference between the weighted impurities of the current node and the left and right child nodes after the split is calculated to indicate the contribution of the split feature to the reduction of the overall impurity of the model at the current node. For each feature, the average contribution of the reduction in impurity caused by the feature as a split variable in all trees is calculated as the importance score of the feature.
[0092] Step S5: Calculate the confidence of the influencing feature based on the relevance and importance;
[0093] Specifically, calculate the impact feature f i Confidence of:
[0094]
[0095] Among them, Conf i Indicates the influencing feature f i The confidence level, is the exponential decay coefficient, w cor 、w imp and w τ Respectively represent weight coefficients;
[0096] and,
[0097]
[0098]
[0099] For example, the exponential decay term is used to capture the interaction between relevance and importance and is used to adjust the impact of the interaction term on the overall confidence score to ensure the stability of the confidence;
[0100] Step S6: generating a feature group based on the mapping relationship database and the mapping relationship, and calculating the feature group confidence;
[0101] Specifically, based on the mapping relationship database and mapping relationship, generate a feature group, denoted as FG(c j )={f i |i∈[1,m]};
[0102] Based on the feature group FG(c j ), calculate the feature group FG(c j )’s confidence level:
[0103]
[0104] in, Represents the feature group FG(c j ) confidence, Interact(C j ) represents the feature group FG(c j ) is the average value of the correlation coefficients between all feature pairs in the feature group FG(c ), α takes the value of 0 or 1. When α takes the value of 1, it means that the feature group FG(c j ) is the influence of the interaction between the feature pairs within the group. When α is 0, it means that the feature group FG(c j ) The impact of interactions between pairs of features within the
[0105] and, Among them, ρ(f p , f q ) represents the influencing feature f p and the influence feature f q The Pearson correlation coefficient of the feature pair composed of j ) The number of feature pairs formed between each influencing feature;
[0106] Step S7: Generate an input sample database of the deep learning model by random sampling, and construct a training set and a test set; generate a training set feature group and a test set feature group based on the mapping relationship database and the mapping relationship;
[0107] For example, the model training loss function is selected as MSE;
[0108] Specifically, the source sample database is randomly sampled, and the number of random sampling is Each time random sampling is performed, in the source sample data set S e Randomly select Influencing features, generate a subset of source sample data, denoted as SO e , and SO e ∈S e , then it constitutes the source sample data sub-library, denoted as R T×(u+1) = {SO e |e∈[1,N]}, and R T ×(u+1) ∈R N×(n+1) , and the source sample data sub-library R T×(u+1) , as the input sample database of the deep learning model; the source sample data subset SO e , divided into training set and test set according to the ratio of 6:4, and the training set is denoted as SO e train , and the test set is recorded as SO e test , and SO e train≠SO e test , SO e train ∪SO e test =SO e ;
[0109] Based on mapping relation database And mapping relationship, generate training set feature group and test set feature group, and convert the training set SO e train The corresponding training set feature group is recorded as SO e train (c j ), the test set SO e test The corresponding test set feature group is recorded as SO e train (c j );
[0110] For example, perform 15 feature random samplings on the source sample data set, randomly sampling 10 features each time, generate 15 sub-samples, and then divide each sub-sample into a training set and a test set according to a ratio of 6:4;
[0111] Step S8: Based on the training set feature group, calculate the feature group confidence corresponding to the training set feature group; based on the test set feature group, calculate the prediction weight of the influencing feature in the source sample data subset under the feature category;
[0112] Specifically, based on the training set feature group SO e train (c j ), calculate the training set feature group SO e train (c j ) The corresponding feature group confidence is recorded as
[0113] In the test set feature group SO e train (c j ) arbitrarily select the tth influencing feature f t , get the influencing feature f t The kth characteristic observation value of Get the source sample data subset SO e The corresponding source sample dataset S e The target variable P target The kth target observation value of
[0114] Calculate the source sample data subset SO e Medium impact feature ft In feature category c j The prediction weights for:
[0115]
[0116] The prediction weights are standardized so that in, represents the prediction weight, The normalized prediction weights Recorded as
[0117] Step S9: Calculate the prediction result of the source sample data set based on the prediction weight and output it;
[0118] Specifically, based on the prediction weights, the source sample data set S is calculated e The prediction results are:
[0119]
[0120] in, Represents the source sample dataset S e prediction results.
[0121] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0122] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A deep learning prediction method based on a dynamic weighting mechanism, characterized in that: The following steps are involved: Step S1: construct a source sample database, the source sample database is composed of a source sample data set, and the source sample data set records the target variable and the influencing characteristics of the target variable; based on Influencing features, generating a mapping relationship between influencing features and feature categories, wherein one feature category corresponds to at least one influencing feature; Step S2: Calculate the correlation between the influencing features and the target variable through the grey correlation analysis model; Step S3: Based on the source sample database, generate a target variable sample set, use the influencing feature as the segmentation feature, use different feature observations of the influencing feature as different nodes of the decision tree, and generate a left observation data set and a right observation data set respectively; based on the impurity measurement function in the decision tree model, calculate the impurity when the influencing feature is used as the segmentation feature; Step S4: Based on the impurity, calculate the influence of the feature observation value corresponding to the node; based on the influence and impurity, calculate the importance of the influencing feature; Step S5: Calculate the confidence of the influencing feature based on the relevance and importance; Step S6: generating a feature group based on the mapping relationship database and the mapping relationship, and calculating the feature group confidence; Step S7: Generate an input sample database of the deep learning model by random sampling, and construct a training set and a test set; generate a training set feature group and a test set feature group based on the mapping relationship database and the mapping relationship; Step S8: Based on the training set feature group, calculate the feature group confidence corresponding to the training set feature group; based on the test set feature group, calculate the prediction weight of the influencing feature in the source sample data subset under the feature category; Step S9: Based on the prediction weights, calculate the prediction results of the source sample data set and output them.
2. A deep learning prediction method based on a dynamic weighting mechanism according to claim 1, characterized in that: The step S1 comprises: Step S11: Establish a source sample database, denoted as R N×(n+1) ={S e |e∈[1,N]}, where S e represents the e-th source sample data set, and S e ={f1, f2, f3, ..., f n , P target }, f1, f2, f3, …, f n Represent the 1st, 2nd, 3rd, ..., nth influencing features, P target represents the target variable, N represents the length of the time series, and one source sample data set is generated for each time series, and n represents the total number of influencing features; Step S12: Establish a mapping relationship database, recorded as Among them, f i :c j represents the i-th influencing feature f i With the jth feature category c j There is a mapping relationship between them, J represents the total number of feature categories, f i ∈{f1,f2,f3,…,f n }∈S e .
3. A deep learning prediction method based on a dynamic weighting mechanism according to claim 2, characterized in that: The step S2 comprises: Step S21: Calculate the grey correlation coefficient: Among them, ξ i (k) represents the grey correlation coefficient, P target (k) represents the target variable P target The kth target observation value, f i (k) represents the influencing feature f i The kth characteristic observation value of , ρ represents the resolution coefficient, and ρ∈(0,1), Δ ik Represents the target observation value P target (k) and characteristic observation value f i (k) the absolute value of the difference between them, and Δ ik =|P target (k)-f i (k)|, Δmin represents the minimum difference of the second level, and Δmin=min i min k Δ ik , min i min k Indicated in absolute value Δ ik Take the minimum value, Δmax represents the maximum difference of the second level, and Δmax=max i max k Δ ik , max i max k Indicated in absolute value Δ ik Take the maximum value; Step S22: Calculate the correlation Corr i :
4. The deep learning prediction method based on a dynamic weighting mechanism according to claim 3 is characterized in that: The step S3 comprises: Step S31: Based on the source sample database R N×(n+1) , if f i ∈S e , then in the source sample data set S e Extract the target variable P target ; Overall impact characteristics f i Corresponding to all the extracted target variables, and generating the influencing features f i The corresponding target variable sample set is denoted as N s ; To affect the feature f i is the segmentation feature to affect the feature f i The k-th feature observation value of is the k-th node of the decision tree, and the target variable sample set N s Randomly split to influence features f i The left and right sides of the target variable are divided into the target variable on the left side to generate the target variable left sample set N left , the target variable on the right is split to generate the target variable right sample set N right ; Based on the left sample set N of the target variable left , generate the left observation data set of the target variable, denoted as X left ; Based on the sample set N on the right side of the target variable right , generate the right-hand observation data set of the target variable, denoted as X right ; And for any target variable in the target variable left sample set or the target variable right sample set, select a target observation value respectively, and record them in the left observation value data set and the right observation value data set respectively; Step S32: Based on the impurity measurement function H(·) in the decision tree model, the left impurity measurement function H(X left ),and and the right-hand impurity measurement function H(X right ),and Among them, NUM(X left ) represents the left observation data set X left The number of target observations included in NUM(X right ) represents the right-hand observation data set X right The number of target observations included in , and y a ∈X left ,y b ∈X right , Represents the sample set X on the left side of the target variable left The left-hand side average value calculated from the actual values corresponding to each target variable in , Represents the sample set N on the right side of the target variable right The right-hand side average value calculated from the actual values corresponding to each target variable in ; Based on the impurity measurement function, calculate the influencing feature f i Impurity G as a segmentation feature i (k) = G left +G right ; Among them, NUM(N s ) represents the target variable sample set N s The number of target variables contained in NUM(N left ) represents the sample set N on the left side of the target variable left The number of target variables contained in NUM(N right ) represents the sample set N on the right side of the target variable right The number of target variables included in , and 5. A deep learning prediction method based on a dynamic weighting mechanism according to claim 4, characterized in that: The step S4 comprises: Step S41: Based on the impurity, calculate the influence I of the kth feature observation value corresponding to the node k =w k ×G i (k)-w left ×G left -w right ×G right , where w k , w left , w right Respectively represent weight coefficients; Step S42: Calculate the importance of the influencing feature: Among them, IMP i Indicates the influencing feature f i The importance of imp i Indicates the influencing feature f i The error degree of m is the maximum code number that affects the feature.
6. A deep learning prediction method based on a dynamic weighting mechanism according to claim 5, characterized in that: The step S5 comprises: Calculate the impact feature f i Confidence of: Among them, Conf i Indicates the influencing feature f i The confidence level, is the exponential decay coefficient, w cor 、w imp and w τ Respectively represent weight coefficients; and, 7. A deep learning prediction method based on a dynamic weighting mechanism according to claim 6, characterized in that: The step S6 comprises: Step S61: Based on the mapping relationship database And mapping relationship, generate feature group, recorded as FG(c j )={f i |i∈[1,m]}; Step S62: Based on the feature group FG(c j ), calculate the feature group FG(c j )’s confidence level: in, Represents the feature group FG(c j ) confidence, Interact(C j ) represents the feature group FG(c j ) is the average value of the correlation coefficients between all feature pairs in the feature group FG(c ), α takes the value of 0 or 1. When α takes the value of 1, it means that the feature group FG(c j ) is the influence of the interaction between the feature pairs within the group. When α is 0, it means that the feature group FG(c j ) The impact of interactions between pairs of features within the and, Among them, ρ(f p , f q ) represents the influencing feature f p and the influence feature f q The Pearson correlation coefficient of the feature pair composed of j ) is the number of feature pairs formed between each influencing feature.
8. The deep learning prediction method based on a dynamic weighting mechanism according to claim 7, characterized in that: The step S7 comprises: Step S71: Randomly sample the source sample data set from the source sample database. The number of random sampling is Each time random sampling is performed, in the source sample data set S e Randomly select Influencing features, generate a subset of source sample data, denoted as SO e , and SO e ∈S e , then it constitutes the source sample data sub-library, denoted as R T×(u+1) = {SO e |e∈[1,N]}, and R T×(u+1) ∈R N ×(n+1) , and the source sample data sub-library R T×(u+1) , as the input sample database of the deep learning model; the source sample data subset SO e , divided into training set and test set according to the ratio of 6:4, and the training set is denoted as SO e train , and the test set is recorded as SO e test , and SO e train ≠SO e test , SO e train ∪SO e test =SO e ; Step S72: Execute step S61, based on the mapping relationship database And mapping relationship, generate training set feature group and test set feature group, and convert the training set SO e train The corresponding training set feature group is recorded as SO e train (c j ), the test set SO e test The corresponding test set feature group is recorded as SO e train (c j ).
9. A deep learning prediction method based on a dynamic weighting mechanism according to claim 8, characterized in that: The step S8 comprises: Step S81: Return to step S3 and perform the following operations based on the training set feature group S0 e train (c j ), calculate the training set feature group SO e train (c j ) The corresponding feature group confidence is recorded as Step S82: In the test set feature group S0 e train (c j ) arbitrarily select the tth influencing feature f t , get the influencing feature f t The kth characteristic observation value of Get the source sample data subset SO e The corresponding source sample dataset S e The target variable P target The kth target observation value of Calculate the source sample data subset SO e Medium impact feature f t In feature category c j The prediction weights for: The prediction weights are standardized so that in, represents the prediction weight, The normalized prediction weights Recorded as 10. A deep learning prediction method based on a dynamic weighting mechanism according to claim 9, characterized in that: The step S9 comprises: Based on the prediction weights, calculate the source sample data set S e The prediction results are: in, Represents the source sample dataset S e prediction results.
Citation Information
Patent Citations
Medium and long term electric quantity prediction method based on clustering analysis and deep learning
CN114626594A
CNN-LSTM-based central air conditioner demand response test method and system
CN117273077A
Decision-making method of comprehensive alumina production indexes based on multi-scale deep convolutional network
US20210192272A1
