Data prediction method and device based on data prediction model, equipment, medium and product
Patent Information
- Application Number
- CN202611105167.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-23
- Publication Date
- 2026-10-23
AI Technical Summary
但是,在参考数据对象与目标数据对象之间必然存在属性差异(例如物理规格、环境条件等)的情况下,直接聚合参考数据对象的参考值会导致预测结果偏差较大,预测准确度不足
Smart Images

Figure CN122964471A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to a data prediction method based on a data prediction model, a training method for the data prediction model, an electronic device, an electronic device, a computer-readable storage medium, and a computer program product. Background Technology
[0002] With the rapid development of artificial intelligence and big data technologies, data prediction technology has been widely applied in various numerical analysis and trend forecasting scenarios. Traditional data prediction methods typically rely on statistical regression models or basic machine learning algorithms to predict the target value of new data by fitting the overall distribution pattern of historical data. Among related technologies, attention-based prediction schemes introduce similar data associated with the target data object as a reference, that is, they use the attention mechanism to calculate the weighted sum of the corresponding reference values of the reference data object. However, when there are inevitably attribute differences between the reference data object and the target data object (such as physical specifications, environmental conditions, etc.), directly aggregating the reference values of the reference data object will lead to a large deviation in the prediction results and insufficient prediction accuracy.
[0003] The methods described in this section are not necessarily methods that had been previously conceived or adopted. Unless otherwise specified, no method described in this section should be assumed to be prior art simply because it is included in this section. Similarly, unless otherwise specified, the issues mentioned in this section should not be considered to be accepted in any prior art. Summary of the Invention
[0004] According to one aspect of this disclosure, a data prediction method based on a data prediction model is provided. The data prediction model includes a value adjustment network and an attention weight network. The method includes: acquiring attribute features of a target data object, attribute features of multiple reference data objects, and reference values of the multiple reference data objects for the target dimension to be predicted. The attribute features include attribute values of one or more attribute dimensions, and the attribute features of the multiple reference data objects satisfy a similarity condition with the attribute features of the target data object; inputting the attribute features of the target data object and the attribute features of the multiple reference data objects into the attention weight network and the value adjustment network, respectively, to obtain an adjustment factor for the reference values of the multiple reference data objects output by the value adjustment network and attention weights for the multiple reference data objects output by the attention weight network; adjusting the reference values of the multiple reference data objects based on the adjustment factor to obtain corrected values for the multiple reference data objects; and weighting and aggregating the corrected values of the multiple reference data objects based on the attention weights of the multiple reference data objects to obtain a predicted value of the target data object for the target dimension.
[0005] According to one aspect of this disclosure, a training method for a data prediction model is provided, wherein the data prediction model includes a value adjustment network and an attention weight network. The method includes: acquiring attribute features of a sample data object and labeled values of the sample data object for a target dimension to be predicted, attribute features of multiple sample reference objects and reference values of the multiple sample reference objects for the target dimension, wherein the attribute features include attribute values of one or more attribute dimensions, and the attribute features of the multiple sample reference objects satisfy a similarity condition with the attribute features of the sample data object; inputting the attribute features of the sample data object and the attribute features of the multiple sample reference objects into the attention weight network and the value adjustment network respectively, to obtain an adjustment factor for the reference values of the multiple sample reference objects output by the value adjustment network and attention weights for the multiple sample reference objects output by the attention weight network; adjusting the reference values of the multiple sample reference objects based on the adjustment factor to obtain corrected values for the multiple sample reference objects; weighted aggregation of the corrected values of the multiple sample reference objects based on the attention weights of the multiple sample reference objects to obtain a predicted value of the sample data object for the target dimension; calculating a first loss value based on the labeled values and the predicted values; and adjusting the parameters of the data prediction model based on the first loss value.
[0006] According to one aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and at least one memory having a computer program stored thereon, wherein the computer program, when executed by the at least one processor, causes the at least one processor to perform the method described above.
[0007] According to one aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, causes the processor to perform the above-described method.
[0008] These and other aspects of this disclosure will be apparent from the embodiments described below, and will be elucidated with reference to the embodiments described below. Attached Figure Description
[0009] The accompanying drawings exemplify embodiments and form part of the specification, serving together with the textual description to explain exemplary implementations of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals refer to similar but not necessarily identical elements. Further details, features, and advantages of this disclosure are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which: Figure 1 This is a schematic diagram illustrating an example system in which various methods described herein may be implemented according to exemplary embodiments.
[0010] Figure 2This is an exemplary flowchart illustrating a data prediction method based on a data prediction model according to some exemplary embodiments.
[0011] Figure 3A This is a schematic block diagram illustrating the structure of a data prediction model according to some exemplary embodiments.
[0012] Figure 3B This is a schematic block diagram illustrating the structure of a data prediction model according to some exemplary embodiments.
[0013] Figure 4 This is an exemplary flowchart illustrating a training method for a data prediction model according to some exemplary embodiments.
[0014] Figure 5 This is a block diagram illustrating an exemplary computer device that can be applied to an exemplary embodiment. Detailed Implementation
[0015] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0016] In this disclosure, unless otherwise stated, the use of terms such as "first," "second," etc., to describe various elements is not intended to limit the positional, temporal, or importance relationships of these elements; such terms are merely used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of that element, while in other cases, based on the context, they may refer to different instances.
[0017] The terminology used in the description of the various examples in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context expressly indicates otherwise, an element may be one or more unless the number of elements is specifically limited. As used herein, the term "multiple" means two or more, and the term "based on" should be interpreted as "at least partially based on". Furthermore, the terms "and / or" and "at least one of..." cover any one of the listed items and all possible combinations thereof.
[0018] The collection, storage, use, processing, transmission, provision, and disclosure of user information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0019] Exemplary embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0020] Figure 1 This is a schematic diagram illustrating an example system 100 in which various methods described herein may be implemented according to exemplary embodiments.
[0021] refer to Figure 1 The system 100 includes a client device 110, a server 120, and a network 130 that communicatively couples the client device 110 and the server 120.
[0022] Client device 110 includes a display 114 and a client application (APP) 112 that can be displayed on the display 114. Client application 112 can be an application that needs to be downloaded and installed before running, or a lightweight application (liteapp). If client application 112 is an application that needs to be downloaded and installed before running, client application 112 can be pre-installed on client device 110 and activated. If client application 112 is a mini-app, user 102 can directly run client application 112 on client device 110 by searching for client application 112 in the host application (e.g., by the name of client application 112) or by scanning the graphic code of client application 112 (e.g., barcode, QR code, etc.), without installing client application 112. In some embodiments, client device 110 can be any type of mobile computing device, including mobile computers, mobile phones, wearable computing devices (e.g., smartwatches, head-mounted devices including smart glasses, etc.), or other types of mobile devices. In some embodiments, the client device 110 may alternatively be a fixed computer device, such as a desktop computer, server computer, or other type of fixed computer device.
[0023] Server 120 is typically a server deployed by an Internet Service Provider (ISP) or Internet Content Provider (ICP). Server 120 can represent a single server, a cluster of multiple servers, a distributed system, or a cloud server providing basic cloud services such as cloud databases, cloud computing, cloud storage, and cloud communications. It will be understood that, although... Figure 1 The diagram shows that server 120 communicates with only one client device 110, but server 120 can provide background services to multiple client devices simultaneously.
[0024] Examples of network 130 include combinations of local area networks (LANs), wide area networks (WANs), personal area networks (PANs), and / or communication networks such as the Internet. Network 130 can be wired or wireless. In some embodiments, technologies and / or formats including Hypertext Markup Language (HTML), Extensible Markup Language (XML), etc., are used to process data exchanged through network 130. Furthermore, encryption technologies such as Secure Sockets Layer (SSL), Transport Layer Security (TLS), VPN, and Internet Protocol Security (IPsec) can be used to encrypt all or some of the links. In some embodiments, custom and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.
[0025] For the purposes of this disclosure's embodiments, Figure 1 In the example, client application 112 can be an application for data prediction that can predict target data objects according to user requirements. Correspondingly, server 120 can be a server used in conjunction with the application for data prediction. Server 120 can run a data prediction model, specifically a data prediction model trained using data prediction model training methods, and provide data prediction and other services to client application 112 running on client device 110. Alternatively, data prediction and other services can also be provided by client application 112 running on client device 110.
[0026] With the rapid development of artificial intelligence and big data technologies, data prediction technology has been widely applied in various numerical analysis and trend forecasting scenarios. Traditional data prediction methods typically rely on statistical regression models or basic machine learning algorithms to predict the target value of new data by fitting the overall distribution pattern of historical data. Among related technologies, attention-based prediction schemes introduce similar data associated with the target data object as a reference, that is, they use the attention mechanism to calculate the weighted sum of the corresponding reference values of the reference data object. However, when there are inevitably attribute differences between the reference data object and the target data object (such as physical specifications, environmental conditions, etc.), directly aggregating the reference values of the reference data object will lead to a large deviation in the prediction results and insufficient prediction accuracy.
[0027] Based on this, this disclosure provides a data prediction method based on a data prediction model. In the data prediction model, a value adjustment network is constructed to correct the reference value of the reference data object. While determining the attention weight for the reference data object, the adjustment factor for the reference value is predicted based on the attribute differences between the target data object and the reference data object. By correcting the reference value, the prediction bias caused by the mismatch between the attributes of the reference data object and the target data object is compensated, thereby improving the accuracy of data prediction.
[0028] Figure 2 This is an exemplary flowchart illustrating a data prediction method 200 based on a data prediction model according to some exemplary embodiments. In some embodiments, the data prediction model includes a value adjustment network and an attention weight network, such as... Figure 2 As shown, method 200 includes: Step S201: Obtain the attribute features of the target data object, the attribute features of multiple reference data objects, and the reference values of multiple reference data objects for the target dimension to be predicted. The attribute features include the attribute values of one or more attribute dimensions, and the attribute features of multiple reference data objects and the attribute features of the target data object satisfy the similarity condition. Step S202: Input the attribute features of the target data object and the attribute features of multiple reference data objects into the attention weight network and the value adjustment network respectively, so as to obtain the adjustment factor of the reference value for multiple reference data objects output by the value adjustment network and the attention weight of multiple reference data objects output by the attention weight network. Step S203: Adjust the reference values of multiple reference data objects based on the adjustment factor to obtain the corrected values of the multiple reference data objects; and Step S204: Based on the attention weights of multiple reference data objects, perform weighted aggregation of the correction values of multiple reference data objects to obtain the predicted value of the target data object for the target dimension.
[0029] The aforementioned data prediction method 200 introduces a reference value correction mechanism based on attribute differences. For the calculation method of "weighting based on the corresponding reference values of reference data objects," a parallel value adjustment network and an attention weight network are set up, effectively decoupling "reference value correction" from "weight allocation of reference data objects" into two independent tasks. Specifically, the value adjustment network learns the impact of attribute differences of data objects on the values of the target dimension to be predicted, obtaining an adjustment factor for the reference values. This factor can then compensate for prediction bias caused by attribute mismatch between the reference and target data objects. The attention weight network evaluates the matching degree and credibility between the reference and target data objects. This structure achieves explicit modeling of the mapping relationship between "attribute differences of data objects - value differences of data objects in the target dimension." By simultaneously optimizing the data foundation of both "weights" and "values" before the weighted aggregation step, more accurate aggregation prediction results can be obtained, improving the accuracy of data prediction.
[0030] In the embodiments of this disclosure, the target data object refers to an entity or event for which specific indicators need to be predicted, while the attribute features are multidimensional state information describing the entity or event. One or more attribute dimensions correspond to specific fields of the multidimensional state information, and the attribute value of each attribute dimension corresponds to a specific numerical value or category under the field. The target dimension to be predicted corresponds to the prediction indicator that needs to be obtained using the data prediction model. The above method 200 can be applied to various specific application scenarios to predict various types of data indicators.
[0031] In one example, when method 200 is applied to a scenario of weather forecasting, the target data object can be the weather conditions of a city at a future moment. The attributes include multi-dimensional current observation data, such as current temperature, humidity, air pressure, and wind direction. The target dimension could be, for example, the probability of rainfall. In this case, the reference data object can be the historical weather conditions of the city, meaning that known historical weather information is used as a reference to predict future weather information.
[0032] In one example, when method 200 is applied to a scenario of predicting traffic flow information, the target data object can be the traffic conditions of a specific road segment at a specific time. Attributes and features could include, for example, the number of lanes, weather conditions, whether it is a holiday, and the density of the surrounding road network. The target dimension could be, for example, a congestion index or traffic flow information. In this case, the reference data object could be the historical traffic flow information of other road segments.
[0033] In some embodiments, method 200 can be applied to the field of asset valuation. For example, when the target data object is a property to be valued, its attribute characteristics may include multiple dimensions such as building area, floor level, year of construction, floor height, building orientation, decoration status, usable floor area ratio, whether there is an elevator, and number of rooms, living rooms, and bathrooms. The target dimension to be predicted may be, for example, the estimated transaction price or rental price of the property, or the ratio of the predicted transaction price of the property to the transaction price of its surrounding business district. The reference value of the reference data object may be the actual transaction price of a property that has already been sold or a manually labeled property valuation dataset. As another example, when the target data object is a vehicle for sale, its attribute characteristics may include brand and model, mileage, registration date, whether there is an accident record, and interior wear and tear. The target dimension to be predicted may be, for example, the estimated transaction price of the vehicle. The reference value of the reference data object may be the actual transaction price of a vehicle that has already been sold or a manually labeled vehicle valuation dataset. As mentioned above, the data prediction method 200 explicitly models the mapping relationship between "the attribute differences of data objects and the value differences of data objects in the target dimension". By applying this method in specific application areas of data prediction or evaluation, the value adjustment network can be used to learn the degree of quantitative influence of the attribute feature differences of data objects on the target dimension value of data objects. Then, the adjustment factor output by the value adjustment network can be used to compensate for the prediction bias caused by the mismatch between the attributes of the reference data object and the target data object, so as to improve the accuracy of data prediction.
[0034] In some examples, the similarity between the attribute features of a target data object and the attribute features of multiple initial data objects can be determined in various ways. For instance, attribute features can be encoded as high-dimensional vectors, and the Euclidean distance or cosine similarity between the corresponding attribute feature vectors of the target data object and the corresponding attribute feature vectors of the initial data objects can be calculated. The similarity of attribute features is characterized by measuring the distance or directional divergence of attribute feature vectors in the vector space. As another example, when attribute features include discrete categorical features, the similarity of attribute features can also be calculated based on the Jaccard similarity coefficient or numerical distance.
[0035] In some examples, similarity criteria may include a similarity threshold, which can be a pre-set static threshold or a threshold dynamically determined during the selection of reference data objects.
[0036] According to some embodiments, the multiple reference data objects in step S201 are determined as follows: based on the similarity between the attribute features of the target data object and the attribute features of multiple initial data objects, and the similarity condition, the multiple reference data objects are determined from the multiple initial data objects, wherein the number of the multiple reference data objects does not exceed a quantity threshold. By pre-selecting reference data objects based on the similarity of attribute features, noisy data with attributes that differ too much from the target data object and lack reference value can be effectively filtered out. This avoids abnormal samples from interfering with the prediction model, and at the same time, it can effectively reduce the computational load and inference latency of subsequent model inference steps, thereby improving both prediction accuracy and efficiency.
[0037] In some examples, the step of selecting a certain number of reference data objects based on the similarity between the attribute features of the target data object and the attribute features of multiple initial data objects can be implemented in various ways. For example, multiple initial objects can be sorted based on the similarity calculation results, and then the multiple reference data objects with the highest similarity can be determined based on the preset number of reference data objects and the sorting results. Another example is that initial data objects with a similarity not lower than a fixed similarity threshold can be selected as reference data objects. In one example, multiple initial data objects can also be clustered based on similarity, and then reference data objects can be selected based on the clustering results; for example, data objects belonging to the same cluster as the target object and near its center can be selected.
[0038] In some examples, multiple initial data objects can be retrieved from a pre-built data object repository. In practical applications, to ensure data quality, the retrieved information from the data object repository can be cleaned and filtered first. For example, initial data objects with missing key fields can be removed, or initial data objects with attribute values that deviate too much from the target data object can be filtered out, in order to determine the reference data object more efficiently and accurately.
[0039] In step S202, in order to enable the data prediction model to handle heterogeneous input data, the attribute features of the data objects can be encoded first. For example, continuous numerical attribute values can be normalized or standardized, and discrete categorical attribute values can be mapped into dense vectors of fixed dimensions through an embedding layer. The encoded results are then input into the value adjustment network and the attention weight network.
[0040] In some examples, the value adjustment network can be a neural network of various structural types, such as a multilayer perceptron. The attention weight network is built on an attention mechanism. It receives input information representing the attribute features of the target data object and reference data objects. After a nonlinear transformation, it outputs normalized attention weight values through a Softmax or Sigmoid activation function to characterize the importance of each reference data object in predicting the target data object. The larger the attention weight, the more similar or valuable the reference object is to the target object, and the higher its contribution to the final result aggregation.
[0041] In some examples, the attribute feature vectors of the target data object and the reference data object can be concatenated and then input into the value adjustment network. The value adjustment network implicitly learns the interaction relationship and difference features between the two, thereby obtaining the adjustment factor for the reference value of the reference data object.
[0042] According to some embodiments, the value adjustment network includes a difference numerator network and an adjustment sub-network. The difference numerator network outputs the differences between the attribute features of the target data object and the attribute features of multiple reference data objects. The adjustment sub-network outputs an adjustment factor for the reference values of the multiple reference data objects based on the differences. By setting up a cascaded difference numerator network and adjustment sub-network in the value adjustment network, explicit modeling of attribute feature differences can be achieved. This design allows the difference numerator network to first perform difference calculations on the attribute features, so that the subsequent adjustment sub-network can directly determine the adjustment factor based on the difference results (rather than the absolute values of the attribute features). Compared to the method of predicting directly based on the absolute values of attribute features, this design can avoid fitting difficulties caused by excessively large differences in the distribution of attribute absolute values, thus improving prediction accuracy.
[0043] According to some embodiments, the attention weight network and the value adjustment network share a difference numerator network. The attention weight network is used to determine the attention weights of multiple reference data objects based on the differences output by the difference numerator network. It should be understood that when the semantics of attribute features are relatively simple (e.g., only including simple discrete classification features), difference information can more easily and accurately characterize the attribute differences between different data objects (e.g., the area difference between different properties). Calculating attention weights based on the difference calculation results of attribute features allows the attention weight network to focus more directly on the physical attribute differences between different data objects, making the allocation of attention weights more consistent with the physical intuition of "closer distance, greater weight," thereby improving prediction accuracy. Simultaneously, by having the attention weight network and the value adjustment network share a preceding difference network, redundant calculations can be avoided, reducing the number of model parameters and computational load, thus improving data prediction efficiency.
[0044] In some examples, attention weight networks can also determine the attention weights of each reference data object based on other mechanisms. For example, they can determine the similarity between the target data object and the reference data object by performing a dot product calculation based on the attribute features (corresponding to the query vector in the attention mechanism) and the data features (corresponding to the key vector in the attention mechanism), and then determine the attention weights of each reference data object based on this.
[0045] In some examples, data prediction models can be trained under supervised supervision using labeled samples.
[0046] In some examples, the aforementioned encoding process also includes encoding the reference values of the reference data object into a reference value vector. Accordingly, the adjustment factor output by the value adjustment network is an adjustment vector with the same dimension as the reference value vector. In one example, the correction operation for the reference value in step S203 can be based on addition, where the adjustment vector represents the bias value, and the reference value vector is obtained by adding the reference value vector and the adjustment vector. In another example, the correction operation for the reference value can also be based on multiplication, where the adjustment vector represents the scaling factor, and the correction value vector is obtained by multiplying the adjustment vector and the reference value vector element-wise.
[0047] In some examples, the weighted aggregation operation in step S204 can be implemented using a weighted summation method. This involves multiplying the modified value vector of each reference data object obtained in step S203 by the attention weight of the corresponding reference object obtained in step S202, and then summing all the weighted vectors to obtain the fused feature vector. Based on this, a decoder or fully connected layer can be used to map this fused vector back to the numerical space of the target dimension to obtain the predicted value of the target data object for the target dimension.
[0048] According to some embodiments, method 200 further includes: determining the confidence level of the predicted value based on the differences between the attribute features of the target data object and the attribute features of multiple reference data objects. This allows for the assessment of the reliability of the prediction result while outputting the predicted value, providing more comprehensive data prediction information in practical application scenarios.
[0049] In practical applications, a prediction interval can be determined based on the predicted value of the target data object for the target dimension obtained using a data prediction model, and the confidence level of the predicted value. In some embodiments, the width of the prediction interval is negatively correlated with the confidence level, thereby providing a narrow interval with high precision and accuracy when the confidence level of the model prediction is high, and a wider interval when the confidence level of the model prediction is low.
[0050] In some embodiments, to achieve confidence level output, the data prediction model may further include a confidence prediction network, which can be trained under supervised conditions using labeled samples. By inputting the attribute features of the target data object and the attribute features of multiple reference data objects, or the differences between the two, into the confidence prediction network, the model can evaluate the reliability of data prediction based on the reference data objects based on the deviation of the reference data objects from the target data objects. In one example, when the data prediction model includes the aforementioned difference numerator network, the confidence prediction network can further reuse the differences between the attribute features of the target data object and the attribute features of the reference data objects output by the difference numerator network to reduce the computational load of the model and improve prediction efficiency.
[0051] According to some embodiments, determining the confidence level of a predicted value based on the differences between the attribute characteristics of the target data object and the attribute characteristics of multiple reference data objects includes: determining the confidence level of the predicted value based on the differences between the attribute characteristics of the target data object and the attribute characteristics of multiple reference data objects, and the number of multiple reference data objects. Therefore, the quantity information of reference data objects can be incorporated into the calculation of the confidence level to more accurately assess the randomness risk of data prediction based on reference data objects, thereby more accurately assessing the confidence level of the predicted value.
[0052] According to some embodiments, determining the confidence level of a predicted value based on the differences between the attribute features of the target data object and the attribute features of multiple reference data objects includes: weighted aggregation of the differences between the attribute features of the target data object and the attribute features of multiple reference data objects based on the attention weights of the multiple reference data objects to obtain a difference aggregation result; and determining the confidence level of the predicted value based on the difference aggregation result. This enables efficient reuse of attention weights. By using attention weights to weighted aggregate the difference features to characterize the overall dispersion of the reference sample set, if the reference data object to which the model assigns high attention weights is itself significantly different from the target data object (i.e., effective samples are missing, and the model is forced to rely on samples with large differences for prediction), the aggregated difference feature value will be larger, corresponding to a lower confidence level. By combining the attention weights and attribute feature difference information of multiple reference data objects, the prediction uncertainty caused by the quality of reference samples can be assessed more accurately, improving the accuracy of confidence assessment.
[0053] Figure 3A This is a schematic block diagram illustrating the structure of a data prediction model according to some exemplary embodiments. See also Figure 3AThe data prediction model 310 includes a difference network 311, an attention weight network 312, an adjustment network 313, a confidence prediction network 314, a correction calculation module 315, and a weighted aggregation module 316. In this example, the difference network 311, as a shared pre-existing difference feature extraction component, is configured to receive the encoded attribute feature vectors of the target data object and the encoded attribute feature vectors of each reference data object, and output a difference feature vector representing the difference between the two. The corresponding difference feature vectors of the multiple reference data objects are distributed to the attention weight network 312, the adjustment network 313, and the confidence prediction network 314.
[0054] Attention weight network 312 calculates attention weights for each reference data object based on the difference feature vectors, used to measure the importance of each reference data object relative to the target data object. Adjustment network 313 generates adjustment factors (e.g., adjustment vectors with the same dimension as the reference value vectors) for each reference data object based on the difference feature vectors. Correction calculation module 315 then uses these adjustment factors to correct the reference value vectors of each reference data object to eliminate value bias caused by attribute differences, obtaining corrected value vectors for each reference data object. Based on this, weighted aggregation module 316 receives the attention weights from attention weight network 312 and the corrected values from correction calculation module 315, and performs weighted aggregation on the corrected value vectors of multiple reference data objects based on the attention weights of multiple reference data objects, thereby obtaining the corresponding predicted value for the target data object. Confidence prediction network 314 outputs the confidence of the prediction result based on the respective difference feature vectors of multiple reference data objects.
[0055] Figure 3B This is a schematic block diagram illustrating the structure of a data prediction model according to some exemplary embodiments. For example... Figure 3B As shown, the data prediction model 320 includes a difference network 321, an attention layer 322, an output layer 323, an adjustment network 324, a correction calculation module 325, a weighted calculation module 326, a weighted calculation module 327, and a confidence prediction network 328.
[0056] In this example, the encoded attribute feature vectors of the target data object and the encoded attribute feature vectors of multiple reference data objects are first input into the difference network 321 to obtain the respective difference feature vectors of the multiple reference data objects. In this step, the difference network can use the following calculation method to obtain the difference feature vectors: Delta_i = Q - K_i (where Q is the encoded attribute feature vector of the target data object, K_i is the encoded attribute feature vector of the i-th reference data object, and Delta_i is the corresponding difference feature vector of the i-th reference data object) In one processing branch of the model, the respective differential feature vectors of multiple reference data objects are fed into the attention layer 322. The attention layer 322 outputs the score information of each reference data object based on Delta_i, and then passes through the output layer 323 (for example, it can be an output layer based on the Softmax function) to obtain the attention weight W_i of each reference data object.
[0057] In another processing branch of the model, the respective differential feature vectors of multiple reference data objects are fed into the adjustment network 324. The adjustment network 324 outputs an adjustment vector V_i for each reference data object based on Delta_i, where each element of V_i represents a correction coefficient to the original reference value vector of the reference data object. The correction calculation module 325 performs element-wise multiplication of the adjustment vector V_i for each reference data object with the original reference value vector of that reference data object to obtain the correction value vector V-updated_i for each reference data object.
[0058] Based on this, the weighted calculation module 326 performs weighted aggregation of the correction value vectors of multiple reference data objects based on the attention weights of multiple reference data objects, and obtains the corresponding predicted value of the target data object.
[0059] In another processing branch of the model, another weighted calculation module 327 performs weighted aggregation based on the respective difference feature vectors of multiple reference data objects and the attention weights of multiple reference data objects, thereby generating aggregated difference features that reflect the overall matching degree of the reference sample set. The confidence prediction network 328 outputs the confidence of the prediction result based on the aggregated difference features output by the weighted calculation module 327 and the input information on the number of reference data objects.
[0060] According to one aspect of this disclosure, a method for training a data prediction model is also provided. Figure 4 This is an exemplary flowchart illustrating a training method 400 for a data prediction model according to some exemplary embodiments. In some embodiments, the data prediction model includes a value adjustment network and an attention weight network, such as... Figure 4 As shown, method 400 includes: Step S401: Obtain the attribute features of the sample data object and the labeled values of the sample data object for the target dimension to be predicted, the attribute features of multiple sample reference objects and the reference values of multiple sample reference objects for the target dimension, wherein the attribute features include the attribute values of one or more attribute dimensions, and the attribute features of multiple sample reference objects and the attribute features of the sample data object satisfy the similarity condition. Step S402: Input the attribute features of the sample data object and the attribute features of multiple sample reference objects into the attention weight network and the value adjustment network respectively, so as to obtain the adjustment factor of the reference value for multiple sample reference objects output by the value adjustment network and the attention weight of multiple sample reference objects output by the attention weight network. Step S403: Adjust the reference values of multiple sample reference objects based on the adjustment factor to obtain the corrected values of multiple sample reference objects; Step S404: Based on the attention weights of multiple sample reference objects, perform weighted aggregation of the correction values of multiple sample reference objects to obtain the predicted value of the sample data object for the target dimension; Step S405: Calculate the first loss value based on the labeled value and the predicted value; and Step S406: Adjust the parameters of the data prediction model based on the first loss value.
[0061] The aforementioned data prediction model introduces a reference value correction mechanism based on attribute differences. For the calculation method of "weighting based on the corresponding reference values of reference data objects," a parallel value adjustment network and an attention weight network are set up, effectively decoupling "reference value correction" from "weight allocation of reference data objects" into two independent tasks. The value adjustment network learns the impact of attribute differences of data objects on the values of the target dimension to be predicted, obtaining an adjustment factor for the reference values. This factor can then compensate for prediction bias caused by attribute mismatch between the reference and target data objects. The attention weight network evaluates the matching degree and credibility between the reference and target data objects. This structure achieves explicit modeling of the mapping relationship between "attribute differences of data objects - value differences of data objects in the target dimension." It simultaneously optimizes the data foundation of both "weights" and "values" before the weighted aggregation step, resulting in more accurate aggregated prediction results. By training this data prediction model using labeled samples, the accuracy of data prediction using this model can be improved.
[0062] In some examples, the first loss value can be determined based on the regression loss calculation method. For example, mean squared error can be used to measure the difference between the model's predicted output and the sample labeled value.
[0063] According to some embodiments, the data prediction model further includes a confidence prediction network. Method 400 further includes: using the confidence prediction network to determine the confidence level of the predicted value based on the difference between the attribute features of the sample data object and the attribute features of multiple sample reference objects; and calculating a second loss value based on the difference between the labeled value and the predicted value and the confidence level. Step S406, adjusting the parameters of the data prediction model based on the first loss value, includes adjusting the parameters of the data prediction model based on the first loss value and the second loss value. Therefore, the reliability of the prediction result can be evaluated while outputting the predicted value, providing more comprehensive data prediction information in practical application scenarios. By using the first loss value and the second loss value to jointly tune the parameters of the data prediction model, the model can be optimized around the two objectives of "accuracy of data prediction" and "accuracy of confidence assessment," thereby improving the prediction performance of the data prediction model. Simultaneously, by calculating the second loss value based on the difference between the labeled value and the predicted value and the confidence level, self-supervised training can be achieved for the optimization objective of "accuracy of confidence assessment," improving the efficiency and accuracy of model optimization.
[0064] In some examples, self-supervised labels for confidence levels can be generated based on the difference between the labeled and predicted values. For instance, binary self-supervised labels can be generated based on the relative error between the model's predicted and labeled values. When the relative error of the regression prediction exceeds an error threshold (e.g., 3%), the self-supervised label for confidence is set to 0; otherwise, it is set to 1. In other examples, a second loss value can be determined based on the classification loss calculation method. For example, binary cross-entropy can be used to measure the difference between the model's confidence prediction and the dynamically generated self-supervised labels.
[0065] According to some embodiments, the training process of the data prediction model includes performing multiple training rounds using multiple batches of sample data objects. Adjusting the parameters of the data prediction model based on a first loss value and a second loss value includes: in response to determining that there is at least one historical training round that has been executed, determining the weights of the first loss value and the second loss value based on the calculation results of the first loss value and the second loss value in the at least one historical training round; performing a weighted calculation on the first loss value and the second loss value based on their respective weights; and adjusting the parameters of the data prediction model based on the weighted calculation result.
[0066] Since the first loss value (e.g., regression task loss) and the second loss value (e.g., confidence classification loss) may be based on different physical units or calculation formulas, their absolute values may differ significantly. By applying the above implementation method, a dynamic weight adjustment strategy based on the loss values of historical training epochs can be used to balance the impact of the first and second loss values on model parameter tuning by dynamically adjusting the weights, avoiding gradient dominance, thereby improving prediction accuracy and confidence assessment capabilities, and enhancing the overall performance of the model.
[0067] In some examples, determining the weights of the first and second loss values is based on balancing the magnitudes of the two loss values across historical training epochs. To prevent a larger loss value from dominating the gradient descent direction, the data prediction model performs an inverse proportional allocation of the first and second historical loss values generated in at least one previous training epoch (e.g., the previous epoch) before executing the current training epoch. For example, the sum of the first and second historical loss values can be calculated, and the proportion of the second historical loss value in the sum can be determined as the weight of the first loss value in the current epoch, and the proportion of the first historical loss value in the sum can be determined as the weight of the second loss value in the current epoch. Alternatively, the weights can be determined by calculating the reciprocals of the two and normalizing them, so that the weighted first and second loss terms are of the same order of magnitude. This ensures that the model can balance the optimization needs of both tasks during backpropagation and avoids training bias caused by differences in the magnitudes of the loss values.
[0068] According to one aspect of this disclosure, an electronic device is provided, including components for performing any of the above-described method embodiments.
[0069] In some embodiments, an electronic device is used to perform the method 200 described above. The electronic device includes: a first acquisition module, used to acquire attribute features of a target data object, attribute features of multiple reference data objects, and reference values of the multiple reference data objects for a target dimension to be predicted, wherein the attribute features include attribute values of one or more attribute dimensions, and the attribute features of the multiple reference data objects satisfy a similarity condition with the attribute features of the target data object; a first input module, used to input the attribute features of the target data object and the attribute features of the multiple reference data objects into an attention weight network and a value adjustment network, respectively, to obtain an adjustment factor for the reference values of the multiple reference data objects output by the value adjustment network and an attention weight for the multiple reference data objects output by the attention weight network; a first adjustment module, used to adjust the reference values of the multiple reference data objects based on the adjustment factor to obtain corrected values of the multiple reference data objects; and a first aggregation module, used to perform weighted aggregation of the corrected values of the multiple reference data objects based on the attention weights of the multiple reference data objects to obtain a predicted value of the target data object for the target dimension.
[0070] In some embodiments, an electronic device is used to perform the method 400 described above. The electronic device includes: a second acquisition module, used to acquire attribute features of a sample data object and labeled values of the sample data object for a target dimension to be predicted, attribute features of multiple sample reference objects and reference values of the multiple sample reference objects for the target dimension, wherein the attribute features include attribute values of one or more attribute dimensions, and the attribute features of the multiple sample reference objects satisfy a similarity condition with the attribute features of the sample data object; a second input module, used to input the attribute features of the sample data object and the attribute features of the multiple sample reference objects into an attention weight network and a value adjustment network, respectively, to obtain an adjustment factor for the reference values of the multiple sample reference objects output by the value adjustment network and an attention weight for the multiple sample reference objects output by the attention weight network; a second adjustment module, used to adjust the reference values of the multiple sample reference objects based on the adjustment factor to obtain corrected values of the multiple sample reference objects; a second aggregation module, used to perform weighted aggregation of the corrected values of the multiple sample reference objects based on the attention weights of the multiple sample reference objects to obtain a predicted value of the sample data object for the target dimension; a calculation module, used to calculate a first loss value based on the labeled values and the predicted values; and a third adjustment module, used to adjust the parameters of the data prediction model based on the first loss value.
[0071] The various modules of the aforementioned electronic device can be used with reference to Figure 2 Method 200 or reference described Figure 4 The steps in method 400 described correspond to each other. Therefore, the operations, features, and advantages described above for method 200 or method 400 are equally applicable to the aforementioned electronic device and its included modules. For the sake of brevity, some operations, features, and advantages will not be repeated here.
[0072] While specific functions have been discussed above with reference to specific modules, it should be noted that the functions of the modules discussed herein can be divided into multiple modules, and / or at least some functions of multiple modules can be combined into a single module. The specific module performing an action discussed herein includes the specific module itself performing the action, or alternatively, the specific module calling or otherwise accessing another component or module that performs the action (or performs the action in conjunction with the specific module). Therefore, a specific module performing an action can include the specific module performing the action itself and / or another module that the specific module calls or otherwise accesses to perform the action. For example, the first adjustment module and the first aggregation module can be combined into a single module in some embodiments. As used herein, the phrase "entity A initiates action B" can mean that entity A issues an instruction to perform action B, but entity A itself does not necessarily perform action B.
[0073] It should also be understood that this article can describe various technologies in the general context of software and hardware components or program modules. The above regarding... Figure 4 The various modules described can be implemented in hardware or in hardware in combination with software and / or firmware. For example, these modules can be implemented as computer program code / instructions configured to execute in one or more processors and stored in a computer-readable storage medium. Alternatively, these modules can be implemented as hardware logic / circuit. For example, in some embodiments, one or more of the modules included in the above-described electronic device can be implemented together in a System on Chip (SoC). The SoC may include an integrated circuit chip (which includes a processor (e.g., a Central Processing Unit (CPU), microcontroller, microprocessor, digital signal processor (DSP), etc.), memory, one or more communication interfaces, and / or one or more other components in other circuitry), and may optionally execute received program code and / or include embedded firmware to perform functions.
[0074] According to some embodiments, an electronic device is provided, comprising at least one processor and at least one memory having a computer program stored thereon, which, when executed by the at least one processor, causes the at least one processor to perform the steps of any of the method embodiments described above.
[0075] According to some embodiments, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, causes the processor to perform the steps of any of the method embodiments described above.
[0076] According to some embodiments, a computer program product is provided, which includes a computer program that, when executed by a processor, causes the processor to perform the steps of any of the method embodiments described above.
[0077] In the following text, combined with Figure 5 Illustrative examples describing such electronic devices and non-transitory computer-readable storage media.
[0078] Figure 5 An example configuration of a computer device 500 that can be used to implement the methods described herein is shown. For example, Figure 1 The server 120 and / or client device 110 shown may include an architecture similar to computer device 500. The aforementioned apparatus 400 may also be implemented wholly or at least partially by computer device 500 or similar devices or systems.
[0079] Computer device 500 can be a variety of different types of devices. Examples of computer device 500 include, but are not limited to: desktop computers, server computers, laptop or netbook computers, mobile devices (e.g., tablets, cellular or other wireless phones (e.g., smartphones), notebook computers, mobile stations), wearable devices (e.g., glasses, watches), entertainment devices (e.g., entertainment appliances, set-top boxes communicatively coupled to a display device, game consoles), televisions or other display devices, automotive computers, and so on.
[0080] Computer device 500 may include at least one processor 502, memory 504, multiple communication interfaces 506, display device 508, other input / output (I / O) devices 510, and one or more mass storage devices 512 capable of communicating with each other, such as via system bus 514 or other suitable connections.
[0081] Processor 502 may be a single processing unit or multiple processing units, and all processing units may include single or multiple computing units or multiple cores. Processor 502 may be implemented as one or more microprocessors, microcomputers, microcontrollers, digital signal processors, central processing units, state machines, logic circuits, and / or any device that manipulates signals based on operating instructions. Among other capabilities, processor 502 may be configured to acquire and execute computer-readable instructions stored in memory 504, mass storage device 512, or other computer-readable media, such as program code of operating system 516, program code of application program 518, program code of other program 520, etc.
[0082] Memory 504 and mass storage device 512 are examples of computer-readable storage media for storing instructions executed by processor 502 to perform the various functions described above. For example, memory 504 may generally include both volatile and non-volatile memory (e.g., RAM, ROM, etc.). Furthermore, mass storage device 512 may generally include hard disk drives, solid-state drives, removable media, including external and removable drives, memory cards, flash memory, floppy disks, optical disks (e.g., CDs, DVDs), storage arrays, network-attached storage, storage area networks, etc. Both memory 504 and mass storage device 512 may be collectively referred to herein as memory or computer-readable storage media, and may be non-transitory media capable of storing computer-readable, processor-executable program instructions as computer program code, which may be executed by processor 502 as a specific machine configured to perform the operations and functions described in the examples herein.
[0083] Multiple programs may be stored on mass storage device 512. These programs include operating system 516, one or more applications 518, other programs 520, and program data 522, and they may be loaded into memory 504 for execution. Examples of such applications or program modules may include, for example, computer program logic (e.g., computer program code or instructions) for implementing components / functions such as client application 112, method 200 (including any suitable steps of method 200), and / or other embodiments described herein.
[0084] Although Figure 5 The modules 516, 518, 520, and 522, or portions thereof, are illustrated as being stored in memory 504 of computer device 500; however, modules 516, 518, 520, and 522 may be implemented using any form of computer-readable medium accessible by computer device 500. As used herein, “computer-readable medium” includes at least two types of computer-readable media: computer-readable storage media and communication media.
[0085] Computer-readable storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer-readable storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, DVD, or other optical storage devices, magnetic cassettes, magnetic tapes, disk storage devices or other magnetic storage devices, or any other non-transmission medium that can be used to store information for access by a computer device. In contrast, communication media can embody computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms. Computer-readable storage media as defined herein do not include communication media.
[0086] One or more communication interfaces 506 are used for exchanging data with other devices, such as via a network, direct connection, etc. Such communication interfaces can be one or more of the following: any type of network interface (e.g., a network interface card (NIC)), wired or wireless (such as IEEE 802.11 Wireless LAN (WLAN)) wireless interface, Wi-MAX interface, Ethernet interface, Universal Serial Bus (USB) interface, cellular network interface, Bluetooth™ interface, Near Field Communication (NFC) interface, etc. Communication interface 506 can facilitate communication across a variety of network and protocol types, including wired networks (e.g., LAN, cable, etc.) and wireless networks (e.g., WLAN, cellular, satellite, etc.), the Internet, etc. Communication interface 506 can also provide communication with external storage devices (not shown), such as storage arrays, network-attached storage, storage area networks, etc.
[0087] In some examples, a display device 508, such as a monitor, may be included for displaying information and images to the user. Other I / O devices 510 may be devices that receive various inputs from the user and provide various outputs to the user, and may include touch input devices, gesture input devices, cameras, keyboards, remote controls, mice, printers, audio input / output devices, and so on.
[0088] The technologies described herein can be supported by these various configurations of computer device 500, and are not limited to specific examples of the technologies described herein. For example, the functionality can also be implemented wholly or partially on a “cloud” using a distributed system. A cloud includes and / or represents a platform for resources. The platform abstracts the underlying functionality of the cloud’s hardware (e.g., servers) and software resources. Resources may include applications and / or data that can be used when performing computational processing on servers remote from computer device 500. Resources may also include services provided via the Internet and / or via subscriber networks such as cellular or Wi-Fi networks. The platform can abstract resources and functionality to connect computer device 500 to other computer devices. Therefore, the implementation of the functionality described herein can be distributed throughout the cloud. For example, the functionality can be implemented partly on computer device 500 and partly through a platform that abstracts the functionality of the cloud.
[0089] Although this disclosure has been described and illustrated in detail in the accompanying drawings and the foregoing description, such description and illustration should be considered illustrative and suggestive, not restrictive; this disclosure is not limited to the disclosed embodiments. By studying the drawings, the disclosure, and the appended claims, those skilled in the art will be able to understand and implement variations of the disclosed embodiments in practice with respect to the claimed subject matter. In the claims, the word "comprising" does not exclude other elements or steps not listed, the indefinite article "a" or "an" does not exclude a plurality, the term "a plurality" means two or more, and the term "based on" should be interpreted as "at least partially based on". The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be beneficial.
Claims
1. A data prediction method based on a data prediction model, wherein, The data prediction model includes a value adjustment network and an attention weight network, and the method includes: Obtain the attribute features of the target data object, the attribute features of multiple reference data objects, and the reference values of the multiple reference data objects for the target dimension to be predicted, wherein the attribute features include attribute values of one or more attribute dimensions, and the attribute features of the multiple reference data objects and the attribute features of the target data object satisfy a similarity condition; The attribute features of the target data object and the attribute features of the multiple reference data objects are respectively input into the attention weight network and the value adjustment network to obtain the adjustment factor of the reference value for the multiple reference data objects output by the value adjustment network and the attention weight of the multiple reference data objects output by the attention weight network. The reference values of the plurality of reference data objects are adjusted based on the adjustment factor to obtain the corrected values of the plurality of reference data objects; and The correction values of the multiple reference data objects are weighted and aggregated based on their attention weights to obtain the predicted value of the target data object for the target dimension.
2. The method according to claim 1, wherein, The value adjustment network includes a difference numerator network and an adjustment sub-network. The difference numerator network is used to output the difference between the attribute features of the target data object and the attribute features of the plurality of reference data objects. The adjustment sub-network is used to output an adjustment factor for the reference value of the plurality of reference data objects based on the difference.
3. The method according to claim 2, wherein, The attention weight network and the value adjustment network share the difference numerator network, and the attention weight network is used to determine the attention weights of the plurality of reference data objects based on the differences output by the difference numerator network.
4. The method according to claim 1, wherein, The plurality of reference data objects are determined in the following manner: Based on the similarity between the attribute features of the target data object and the attribute features of multiple initial data objects, and the similarity condition, multiple reference data objects are determined from the multiple initial data objects, wherein the number of the multiple reference data objects does not exceed a quantity threshold.
5. The method according to any one of claims 1-4, further comprising: The confidence level of the predicted value is determined based on the differences between the attribute features of the target data object and the attribute features of the multiple reference data objects.
6. The method according to claim 5, wherein, The step of determining the confidence level of the predicted value based on the difference between the attribute features of the target data object and the attribute features of the multiple reference data objects includes: The confidence level of the predicted value is determined based on the differences between the attribute features of the target data object and the attribute features of the plurality of reference data objects, and the number of the plurality of reference data objects.
7. The method according to claim 5, wherein, The step of determining the confidence level of the predicted value based on the difference between the attribute features of the target data object and the attribute features of the multiple reference data objects includes: Based on the attention weights of the multiple reference data objects, the differences between the attribute features of the target data object and the attribute features of the multiple reference data objects are weighted and aggregated to obtain the difference aggregation result; and Based on the difference aggregation results, the confidence level of the predicted value is determined.
8. A training method for a data prediction model, wherein, The data prediction model includes a value adjustment network and an attention weight network, and the method includes: The method involves obtaining the attribute features of a sample data object and the labeled values of the sample data object for the target dimension to be predicted, the attribute features of multiple sample reference objects and the reference values of the multiple sample reference objects for the target dimension, wherein the attribute features include attribute values of one or more attribute dimensions, and the attribute features of the multiple sample reference objects and the attribute features of the sample data object satisfy a similarity condition. The attribute features of the sample data object and the attribute features of the multiple sample reference objects are respectively input into the attention weight network and the value adjustment network to obtain the adjustment factor of the reference value for the multiple sample reference objects output by the value adjustment network and the attention weight of the multiple sample reference objects output by the attention weight network. The reference values of the plurality of sample reference objects are adjusted based on the adjustment factor to obtain the corrected values of the plurality of sample reference objects; The correction values of the multiple sample reference objects are weighted and aggregated based on their attention weights to obtain the predicted value of the sample data object for the target dimension. Calculate a first loss value based on the labeled value and the predicted value; and The parameters of the data prediction model are adjusted based on the first loss value.
9. The method according to claim 8, wherein, The data prediction model further includes a confidence prediction network, and the method further includes: The confidence prediction network uses the differences between the attribute features of the sample data object and the attribute features of the multiple sample reference objects to determine the confidence level of the predicted value; and Based on the difference between the labeled value and the predicted value, and the confidence level, a second loss value is calculated. The adjustment of the parameters of the data prediction model based on the first loss value includes: The parameters of the data prediction model are adjusted based on the first loss value and the second loss value.
10. The method according to claim 9, wherein, The training process of the data prediction model includes performing multiple training rounds using multiple batches of sample data objects, and adjusting the parameters of the data prediction model based on the first loss value and the second loss value includes: In response to determining that there is at least one historical training round that has been executed, the weights of the first loss value and the second loss value are determined based on the calculation results of the first loss value and the second loss value in the at least one historical training round; Based on the respective weights of the first loss value and the second loss value, a weighted calculation is performed on the first loss value and the second loss value; and The parameters of the data prediction model are adjusted based on the weighted calculation results.
11. An electronic device, comprising: At least one processor; as well as At least one memory on which a computer program is stored, When the computer program is executed by the at least one processor, it causes the at least one processor to perform the method according to any one of claims 1 to 10.
12. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, causes the processor to perform the method of any one of claims 1 to 10.