A method, device, electronic device and storage medium for target prediction
By extracting and identifying the key features of multi-dimensional data in the tabular data and generating feature matrix for prediction, the problems of inaccurate prediction results and poor model adaptability in the prior art are solved, and more efficient and accurate target prediction is achieved.
Patent Information
- Application Number
- CN202411918381.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2044-12-25
AI Technical Summary
When the prior art processes tabular data of complex multi-dimensional feature combinations, the prediction results are not accurate enough, and the model is difficult to automatically identify key features, and the adaptability is poor.
By obtaining the original data, feature extraction in different dimensions is performed, key features of each dimension are determined, and feature matrix is generated based on these key features and original features to make target predictions.
Automatic feature selection is realized, the interference of noise and redundant features is reduced, prediction efficiency and accuracy is improved, different scenarios and tasks are adapted to, and the adaptability of the model is enhanced.
Smart Images

Figure CN119377890B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for target prediction. Background Art
[0002] In modern commercial and industrial environments, there are a large number of tabular data with time series characteristics and multidimensional environmental variables. How to make effective predictions in such data is an important technical issue. Existing technologies usually rely on linear regression models, empirical formulas or simple time series models, but these methods lack flexibility, especially when faced with complex multidimensional feature combinations, and cannot perform prediction tasks well, resulting in inaccurate prediction results. Summary of the invention
[0003] In view of this, embodiments of the present application provide a method, device, electronic device and storage medium for target prediction to solve the problem of inaccurate prediction results in the prior art.
[0004] According to a first aspect of an embodiment of the present application, a method for target prediction is provided, comprising: obtaining original data, performing feature extraction of different dimensions on the original data, and obtaining original features of different dimensions; determining key features of each dimension from the original features of each dimension, and determining a feature matrix based on the key features of each dimension and the original features of each dimension; performing target prediction according to the feature matrix, and obtaining a target prediction result.
[0005] According to a second aspect of an embodiment of the present application, a device for target prediction is provided, comprising: an acquisition module, configured to acquire original data, perform feature extraction of different dimensions on the original data, and obtain original features of different dimensions; a feature extraction module, configured to determine the key features of each dimension from the original features of each dimension, and determine a feature matrix based on the key features of each dimension and the original features of each dimension; and a prediction module, configured to perform target prediction according to the feature matrix to obtain a target prediction result.
[0006] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0007] According to a fourth aspect of an embodiment of the present application, a storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0008] Compared with the prior art, the embodiments of the present application have the following beneficial effects: by acquiring original data and performing feature extraction of different dimensions on the original data, original features of different dimensions are obtained; from the original features of each dimension, key features of each dimension are determined; and a feature matrix is generated based on the key features and original features of each dimension. In this way, not only can the model be focused on the most influential features to achieve dynamic feature extraction and reduce the interference of redundant features by extracting key features from the original features, but also accurate feature extraction can be performed on data of different dimensions to obtain key features corresponding to each dimension, and key features can be efficiently selected from complex data, thereby improving prediction efficiency and accuracy. Accurate prediction of the target can be achieved based on the feature matrix to obtain accurate target prediction results. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0010] Figure 1 It is a flowchart of a method for target prediction provided by an embodiment of the present application;
[0011] Figure 2 It is a flowchart of another target prediction method provided in an embodiment of the present application;
[0012] Figure 3 It is a flowchart of another target prediction method provided in an embodiment of the present application;
[0013] Figure 4 It is a flowchart of another target prediction method provided in an embodiment of the present application;
[0014] Figure 5 It is a structural schematic diagram of a target prediction device provided in an embodiment of the present application;
[0015] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0016] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0017] With the rapid development of big data and artificial intelligence technologies, the amount and complexity of data in various industries are increasing year by year. Tabular data, especially time series data and multidimensional environmental data, are widely used in scenarios such as energy consumption forecasting, sales forecasting, and rental price forecasting. However, when processing such data, traditional forecasting methods usually face the following problems:
[0018] 1. Simple models such as linear regression models cannot handle the complex combination of multi-dimensional features, resulting in low prediction accuracy.
[0019] Second, existing machine learning algorithms often require manual selection of features or simple regression-based models when performing feature selection, which makes it difficult to automatically and dynamically adjust according to data. Such methods cannot automatically identify key features and cannot effectively transfer existing knowledge in new scenarios, resulting in limited model prediction accuracy and adaptability.
[0020] 3. For different regions or scenarios (such as energy consumption forecasts or sales forecasts for newly opened stores or new regions), the model cannot effectively transfer existing knowledge and requires a large amount of data to be retrained, resulting in high costs.
[0021] It can be seen that the existing technology has the characteristics of cumbersome and inefficient feature selection process, difficulty in adapting to new scenarios, and limited ability to process complex data. Therefore, this application proposes a tabular data feature selection and transfer learning method based on a custom network structure, which can automatically select features and dynamically set weights, and then learn common laws from basic models across the country, and quickly migrate to new scenarios, reducing the training data requirements for new scenarios and improving the accuracy and efficiency of predictions. This method has adaptive learning capabilities, can automatically adjust feature selection and weights, significantly improve prediction accuracy, and greatly reduce model training time in new scenarios. It should be understood that this solution can be applied to data scenarios with time series and multi-dimensional environmental variables such as shopping mall energy consumption, apartment rents, financial fields (such as risk prediction), and transportation fields (such as bus passenger flow prediction).
[0022] A method and device for target prediction according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0023] Figure 1 is a flow chart of a method for target prediction provided by an embodiment of the present application. Figure 1As shown, the target prediction method includes:
[0024] S101, obtaining original data, performing feature extraction of different dimensions on the original data, and obtaining original features of different dimensions.
[0025] Specifically, the raw data used for target prediction can be obtained. The raw data can be understood as tabular data of multiple dimensions collected from the historical data of the prediction task scenario. For example, in the prediction of real estate targets (such as sales volume, energy consumption, rent), the raw data may include time series data (such as date, hour), environmental data (such as temperature, humidity, carbon dioxide concentration, etc.) and other related features (such as store opening and closing hours, holidays, etc.).
[0026] Furthermore, feature extraction can be performed on the original data to obtain original features of different dimensions. These feature dimensions can be numerical (such as continuous values such as temperature and price) or categorical (such as discrete categories such as region and brand type).
[0027] S102, determining the key features of each dimension from the original features of each dimension, and determining a feature matrix based on the key features of each dimension and the original features of each dimension.
[0028] Specifically, after obtaining the original features of each dimension, the key features can be determined from the original features of each dimension. The key features can be understood as the features that have the greatest influence on the target prediction task, or the features that contribute the most to the prediction task. For example, in the heavy sales prediction task, factors such as weather temperature, promotional activities, and advertising expenditures may have a greater impact on sales. Therefore, the data of these dimensions can be extracted as key features. After determining the key features, these key features can be combined with the original features to form a feature matrix containing all important features, and then target prediction can be performed based on the feature matrix.
[0029] In this way, key features can be automatically identified and screened from multi-dimensional large-scale data sets, allowing the model to focus on important features and avoid interference from noise and irrelevant features. This also eliminates the need for manual feature selection, thus avoiding the subjectivity and bias of manual feature selection. Through dynamic feature selection and weighting based on the characteristics of the current scenario, the model can flexibly adjust key features according to different scenarios and tasks, thereby enhancing the adaptability of the model in practical applications and significantly improving the accuracy of target prediction results.
[0030] S103, performing target prediction according to the feature matrix to obtain a target prediction result.
[0031] According to the technical solution provided by the above embodiment, by performing feature extraction of different dimensions on the original data, the original features of different dimensions are obtained, the key features of each dimension are determined from the original features of each dimension, and the feature matrix is determined based on the key features of each dimension and the original features of each dimension. Finally, target prediction is performed based on the feature matrix to obtain the target prediction result. In this way, the complex steps of manual selection and processing of features can be replaced by automated feature selection, and feature extraction of various multi-dimensional complex data structures can be adapted, thereby improving the reasoning ability and efficiency of the model and enabling efficient and accurate target prediction.
[0032] In some embodiments, the key features of each dimension are determined from the original features of each dimension, including: linearly transforming the original features of each dimension to obtain the first features of each dimension, performing nonlinear processing on the first features of each dimension to obtain the second features corresponding to each dimension; determining the selective weight of the second features of each dimension, and obtaining the first weight features of each dimension based on the second features of each dimension and the selective weights of the corresponding second features; adding the first weight features of each dimension and the corresponding original features to obtain the added results corresponding to each dimension, and normalizing the added results corresponding to each dimension to obtain the key features of each dimension.
[0033] Figure 2 This is a flow chart of another target prediction method provided by an embodiment of the present application. Figure 2 This embodiment is described.
[0034] Specifically, after extracting the original features from the original data, the original features can be adaptively weighted, that is, different features can be weighted, filtered and selected to obtain more effective feature representation. The original features can be adaptively weighted through a custom selective residual network (i.e. Selective Residual Net), which can include a gating mechanism, that is, the original features can be selectively transferred through the gating mechanism. Such a feature transfer method can not only enhance the model's ability to model the nonlinear relationship of features, but also ensure that feature information is not lost through residual connections. It should be noted that the processing of the original features can be performed separately, that is, the original features of each dimension can be processed separately to obtain the key features corresponding to each dimension.
[0035] First, in each dimension, a linear transformation can be performed on the original features through a fully connected layer (Dense), and the original features can be mapped to a new feature space to obtain the first feature, which is further processed using a nonlinear activation function (such as the ReLU activation function) to obtain the second feature. This can introduce nonlinear factors, allowing the model to capture more complex data patterns and relationships.
[0036] The second feature can then be processed through a gating mechanism to obtain a selective weight of the second feature.
[0037] It should be noted that before generating the selective weight of the second feature, a random inactivation layer can be added to the model structure, that is, the second feature is processed by the fully connected layer again and randomly inactivated after the fully connected layer to increase the generalization ability of the model.
[0038] Furthermore, the gating mechanism can be reflected in that the second feature is processed by a fully connected layer to obtain the processed second feature, and an activation function (such as a Sigmoid activation function) is connected after the fully connected layer to generate weights for the processed second feature to obtain the selective weight of the second feature. In the process of generating the selective weight, the attention mechanism can be used to automatically evaluate the importance of each feature in the target prediction task. Features with higher weights will receive greater attention, and then the selective weight of the second feature is multiplied element-by-element with the second feature processed by another fully connected layer to obtain the first weight feature.
[0039] Furthermore, after obtaining the first weight feature, the first weight feature corresponding to the dimension can be fused with the corresponding original feature of the input. Before the fusion, the corresponding original feature can be processed by a fully connected layer, and the processed original feature is added to the first weight feature to obtain the addition result. The addition result is further normalized to obtain the key feature of the corresponding dimension. Through the above steps, feature extraction of the original features of each dimension can be achieved to obtain the key features of each dimension.
[0040] According to the technical solution provided in the above embodiment, the key features of each dimension are adaptively determined from the original features of each dimension through a selective residual network, so that the model can automatically extract the most critical features from the original features, reduce manual intervention, and dynamically generate selective weights based on the attention mechanism in combination with the current scene requirements. In this way, the model can automatically adjust the contribution of features in different environments. Through weighted and normalized operations, the model can also better handle features of different scales and dimensions, avoiding imbalance problems caused by scale differences during training, and improving the stability and robustness of the model.
[0041] In some embodiments, based on the key features of each dimension and the original features of each dimension, a feature matrix is determined, including: processing the original features of each dimension through a fully connected layer to obtain output features corresponding to each dimension; performing dimension splicing on the output features corresponding to all dimensions to obtain spliced features corresponding to all dimensions; adaptively weighting the spliced features to obtain second weighted features; and fusing the second weighted features with the key features of each dimension to obtain a feature matrix.
[0042] Figure 3 : is a flow chart of another target prediction method provided by the embodiment of the present application. Figure 3 This embodiment is described.
[0043] Figure 3 It can represent the customized dynamic feature selector (i.e. DynamicFeatureSelector) in the model. Each dynamic feature selector contains a selective residual network. The dynamic feature selector can be used to realize dynamic selection of features and merge the key features of each dimension with the original features to obtain a feature matrix. It should be understood that the selective residual network is used to process the original features of each dimension. Therefore, the number of selective residual networks in the dynamic feature selector can be determined based on the number of dimensions of the input original features. Of course, the same selective residual network can also process the original features of different dimensions in turn. In this case, there is only one layer of selective residual network, which is not limited here.
[0044] Specifically, first, the original input features can be segmented to obtain original features of different dimensions, namely feature 1, feature 2...feature N. While the original features of each dimension are processed by the selective residual network to obtain the key features, the fully connected layer can be used to process the original features of each dimension separately to obtain the output features corresponding to each dimension of the fully connected layer output, and then the output features corresponding to all dimensions can be spliced to obtain spliced features containing all dimensions. In this way, multiple feature vectors can be merged into a feature vector of a higher dimension, which represents the comprehensive information of all dimensions.
[0045] Furthermore, the splicing features are adaptively weighted using a selective residual network. In the adaptive weighting process, a weight mechanism (such as a probability distribution Softmax activation function) can be introduced to assign an importance weight to each part of the splicing feature, thereby obtaining a second weight feature, which contains the weight feature of each dimension.
[0046] Furthermore, by fusing the second weight feature with the key feature of each dimension, a feature matrix can be obtained.
[0047] According to the technical solution provided in the above embodiment, by gradually processing the original features of each dimension, the model's ability to capture information in each dimension is gradually enhanced, thereby achieving efficient processing of features. Through adaptive weighting and feature fusion, the model can flexibly adjust the importance of features and extract the most effective prediction information from the original features of different dimensions. It also combines the original features of all dimensions to ensure that information is not lost during the feature processing process, so that the model can effectively fuse information and improve prediction accuracy when processing complex and heterogeneous data.
[0048] In other embodiments, the second weight feature is fused with the key feature of each dimension to obtain a feature matrix, including: dimensionally stacking the key features of all dimensions to obtain stacked features corresponding to all dimensions; and element-by-element multiplying the stacked features with the second weight feature to obtain a feature matrix.
[0049] Specifically, the second weight feature is fused with the key feature of each dimension, which can be obtained by element-by-element multiplication of the features.
[0050] Specifically, the key features of each dimension can be stacked dimension by dimension to form a high-dimensional feature vector, that is, the key features of all dimensions are connected in series to form a merged feature set. There is no restriction on the feature stacking method here.
[0051] Furthermore, the stacked features and the second weight features are multiplied element by element. This step can be understood as weighting the stacked features again through the second weight features to obtain a feature matrix, so that the feature matrix can capture the key information of each dimension.
[0052] According to the technical solution provided in the above embodiment, by stacking the key features of each dimension, a stacked feature containing the key information of all dimensions is obtained, and the stacked feature is multiplied element by element with the second weight feature, which further ensures that each element in the feature matrix is affected by the corresponding weight, so that the model can generate a more representative feature matrix by weighting the features of different dimensions, and then the model can accurately predict the target according to the actual contribution of each dimension.
[0053] In some embodiments, the original data includes discrete data and continuous data, and features of different dimensions are extracted from the original data to obtain original features of different dimensions, including: mapping discrete data of different dimensions through an embedding layer to obtain continuous high-dimensional numerical feature representations corresponding to different dimensions; applying feature scaling to continuous data of different dimensions to obtain scaled continuous features corresponding to different dimensions; and concatenating the continuous high-dimensional numerical feature representation of each dimension and the corresponding scaled continuous features to obtain original features of different dimensions.
[0054] Specifically, when making target predictions, the raw data obtained from historical data aggregation may contain discrete data and continuous data. Corresponding processing methods can be selected for different data types to convert complex data into features that can be used by the model.
[0055] Discrete data can be understood as non-numerical, categorical data, such as text, classification labels, etc. Discrete data can be transformed through the embedding layer to obtain high-dimensional numerical feature representation. The embedding layer can map each discrete category (such as label, vocabulary, number, etc.) into a low-dimensional vector space to generate a dense representation of the category.
[0056] Continuous data can represent numerical data, such as temperature, price, age, etc. The threshold of continuous data may be very wide. Therefore, in order to make these data suitable for the neural network model, they can be feature scaled so that they can be processed within the same scale range, that is, the value range of the feature is adjusted to [0,1], or the feature value is adjusted to a distribution with a mean of 0 and a standard deviation of 1. This ensures that each feature has equal collinearity with the model during training, avoiding features with too large a numerical range dominating the model training process.
[0057] Furthermore, by concatenating the continuous high-dimensional numerical feature representation and the scaled continuous features, we can obtain the corresponding feature information, that is, the original features of different dimensions, and then use the original features as the input of the model for target prediction.
[0058] According to the technical solution provided in the above embodiment, different types of features can be automatically processed through embedding layers and feature scaling without the need for manual feature design, thereby improving the training efficiency, reasoning efficiency and prediction accuracy of the model.
[0059] Figure 4 This is a flow chart of another target prediction method provided in the embodiment of the present application. Figure 4 The present application scheme is further described.
[0060] First, before generating continuous high-dimensional numerical feature representations and scaled continuous features, the original data can also be subjected to window sliding processing and feature differentiation to generate subsequent features, moving average features, etc., to enhance the model's understanding of the time series of the data and obtain the features of the prediction model input. The discrete features and continuous features contained in the input features are then processed separately, that is, the discrete features are mapped to obtain continuous high-dimensional numerical features, the continuous features are scaled to obtain continuous features, and the continuous high-dimensional numerical features and the scaled continuous features are concatenated to obtain original features of different dimensions.
[0061] Furthermore, the original features of different dimensions are input into the dynamic feature selector for adaptive dynamic weighted processing to obtain the feature matrix. In this process, multiple processing can be performed through multiple layers of dynamic feature selectors. When building the model, the number of neurons (i.e., units) of different dynamic feature selectors can be set specifically, such as setting the first layer to 128, the second layer to 96, and the third layer to 64. In this way, features of different dimensions can be output through dynamic feature selectors of different layers, and key features can be gradually extracted and screened. A random dropout layer is set in each layer of dynamic feature selector to randomly discard some nodes to avoid overfitting of the model (such as dropout of the first layer: 0.75, dropout of the second layer: 0.5, and dropout of the third layer: 0.25), so as to enhance the robustness of the model and obtain an accurate feature matrix.
[0062] The feature matrix is then input into the fully connected layer of the transfer learning fine-tuning network for processing, and the final feature representation is further integrated and generated. A linear activation function (such as Linear) is used to maintain the continuity of the output, and the fully connected layer is further used to output a scalar (units: 1) as the target prediction result.
[0063] In this way, dynamic selection and weighting can be performed through the above-mentioned custom network structure, which can automatically assign weights to the input features according to the feature importance of the data, and selectively filter the feature information to ensure that important features are retained, thereby improving the prediction accuracy and generalization ability of the model.
[0064] In some embodiments, before obtaining the original data, it also includes: obtaining first training data containing data from different scenarios; capturing the common rules of prediction tasks in different scenarios through the first training data, and obtaining a prediction model based on the common rules, the prediction model includes an embedding layer and a dynamic feature selector, the dynamic feature selector is used to determine the key features of each dimension from the original features of each dimension, and determine the feature matrix based on the key features of each dimension and the original features of each dimension; obtaining second training data corresponding to the target scenario, using the second training data to fine-tune the prediction model to obtain a fine-tuned prediction model, the fine-tuned prediction model is used to perform the target prediction task, and the target scenario represents the scenario for performing the target prediction task.
[0065] Specifically, a prediction model with a custom structure can be constructed, and it can be trained with the first training data containing data from different scenarios to obtain a prediction model with common prediction rules. The common rules can represent some consistent patterns that still exist in the target prediction task in different scenarios, although the environment and conditions are different. For example, in different user groups, the rules of certain purchasing behaviors may be similar. Finally, the relevant data of the target prediction task in the current target scenario is used as the second training data to fine-tune the prediction model to adapt it to the specific prediction task, and a fine-tuned model is obtained, wherein the second training data can represent data collected in a specific scenario, which can be historical data or artificially constructed data. In this way, a smaller amount of new data can be used on the basis of the prediction model to further train the model to adapt to new scenarios and needs. The model structure is not described here.
[0066] In this way, by training and fine-tuning the model, a fine-tuned prediction model that can better adapt to specific target prediction tasks can be obtained. That is, by learning common rules in multiple scenarios, the model can have better generalization ability when facing new scenarios, and by using transfer learning and fine-tuning methods, the demand for new data for model fine-tuning is reduced, and the prediction effect of the model in specific scenarios is quickly achieved.
[0067] In some embodiments, the prediction model also includes a transfer learning fine-tuning network layer, which uses the second training data to fine-tune the prediction model to obtain a fine-tuned prediction model, including: dividing the second training data into a training set and a validation set; training the transfer learning fine-tuning network layer through the training set; evaluating the prediction accuracy of the trained prediction model based on the validation set and pre-selected evaluation indicators, the evaluation indicators including the root mean square error and the mean absolute percentage error; when the prediction accuracy meets the preset accuracy, the fine-tuned prediction model is obtained.
[0068] Specifically, the model can be fine-tuned by fine-tuning the network layers through transfer learning in the prediction model so that the model can adapt to specific target prediction tasks.
[0069] First, the second training data can be divided into a training set and a validation set. The split ratio is not limited here. The training set is used to train the transfer learning fine-tuning network layer, that is, the prediction model with common prediction rules is applied to a specific scenario, and the second training data is used to adapt it to the new task. In this way, the parameters in the network can be adjusted through the training set to improve the prediction accuracy of the new target prediction task. In the process of transfer learning, most of the network structure of the prediction model can be frozen, and only the transfer learning fine-tuning network layer is unfrozen to adjust the parameters. After the training is completed, it can be verified through the validation set to determine whether the preset accuracy requirements are met. When evaluating, appropriate evaluation indicators can be selected to measure the prediction accuracy of the model, such as root mean square error: used to measure the error between the predicted value and the actual value, and mean absolute percentage error: used to measure the percentage error between the predicted value and the actual value. The smaller the error, the closer the prediction result is to the true value.
[0070] When the prediction accuracy of the model reaches the preset accuracy, that is, when the above error reaches the preset error value, the model fine-tuning process is considered to be completed, and the fine-tuned prediction model is obtained. There is no limit on the preset accuracy here, and it can be set according to actual conditions.
[0071] In this way, through fine-tuning, the model can be made more adaptable to specific target prediction tasks, thereby improving the accuracy of the prediction. Through transfer learning and automatic fine-tuning, the model can automatically achieve efficient knowledge transfer based on a small amount of data in the new scenario, reduce the demand for training data in the new scenario, achieve efficient optimization of the model, reduce manual intervention, and improve the efficiency of model training.
[0072] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.
[0073] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0074] Figure 5 Schematic diagram of a target prediction device provided in an embodiment of the present application. Figure 5 As shown, the target prediction device includes:
[0075] The acquisition module 501 is configured to acquire original data, extract features of different dimensions from the original data, and obtain original features of different dimensions;
[0076] The feature extraction module 502 is configured to determine the key features of each dimension from the original features of each dimension, and determine a feature matrix based on the key features of each dimension and the original features of each dimension;
[0077] The prediction module 503 is configured to perform target prediction according to the feature matrix to obtain a target prediction result.
[0078] In some embodiments, the feature extraction module 502 is specifically used to perform linear transformation on the original features of each dimension to obtain the first features of each dimension, perform nonlinear processing on the first features of each dimension to obtain the second features corresponding to each dimension; determine the selective weight of the second features of each dimension, and obtain the first weighted features of each dimension based on the second features of each dimension and the selective weights of the corresponding second features; add the first weighted features of each dimension and the corresponding original features to obtain the added results corresponding to each dimension, and normalize the added results corresponding to each dimension to obtain the key features of each dimension.
[0079] In some embodiments, the feature extraction module 502 is specifically used to process the original features of each dimension through a fully connected layer to obtain the output features corresponding to each dimension; perform dimension splicing on the output features corresponding to all dimensions to obtain the spliced features corresponding to all dimensions; perform adaptive weighting on the spliced features to obtain a second weighted feature; and fuse the second weighted feature with the key features of each dimension to obtain a feature matrix.
[0080] In some embodiments, the feature extraction module 502 is specifically used to perform dimension stacking on key features of all dimensions to obtain stacked features corresponding to all dimensions; and perform element-by-element multiplication of the stacked features with the second weight features to obtain a feature matrix.
[0081] In some embodiments, the acquisition module 501 is specifically used to map discrete data of different dimensions through an embedding layer to obtain continuous high-dimensional numerical feature representations corresponding to different dimensions; apply feature scaling to continuous data of different dimensions to obtain scaled continuous features corresponding to different dimensions; and concatenate the continuous high-dimensional numerical feature representation of each dimension and the corresponding scaled continuous features to obtain original features of different dimensions.
[0082] In some embodiments, the acquisition module 501 is specifically used to acquire first training data containing different scenario data; through the first training data, the common laws of prediction tasks in different scenarios are captured, and based on the common laws, a prediction model is obtained, the prediction model includes an embedding layer and a dynamic feature selector, the dynamic feature selector is used to determine the key features of each dimension from the original features of each dimension, and determine the feature matrix based on the key features of each dimension and the original features of each dimension; obtain second training data corresponding to the target scenario, use the second training data to fine-tune the prediction model, and obtain a fine-tuned prediction model, the fine-tuned prediction model is used to perform the target prediction task, and the target scenario represents the scenario for performing the target prediction task.
[0083] In some embodiments, the acquisition module 501 is specifically used to divide the second training data into a training set and a validation set; train the transfer learning fine-tuning network layer through the training set; evaluate the prediction accuracy of the trained prediction model according to the validation set and pre-selected evaluation indicators, and the evaluation indicators include the root mean square error and the mean absolute percentage error; when the prediction accuracy meets the preset accuracy, the fine-tuned prediction model is obtained.
[0084] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0085] Figure 6 Schematic diagram of an electronic device 6 provided in an embodiment of the present application. Figure 6 As shown, the electronic device 6 of this embodiment includes: a processor 601, a memory 602, and a computer program 603 stored in the memory 602 and executable on the processor 601. When the processor 601 executes the computer program 603, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 601 executes the computer program 603, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0086] The electronic device 6 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 6 may include, but is not limited to, a processor 601 and a memory 602. Those skilled in the art will appreciate that Figure 6 The electronic device 6 is merely an example and does not limit the electronic device 6 . The electronic device 6 may include more or less components than those shown in the figure, or different components.
[0087] The processor 601 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0088] The memory 602 may be an internal storage unit of the electronic device 6, for example, a hard disk or memory of the electronic device 6. The memory 602 may also be an external storage device of the electronic device 6, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 6. The memory 602 may also include both an internal storage unit and an external storage device of the electronic device 6. The memory 602 is used to store computer programs and other programs and data required by the electronic device.
[0089] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0090] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form. The computer readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer readable medium does not include electric carrier signals and telecommunication signals.
[0091] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for target prediction, characterized in that: include: Obtaining original data, the original data includes discrete data and continuous data; mapping the discrete data of different dimensions through an embedding layer to obtain continuous high-dimensional numerical feature representations corresponding to different dimensions; applying feature scaling to the continuous data of different dimensions to obtain scaled continuous features corresponding to different dimensions; splicing the continuous high-dimensional numerical feature representation of each dimension and the corresponding scaled continuous features to obtain original features of different dimensions; the original data is tabular data of multiple dimensions collected from historical data of the prediction task scenario, including at least time series data and environmental data; Determine a key feature of each dimension from the original features of each dimension, and determine a feature matrix based on the key feature of each dimension and the original features of each dimension; A target prediction is performed according to the characteristic matrix to obtain a target prediction result, where the target prediction result is an energy consumption prediction result.
2. The method according to claim 1, characterized in that: Determining the key features of each dimension from the original features of each dimension includes: Performing linear transformation on the original features of each dimension respectively to obtain a first feature of each dimension, and performing nonlinear processing on the first features of each dimension to obtain a second feature corresponding to each dimension; Determine the selective weight of the second feature of each dimension, and obtain the first weight feature of each dimension according to the second feature of each dimension and the corresponding selective weight of the second feature; The first weighted feature and the corresponding original feature of each dimension are added to obtain the addition result corresponding to each dimension, and the addition result corresponding to each dimension is normalized to obtain the key feature of each dimension.
3. The method according to claim 2, characterized in that The determining of a feature matrix based on the key features of each dimension and the original features of each dimension includes: The original features of each dimension are processed by a fully connected layer to obtain output features corresponding to each dimension; Perform dimension splicing on the output features corresponding to all dimensions to obtain splicing features corresponding to all dimensions; Adaptively weighting the splicing features to obtain a second weighted feature; The second weight feature is fused with the key feature of each dimension to obtain the feature matrix.
4. The method according to claim 3, characterized in that: The step of fusing the second weight feature with the key feature of each dimension to obtain the feature matrix includes: Dimensionally stacking the key features of all dimensions to obtain stacked features corresponding to all dimensions; The stacked feature and the second weight feature are multiplied element by element to obtain the feature matrix.
5. The method according to claim 3, characterized in that: Before obtaining the original data, the method further includes: Acquire first training data including different scene data; By using the first training data, common laws of prediction tasks in different scenarios are captured, and based on the common laws, a prediction model is obtained, wherein the prediction model includes the embedding layer and a dynamic feature selector, and the dynamic feature selector is used to determine the key features of each dimension from the original features of each dimension, and determine a feature matrix based on the key features of each dimension and the original features of each dimension; Acquire second training data corresponding to the target scene, use the second training data to fine-tune the prediction model to obtain the fine-tuned prediction model, the fine-tuned prediction model is used to perform the target prediction task, and the target scene represents the scene for performing the target prediction task.
6. The method according to claim 5, characterized in that The prediction model further includes a transfer learning fine-tuning network layer, and the prediction model is fine-tuned using the second training data to obtain the fine-tuned prediction model, including: Splitting the second training data into a training set and a validation set; Training the transfer learning fine-tuning network layer using the training set; Evaluate the prediction accuracy of the trained prediction model according to the validation set and pre-selected evaluation indicators, wherein the evaluation indicators include root mean square error and mean absolute percentage error; When the prediction accuracy meets the preset accuracy, the fine-tuned prediction model is obtained.
7. A device for target prediction, characterized in that: include: The acquisition module is configured to acquire original data, wherein the original data includes discrete data and continuous data; the discrete data of different dimensions are mapped by an embedding layer to obtain continuous high-dimensional numerical feature representations corresponding to different dimensions; feature scaling is applied to the continuous data of different dimensions to obtain scaled continuous features corresponding to different dimensions; the continuous high-dimensional numerical feature representation of each dimension and the corresponding scaled continuous features are concatenated to obtain original features of different dimensions; the original data is tabular data of multiple dimensions collected from historical data of the prediction task scenario, including at least time series data and environmental data; A feature extraction module is configured to determine a key feature of each dimension from the original features of each dimension, and determine a feature matrix based on the key feature of each dimension and the original features of each dimension; The prediction module is configured to perform target prediction according to the feature matrix to obtain a target prediction result, where the target prediction result is an energy consumption prediction result.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
General prediction method considering wind and light output
CN117350554A