Model training method, data processing method and related devices
By obtaining sample feature vectors and using virtual variables to indicate missing feature values, training multiple target models and performing weighted summation processing, the overfitting problem in the pipeline estimation of new objects with small data volumes is solved, and the estimation effect and resource utilization efficiency are improved.
Patent Information
- Application Number
- CN202410530966.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-28
- Publication Date
- 2025-10-28
AI Technical Summary
Existing technologies are prone to overfitting in the pipeline estimation of new objects with small data volumes, resulting in poor estimation results and excessive reliance on training samples.
By obtaining sample feature vectors, using dummy variables to indicate missing feature values, training multiple target models, and combining weighted summation to process estimated values, the dependence on training samples is reduced and the model generalization ability is improved.
It effectively avoids overfitting, improves the pipeline estimation effect of new objects with small data volume, reduces dependence on training samples, expands pipeline estimation scenarios, and improves resource utilization efficiency.
Smart Images

Figure CN120851142A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, specifically to a method for model training, a method for data processing, and related apparatus. Background Technology
[0002] With the rapid development of information technology and artificial intelligence, the market size of business entities such as virtual games, goods, products, and advertising is constantly expanding, and competition is becoming increasingly fierce. Against this backdrop, accurately predicting the revenue of these business entities is beneficial for formulating effective market strategies and optimizing resource allocation.
[0003] Traditional flow prediction methods typically employ neural network models or deep learning techniques involving numerous hyperparameters and requiring a large number of training samples to train the model and predict the flow of an object. However, this approach relies heavily on training samples to adjust and update model parameters, making it only suitable for flow prediction of new objects with large amounts of business data. When used for flow prediction of new objects with smaller datasets, it is prone to overfitting, resulting in poor prediction performance. Summary of the Invention
[0004] This application provides a model training method, a data processing method, and related apparatus for predicting the flow of an object with a small amount of data, avoiding overfitting, and improving the prediction effect.
[0005] In a first aspect, embodiments of this application provide a method for model training. The method includes: acquiring a first sample and extracting a first sample feature vector from the first sample; obtaining a second sample feature vector from the first sample based on the value of a first dummy variable and the first sample feature vector, wherein the value of the first dummy variable indicates whether a numerical feature in the first sample feature vector is a missing feature value; training a first initial model based on the second sample feature vector to obtain a first target model; and training the second initial model based on the first sample feature vector to obtain a second target model. The first target model is used to predict the first feature vector of the object to be estimated to obtain a first target flow rate estimate; the second target model is used to predict the target feature vector of the object to be estimated to obtain a second target flow rate estimate; the first target flow rate estimate and the second target flow rate estimate are used to determine the target flow rate estimate of the object to be estimated; the first feature vector is obtained from the value of a target dummy variable and the target feature vector, wherein the value of the target dummy variable indicates whether a numerical feature in the target feature vector is a missing feature value.
[0006] Secondly, embodiments of this application provide a data processing method. This data processing method includes: acquiring an object to be estimated and extracting a target feature vector of the object to be estimated; obtaining a first feature vector of the object to be estimated based on the value of a target dummy variable and the target feature vector, wherein the value of the target dummy variable indicates whether the numerical feature in the target feature vector is a missing feature value; using the first feature vector as input to a first target model to obtain a first target flow estimate; and using the target feature vector as input to a second target model to obtain a second target flow estimate, wherein the first target model is a machine learning model obtained by training a first initial model using the second sample feature vector of a first sample as training data, and the second target model is a machine learning model obtained by training a second initial model using the first sample feature vector of the first sample as training data, wherein the second sample feature vector is obtained by using the first sample feature vector and the value of a first dummy variable, and the value of the first dummy variable indicates whether the numerical feature of the first sample feature vector is a missing feature value; and performing a weighted summation of the first target flow estimate and the second target flow estimate to obtain the target flow estimate of the object to be estimated.
[0007] Thirdly, embodiments of this application provide a model training apparatus. The model training apparatus includes an acquisition unit and a processing unit. The acquisition unit is used to acquire a first sample. The processing unit is used to extract a first sample feature vector from the first sample. The processing unit is used to obtain a second sample feature vector from the first sample based on the value of a first dummy variable and the first sample feature vector, wherein the value of the first dummy variable indicates whether the numerical feature in the first sample feature vector is a missing feature value. The processing unit is used to train a first initial model based on the second sample feature vector to obtain a first target model, and to train a second initial model based on the first sample feature vector to obtain a second target model. The first target model is used to predict the first feature vector of the object to be estimated to obtain a first target flow rate estimate. The second target model is used to predict the target feature vector of the object to be estimated to obtain a second target flow rate estimate. The first target flow rate estimate and the second target flow rate estimate are used to determine the target flow rate estimate of the object to be estimated. The first feature vector is obtained from the value of a target dummy variable and the target feature vector, wherein the value of the target dummy variable indicates whether the numerical feature in the target feature vector is a missing feature value.
[0008] In some optional implementations, the first initial model includes a factorization machine model; the processing unit is specifically configured to: extract a first expression characterizing the factorization machine model, wherein the first expression is a function expression with the parameters to be estimated as independent variables and the predicted flow rate of the second sample feature vector as dependent variable, the parameters to be estimated including the global bias variable of the factorization machine model, the weight of the i-th feature variable in the second sample feature vector, and the latent vector of the i-th feature variable, where i is an integer greater than or equal to 1; solve for the first-order partial derivative of the parameters to be estimated in the first expression to obtain the model gradient expression; calculate the gradient decay information of the parameters to be estimated based on the model gradient expression and the historical gradient information of the parameters to be estimated; calculate the target parameter value of the parameters to be estimated based on the gradient decay information of the parameters to be estimated, a preset learning rate, and the initial parameter value of the parameters to be estimated; and update the model parameters of the factorization machine model based on the target parameter value to obtain a first target model.
[0009] In some alternative implementations, the processing unit is specifically configured to: obtain the gradient value of the parameter to be estimated at the (t-1)th iteration and the squared gradient value of the parameter to be estimated at the (t-1)th iteration from the historical gradient information of the parameter to be estimated; determine the gradient value of the parameter to be estimated at the tth iteration based on the model gradient expression and the gradient value at the (t-1)th iteration, and determine the gradient decay information of the parameter to be estimated at the tth iteration based on the gradient value at the tth iteration, where t is an integer greater than 0; determine the squared gradient value of the parameter to be estimated at the tth iteration based on the model gradient expression and the squared gradient value at the (t-1)th iteration, and determine the squared gradient decay information of the parameter to be estimated at the tth iteration based on the squared gradient value at the tth iteration.
[0010] In some alternative implementations, the acquisition unit is specifically configured to: acquire a first weight and a second weight, wherein the sum of the first weight and the second weight is 1. The processing unit is specifically configured to: weight the model gradient expression based on the first weight to obtain a weighted model gradient expression, and weight the gradient value of the (t-1)th iteration based on the second weight to obtain a weighted gradient value of the (t-1)th iteration; sum the weighted model gradient expression and the weighted gradient value of the (t-1)th iteration to obtain the gradient value of the parameter to be estimated in the tth iteration; and determine the gradient decay information of the parameter to be estimated in the tth iteration based on the gradient value of the tth iteration and the second weight.
[0011] In some alternative implementations, the acquisition unit is specifically configured to: acquire a third weight and a fourth weight, wherein the sum of the third weight and the fourth weight is 1. The processing unit is specifically configured to: weight the model gradient expression based on the third weight to obtain a weighted model gradient expression, and weight the squared gradient value of the (t-1)th iteration based on the fourth weight to obtain a weighted squared gradient value of the (t-1)th iteration; sum the weighted model gradient expression and the weighted squared gradient value of the (t-1)th iteration to obtain the squared gradient value of the parameter to be estimated in the tth iteration; and determine the squared gradient decay information of the parameter to be estimated in the tth iteration based on the squared gradient value of the tth iteration and the fourth weight.
[0012] In some alternative implementations, the processing unit is specifically configured to: calculate the parameter change of the parameter to be estimated in the t-th iteration based on the gradient decay information of the t-th iteration, the gradient squared decay information of the t-th iteration, and the preset learning rate; calculate the difference between the initial parameter value of the t-th iteration and the parameter change of the t-th iteration to obtain the target parameter value of the parameter to be estimated in the t-th iteration, wherein the initial parameter value of the model parameter to be estimated includes the initial parameter value of the t-th iteration.
[0013] In some alternative implementations, the processing unit is specifically configured to: determine a first feature value and a second feature value from the first sample feature vector, wherein the first feature value is a numerical feature in the first sample feature vector and the second feature value is a non-numerical feature in the first sample feature vector; set a first dummy variable for the first feature value and determine the value of the first dummy variable based on the missing value of the first feature value; and obtain a second sample feature vector of the first sample based on the value of the first dummy variable, the first feature value after setting the first dummy variable, and the second feature value.
[0014] In some alternative implementations, the acquisition unit is further configured to: acquire a second sample for verification and the actual flow rate value of the second sample. The processing unit is further configured to: extract the sample feature vector of the second sample; obtain an updated sample feature vector of the second sample based on the value of a second dummy variable and the sample feature vector of the second sample, wherein the value of the second dummy variable is used to indicate whether the numerical features in the sample feature vector of the second sample are missing feature values. The processing unit is further configured to: after training a first initial model based on the second sample feature vector to obtain a first target model, use the updated sample feature vector of the second sample as input to the first target model to obtain a flow rate prediction value of the second sample; calculate a first evaluation value based on the flow rate prediction value of the second sample, the actual flow rate value of the second sample, and a first value, wherein the first value is the average value of the actual flow rate value of the second sample, and the first evaluation value is used to characterize the model prediction capability of the first target model; and stop training the first target model based on the second sample feature vector when the first evaluation value is greater than or equal to a first preset threshold.
[0015] In some alternative implementations, the processing unit is further configured to: when the first target flow estimate is non-positive, perform logarithmic processing on the first feature vector to obtain a first flow estimate; perform logarithmic processing on the first flow estimate to obtain a third target flow estimate, wherein the third target flow estimate is used to determine the target flow estimate of the object to be estimated by comparing it with the second target flow estimate.
[0016] In some alternative implementations, the second initial model includes an XGBoost model and a ridge regression model; the processing unit is specifically used for: performing one-hot encoding on the feature vector of the first sample based on the XGBoost model to obtain a first encoded feature vector; performing regression processing on the first encoded feature vector based on the ridge regression model to obtain a second flow rate estimate; and updating the model parameters of the second initial model based on the difference between the second flow rate estimate and the actual flow rate value of the first sample to obtain a second target model.
[0017] In some alternative implementations, the XGBoost model includes M tree models, each tree model including at least one leaf node, where M is an integer greater than or equal to 2; the processing unit is specifically configured to: number each leaf node in each tree model to obtain numbering information for each leaf node, the numbering information indicating the node position of the corresponding leaf node in the M tree models; determine the target numbering information for each feature point in the first sample feature vector, the target numbering information being the numbering information of the target leaf node in the M tree models where the corresponding feature point falls, the target leaf node being one of the at least one leaf nodes; and perform one-hot encoding on the target numbering information of each feature point to obtain a first encoded feature vector corresponding to the first sample feature vector.
[0018] In some alternative implementations, the acquisition unit is further configured to: acquire a third sample for verification and the actual flow rate value of the third sample. The processing unit is further configured to: extract the sample feature vector of the third sample. The processing unit is further configured to: after training the second initial model based on the first sample feature vector to obtain a second target model, use the sample feature vector of the third sample as input to the second target model to obtain the flow rate prediction value of the third sample; calculate a second evaluation value based on the flow rate prediction value of the third sample, the actual flow rate value of the third sample, and the second value, wherein the second value is the average value of the actual flow rate value of the third sample, and the second evaluation value is used to characterize the model prediction capability of the second target model; and stop training the second initial model based on the first sample feature vector when the second evaluation value is greater than or equal to a second preset threshold.
[0019] Fourthly, embodiments of this application provide a data processing apparatus. This data processing apparatus includes an acquisition module and a processing module. The acquisition module is used to acquire an object to be estimated. The processing module is used to extract a target feature vector from the object to be estimated. The processing module is used to obtain a first feature vector of the object to be estimated based on the value of a target dummy variable and the target feature vector, wherein the value of the target dummy variable indicates whether the numerical feature in the target feature vector is missing a feature value. The processing module is used to use the first feature vector as input to a first target model to obtain a first target flow estimate, and to use the target feature vector as input to a second target model to obtain a second target flow estimate. The first target model is a machine learning model obtained by training a first initial model using the second sample feature vector of a first sample as training data. The second target model is a machine learning model obtained by training a second initial model using the first sample feature vector of the first sample as training data. The second sample feature vector is obtained from the first sample feature vector and the value of a first dummy variable, wherein the value of the first dummy variable indicates whether the numerical feature of the first sample feature vector is a missing feature value. The processing module is used to perform a weighted summation of the first target flow estimate and the second target flow estimate to obtain the target flow estimate of the object to be estimated.
[0020] In some optional implementations, the acquisition module is further configured to: before performing a weighted summation of the first target flow estimate and the second target flow estimate to obtain the target flow estimate of the object to be estimated, acquire a first evaluation value and a second evaluation value, wherein the first evaluation value is used to characterize the model prediction capability of the first target model, and the second evaluation value is used to characterize the model prediction capability of the second target model. The processing module is specifically configured to: calculate the sum of the first evaluation value and the second evaluation value to obtain a total model evaluation value; determine the weight of the first target model based on the first evaluation value and the total model evaluation value, and perform a weighted summation of the first target flow estimate based on the weight of the first target model to obtain a weighted first target flow estimate; determine the weight of the second target model based on the second evaluation value and the total model evaluation value, and perform a weighted summation of the second target flow estimate based on the weight of the second target model to obtain a weighted second target flow estimate; and sum the weighted first target flow estimate and the weighted second target flow estimate to obtain the target flow estimate of the object to be estimated.
[0021] In some alternative implementations, the processing module is specifically configured to: determine a first target feature value and a second target feature value from the target feature vector, wherein the first target feature value is a numerical feature in the target feature vector and the second target feature value is a non-numerical feature in the target feature vector; set a target dummy variable for the first target feature value and determine the value of the target dummy variable based on the missing value of the first target feature value; and obtain a first feature vector of the object to be estimated based on the value of the target dummy variable, the first target feature value of the first dummy variable, and the second target feature value.
[0022] In some alternative implementations, the processing module is further configured to: perform a weighted summation of the first target flow estimate and the second target flow estimate to obtain the target flow estimate of the object to be estimated, and then display the target flow estimate on a visualization display interface.
[0023] A fifth aspect of this application provides a data processing apparatus, including: a memory, an input / output (I / O) interface, and a processor. The memory is used to store program instructions. The processor is used to execute the program instructions in the memory to perform the model training method corresponding to the embodiment of the first aspect described above; or to perform the data processing method corresponding to the embodiment of the second aspect described above.
[0024] A sixth aspect of this application provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform a method for model training corresponding to the embodiments of the first aspect described above; or, to perform a method for data processing corresponding to the embodiments of the second aspect described above.
[0025] The seventh aspect of this application provides a computer program product containing instructions that, when run on a computer or processor, causes the computer or processor to execute the method described above for performing the implementation of the first aspect.
[0026] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0027] In this embodiment, a first sample is first obtained, and a first sample feature vector is extracted from the first sample. After extracting the first sample feature vector, a second sample feature vector is obtained based on the value of a first dummy variable and the first sample feature vector. It should be noted that the value of the first dummy variable can be used to indicate whether the numerical feature in the first sample feature vector is a missing feature value. After determining the second sample feature vector, the second sample feature vector is used as training data to train a first initial model. Then, the trained first target model can be used to predict the first feature vector of the object to be estimated, thereby obtaining a first target flow rate estimate. The first feature vector described is obtained from the target feature vector of the object to be estimated and the value of the target dummy variable. The value of the target dummy variable can indicate whether the numerical feature in the target feature vector is a missing feature value. Furthermore, in this application, after extracting the first sample feature vector, a second initial model is also trained using the first sample feature vector. Then, the trained second target model is used to predict the target feature vector, thereby obtaining a second target flow rate estimate. Finally, the target flow rate estimate of the object to be estimated is determined based on the first target flow rate estimate and the second target flow rate estimate.
[0028] In this way, since the value of the first dummy variable can reflect the missing feature information, this application can consider the first dummy variable based on the original first sample feature vector to complete the feature vector. Thus, the first target model trained using the completed second sample feature vector can pay attention to the missing features in the samples, comprehensively considering the impact of missing feature values on the true feature vector. Furthermore, a second target model is trained using the first sample feature vector. Therefore, this application can predict the flow rate of the object to be estimated based on the first and second target models respectively, comprehensively considering the predicted flow rate estimates to jointly complete the flow rate prediction of the object to be estimated. In other words, compared to traditional flow rate prediction methods, this application uses the value of the first dummy variable to truly reflect the missing feature information in the training data and trains multiple different target models to predict the flow rate of the same object under different models from different perspectives. This not only reduces the dependence on a large number of training samples during model training and solves the problem of overfitting, but also improves the efficiency of model training and the prediction effect of new objects. In addition to being applicable to the flow prediction of new objects with large amounts of business data, this application is also applicable to the flow prediction scenario of new objects with small amounts of business data. This not only expands the flow prediction scenario, but also improves the utilization efficiency of resources such as models and avoids waste of resources. Attached Figure Description
[0029] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0030] Figure 1 This paper illustrates a schematic diagram of an application scenario for the flow prediction provided in this application.
[0031] Figure 2 A schematic diagram of the system architecture provided in this application is shown;
[0032] Figure 3 This paper illustrates a first flowchart of the model training method provided in this application;
[0033] Figure 4 This paper illustrates a training process diagram of the first initial model provided in this application;
[0034] Figure 5 This paper illustrates a training process diagram of the second initial model provided in this application;
[0035] Figure 6 The diagram illustrates the optional processing options for the XGBoost and Ridge Regression models provided in this application.
[0036] Figure 7 An optional schematic diagram of the encoding process provided in this application is shown;
[0037] Figure 8 A flowchart of a data processing method provided in an embodiment of this application is shown;
[0038] Figure 9 This application provides a schematic diagram showing how to view the estimated flow rate from a visual display interface.
[0039] Figure 10 A schematic diagram showing the variation curve of the evaluation value provided in this application is illustrated;
[0040] Figure 11 This illustration shows an optional schematic diagram of the functional modules of the model training device provided in the embodiments of this application;
[0041] Figure 12 A schematic diagram showing optional functional modules of the data processing apparatus provided in an embodiment of this application is illustrated.
[0042] Figure 13 An optional schematic diagram of the hardware structure of the data processing device provided in an embodiment of this application is shown. Detailed Implementation
[0043] This application provides a model training method, a data processing method, and related apparatus for predicting the flow of an object with a small amount of data, avoiding overfitting, and improving the prediction effect.
[0044] It is understood that in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0045] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0046] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that implementations of the application described herein can be implemented, for example, in sequences other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0047] With the rapid development of the internet and the explosive growth of information, users are facing an overload of information. For example, business applications such as audio, video, advertising, games, text, images, apps, travel destinations, food, news, movies, music, or other content will constantly update and iterate to meet market demands, releasing new versions for users to download. Of course, as new market demands emerge, other new products will gradually be developed and released to the market for users to choose from. However, effectively promoting new, yet-to-be-released content to maximize revenue can be achieved by estimating the revenue potential of these new applications and analyzing the estimated revenue. After estimating the revenue of new applications, the estimated revenue value can be used for product reporting, operational planning, budget applications, and other operations.
[0048] The described flow forecast for a new object can be understood as predicting the flow of an object over a future period. For example, the forecast period could be one week, one month, six months, or one year after the object goes live, etc., and this application does not limit the timeframe.
[0049] Furthermore, the new objects mentioned in this application can also be understood as the objects to be valued mentioned later, i.e., new products that have not yet been launched. For example, the objects to be valued mentioned in this application could be new versions of existing products, or newly developed products, etc., and this application does not impose any limitations.
[0050] With the research and advancement of artificial intelligence (AI) technology, AI is being researched and applied in various fields, such as smart homes, smart wearable devices, virtual assistants, smart speakers, autonomous driving, drones, robots, smart healthcare, smart customer service, and personalized recommendations. It is believed that with further technological development, AI will be applied in even more fields and play an increasingly important role. AI technology is also gradually being applied in scenarios such as cash flow forecasting. Through AI technology, the cash flow of the object to be estimated can be predicted, providing data support for subsequent business operations such as budget applications.
[0051] For example, Figure 1 A schematic diagram illustrating an application scenario for the flow prediction provided in this application is shown. For example... Figure 1 As shown, taking a virtual game as an example, after developing a new virtual game product (e.g., virtual game A), a company wants to understand the feasibility of virtual game A and assess its commercial prospects and value. In this case, a model can be trained using historical data from already launched virtual games (e.g., virtual games B, C, and D, etc.), and then the generated revenue can be estimated based on the trained model. After obtaining the estimated revenue of virtual game A, game developers or data analysts can use this estimate to conduct business analysis and make relevant business decisions.
[0052] This application provides a method for model training and a method for data processing. Both the model training method and the data processing method provided in this application are based on artificial intelligence (AI). AI is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can react in a way similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess perception, reasoning, and decision-making functions.
[0053] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech recognition, natural language processing, and machine learning / deep learning.
[0054] In the embodiments of this application, the main artificial intelligence technologies involved include the aforementioned machine learning and other related fields. For example, it may involve deep learning in machine learning (ML), including autoencoders, embeddings, etc.
[0055] The model training method provided in this application can be applied to data processing devices with data processing capabilities. Exemplarily, the data processing method provided in this application can also be applied to the aforementioned data processing devices. As an illustrative description, the data processing devices mentioned include, but are not limited to, servers, terminal devices, etc. Servers can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, etc., without specific limitations in this application. Furthermore, the terminal devices mentioned can include, but are not limited to, smartphones, desktop computers, laptops, tablets, smart speakers, in-vehicle devices, smartwatches, wearable smart devices, smart voice interaction devices, smart home appliances, aircraft, etc., without limitation in the embodiments of this application.
[0056] The aforementioned data processing equipment can possess machine learning capabilities. Machine learning is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, and many other disciplines. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include technologies such as neural networks. The artificial intelligence model used in the model training and data processing methods provided in the embodiments of this application mainly involves the application of neural networks, using multiple neural networks to comprehensively predict the target flow rate estimate of the object to be estimated.
[0057] Current traditional methods of transaction volume estimation typically employ neural network models or deep learning techniques involving numerous hyperparameters and requiring a large number of training samples to train models and predict transaction volume. However, this approach relies heavily on training samples to adjust and update model parameters, making it suitable only for estimating transaction volume for new objects with large amounts of business data. It is not suitable for predicting the transaction volume of new objects with small amounts of business data. Using current estimation methods to predict the transaction volume of new objects with small amounts of business data can easily lead to overfitting, resulting in poor prediction performance.
[0058] Therefore, to solve the aforementioned technical problems, embodiments of this application provide a model training method. Correspondingly, embodiments of this application also provide a data processing method. This model training method and data processing method can be applied to scenarios such as flow rate prediction, and are not limited thereto in this application. Using the model training method provided in this application, a data processing device can train a first target model and a second target model. Thus, in executing the data processing method, the data processing device can specifically use the first target model to predict a first target flow rate estimate of the object to be estimated, and use the second target model to predict a second target flow rate estimate of the object to be estimated. Then, by comprehensively considering the first target flow rate estimate and the second target flow rate estimate, flow rate prediction processing for the object to be estimated can be achieved.
[0059] The process for training and using the first and second target models using the aforementioned data processing equipment can be referred to [reference needed]. Figure 2 Use the illustrated system architecture diagram to understand it. Figure 2 As shown, the system architecture includes a model training phase and a model usage phase.
[0060] In the model training phase, it is necessary to obtain the first sample. The first sample can include one or more, and their number is not specifically limited. Taking multiple first samples as an example, the data sources of these multiple first samples can be the same or different; this application does not impose any limitations. After obtaining the first sample, the first sample feature vector of the first sample is extracted. Subsequently, the second sample feature vector of the first sample is determined using the first dummy variable and the first sample feature vector of the first sample. Thus, in the model training phase, the second sample feature vector of the first sample is used as training data to iteratively train the first initial model to obtain the first target model. Similarly, the first sample feature vector is used as training data to iteratively train the second initial model to obtain the second target model. It should be noted that how the first target model is trained here will be explained in detail in the following sections. Figure 4 The content shown is for your understanding and will not be elaborated upon here. Similarly, how to train the second target model will be explained in detail later. Figure 5 The content shown is for your understanding; further details will not be elaborated upon here.
[0061] After training the first and second target models, during the model usage phase, the data processing device, for example, can obtain the corresponding object to be estimated upon receiving a prediction request. After obtaining the object, the target feature vector of the object is extracted. Then, based on the target dummy variable and the target feature vector, the first feature vector of the object is obtained. The described target dummy variable indicates whether the feature value at the feature position corresponding to a zero value in the first feature vector is a missing feature value in the target feature vector. Thus, the first target model trained during the model training phase is used to predict the first feature vector to obtain the first target flow rate prediction value of the object. Similarly, the second target model trained during the model training phase is used to predict the target feature vector to obtain the second target flow rate prediction value of the object. Therefore, after obtaining the first and second target flow rate prediction values, a weighted sum is performed on the first and second target flow rate prediction values to determine the target flow rate prediction value of the object.
[0062] In other words, using the first dummy variable more realistically reflects the feature loss situation of the training data, enabling model training with a smaller amount of training data, without relying on a large number of training samples, thus improving the model's generalization ability. Furthermore, this application combines multiple target models (i.e., the first target model and the second target model) to achieve flow prediction for the object to be estimated, making it applicable to flow prediction scenarios for objects with relatively small amounts of business data, avoiding overfitting, and improving prediction performance.
[0063] For example, the model training method and data processing method provided in the embodiments of this application can also be applied to various scenarios such as cloud technology, smart transportation, smart IoT, and vehicle networking, and are not specifically limited in this application.
[0064] As an illustrative description, since the execution of the data processing method described above relies on the target recall model trained by the previous model training method, the following will first describe in detail the model training method provided in this application embodiment, taking the data processing device as the execution subject. For example, Figure 3 This illustration shows a first flowchart of a model training method provided in an embodiment of this application. Figure 3 As shown, the model training method includes at least the following steps:
[0065] 301. Obtain the first sample.
[0066] In this example, training samples need to be collected before training the model. As an illustrative description, this application can associate multiple data platforms through a global data dictionary, such as a store A, a video website B, a live streaming platform C, etc. The described data dictionary is a collection of descriptions of data objects or items in the data model; it can also be understood as a collection of definitions for all data elements used in the system. Through the data dictionary, the directory in the record database can be accessed. Furthermore, the described data platform, sometimes also called a data source, is the origin of the data, which is the original medium providing the required data.
[0067] After associating multiple data platforms, field queries can be performed from the global data dictionary based on business keywords or key business fields to retrieve sample objects corresponding to those keywords or fields from the associated data platforms. After obtaining the sample objects, data sources can be retrieved from existing databases to obtain the actual transaction values for each sample object during its initial online period. Thus, training data is generated based on each sample object and its corresponding actual transaction value.
[0068] After obtaining the training data, it can be divided into two independent subsets: a training set and a validation set. The training set includes a first sample and its actual transaction value. The validation set includes a second sample used for validation and its actual transaction value. Optionally, the ratio of the number of first samples in the training set to the number of second samples in the validation set can be determined according to requirements and is not limited in this application.
[0069] It should be noted that the aforementioned first launch duration can be understood as the total duration from the moment the sample object is officially launched to the market or begins to provide services until a certain point in time. For example, the first launch duration could be the first month of promotion after the object goes live, or the 7-day promotion period after the object goes live, or even the 6-month promotion period after the object goes live, etc. No specific limitation is made in the embodiments of this application.
[0070] 302. Extract the first sample feature vector of the first sample.
[0071] In this example, after obtaining the first sample, a feature extraction model such as a convolutional neural network (CNN) can be used to extract features from the first sample to obtain one or more sample features. Then, after extracting one or more sample features from the first sample, a first sample feature vector is generated based on these features. That is, each element of the first sample feature vector can be used to reflect a sample feature of the first sample.
[0072] It should be noted that the one or more sample features mentioned above include, but are not limited to, indicators based on or derived from basic indicators. For example, basic indicators may include, but are not limited to: reservations, followers, comments, ratings, bullet comments, videos, play counts, play duration, and clicks. Derivative indicators may include, but are not limited to, the total number of times the highest concurrent online users have entered the top 20 across the entire platform, etc., which are not limited in this embodiment.
[0073] For example, taking a virtual game A as the first sample, the extracted sample features of virtual game A include n, such as x1 to x2. n Let n ≥ 1, and n be an integer. Then, for the virtual game A, its first sample feature vector can be represented as: X = {x1, x2, ..., x...} n}
[0074] It should be noted that the above example only uses virtual game A as an example for illustration. In actual applications, other objects may also be included, such as advertisement B, product C, etc. This application does not make specific limitations.
[0075] 303. Based on the value of the first dummy variable and the feature vector of the first sample, the feature vector of the second sample of the first sample is obtained. The value of the first dummy variable is used to indicate whether the numerical feature in the feature vector of the first sample is a missing feature value.
[0076] In this example, as described in step 301 above, the training data in this application comes from multiple different data sources. It cannot be guaranteed that the sample object can extract the corresponding feature values from each data source, which may lead to the sample object having missing features in some data sources. For example, regarding the case of missing features in the first sample, the traditional solution is to use all non-empty feature values in the first sample, calculate the feature mean, and then use this feature mean to fill in the missing feature positions; or, the missing feature value in the first sample can be directly set to 0. Regardless of which traditional method is used to solve the problem of missing features, it will lead to a feature deviation between the filled feature value and the actual feature value, resulting in a significant deviation of the prediction result from reality.
[0077] Therefore, to avoid the problem of large errors in subsequent prediction results due to deviations in feature values, this application uses dummy variables to represent missing feature information, instead of using the feature mean or directly filling in zero values as in traditional methods. For example, after extracting the first sample feature vector in step 302, this application uses the value of the first dummy variable and the first sample feature vector to determine the second sample feature vector of the first sample, and then uses the second sample feature vector as the input to the subsequent first initial model.
[0078] It should be noted that the value of the first dummy variable described can identify whether the numerical feature in the feature vector of the first sample is a missing feature value.
[0079] In some examples, the process of obtaining the feature vector of the second sample from the first sample can be understood as follows:
[0080] First, determine the first and second eigenvalues from the first sample feature vector. The first eigenvalue can be understood as the numerical feature in the first sample feature vector. The second eigenvalue can be understood as the non-numerical feature in the first sample feature vector.
[0081] For example, let the feature vector of the first sample be X = {x1, x2, ..., x...} n For example, if the first sample feature vector X contains n1 numerical features, such as: x1, x2, ..., and x... n1 Where 0 < n1 < n. Furthermore, the first sample feature vector X contains n-n1 non-numerical features, i.e., x n1+1 x n1+2 ... x n At this point, x1, x2, ..., and x can be considered as... n1 Interpreted as the first eigenvalue, x n1+1 xn1+2 ... x n It can be understood as the second eigenvalue.
[0082] After determining the first and second eigenvalues, a first dummy variable can be assigned to the first eigenvalue, and the value of the first dummy variable can be determined based on the missing values of the first eigenvalues. For example, a corresponding first dummy variable v can be assigned to each of the n1 first eigenvalues. s 1 ≤ s ≤ n1. For example, setting a virtual variable v1 for x1, setting a virtual variable v2 for x2, ..., and setting a virtual variable v1 for x1. n1 Set the dummy variable v n1 Furthermore, after configuring the corresponding first dummy variable, it is also necessary to determine the value of the corresponding first dummy variable based on the missing value of the first feature. The value of this first dummy variable can then clearly indicate whether the corresponding first feature is a missing feature.
[0083] As an illustrative description, the first dummy variable v mentioned above s With the first eigenvalue (i.e. x) s The relationship between ) satisfies the following formula (1), that is:
[0084]
[0085] Among them, v s Let x' represent the s-th dummy variable. s This represents the first characteristic value after setting the first dummy variable.
[0086] After obtaining the values of the first dummy variable, the second sample feature vector of the first sample is obtained based on the first dummy variable and the first and second feature values set for it. As an illustrative description, the second sample feature vector satisfies the following formula (2), namely:
[0087] X = (x1, x2, ... x) n1 ,x n1+1 , ..., x n →X'=(x'1,x'2,...x') n1 ,v1,v2,...,v n1 ,x n1+1 , ..., x n ) Formula (2)
[0088] Where X represents the feature vector of the first sample and X' represents the feature vector of the second sample.
[0089] For example, suppose X = (x1,,x3,..x n1 ,x n1+1,...,x n If x2 in the first sample feature vector X is a missing numerical feature and x1 is a non-missing numerical feature, then for x1, we can continue to use x1 to represent the corresponding feature (i.e., x'1 = x1), and fill the corresponding dummy variable v1 with 0. By having v1 = 0, we can indicate that x1 is not a missing feature value in the first sample feature vector X. Similarly, for x2, we can fill it with 0 (i.e., x'2 = x2), and fill the corresponding dummy variable v2 with 1. By having v2 = 1, we can indicate that x2 is a missing feature value in the first sample feature vector X. Based on this, the final second sample feature vector X' = (x1, 0, ... x') is obtained. n1 ,0,1,...,v n1 ,x n1+1 , ..., x n ).
[0090] It should be noted that the numerical features described in this application can be understood as features whose values are numerical, such as play counts, reservations, and followers in a virtual game scenario. The non-numerical features described are understood as features whose values are not numerical, such as gameplay, game type, and game developer in a virtual game scenario.
[0091] 304. The first initial model is trained based on the second sample feature vector to obtain the first target model. The first target model is used to estimate the first feature vector of the object to be estimated to obtain the first target flow rate estimate. The first feature vector is obtained by the value of the target dummy variable and the target feature vector of the object to be estimated. The value of the target dummy variable is used to indicate whether the numerical feature in the target feature vector is a missing feature value.
[0092] In this example, after determining the second sample feature vector, it can be used as the input to the first initial model. The second sample feature vector is then trained using this first initial model to obtain the first target model. After training the first target model, it is used to predict the flow rate of the object to be estimated. The process of using the first target model to predict the flow rate of the object to be estimated will be explained in subsequent sections. Figure 4 The content shown is for your understanding; further details will not be elaborated upon here.
[0093] In some examples, the described first initial model may include a factorization machine (FM) model or other prediction models, which are not specifically limited in this application. In this application, a factorization machine model is used as the first initial model as an example. Regarding step 304 above, the process of training the first initial model using the second sample feature vector can be referred to the following... Figure 4 The training process of the first initial model is illustrated in the diagram below for understanding. Figure 4 As shown, the training process includes at least the following steps:
[0094] S3041. Extract the first expression used to characterize the factorization machine model. The first expression is a function expression with the parameters to be estimated as independent variables and the predicted value of the flow of the second sample feature vector as the dependent variable. The parameters to be estimated include the global bias variable of the factorization machine model, the weight of the i-th feature variable in the second sample feature vector, and the latent vector of the i-th feature variable, where i is an integer greater than or equal to 1.
[0095] In this example, the factorization machine model can be characterized using an initial first expression. For instance, the first expression can be understood with reference to the following formula (3), namely:
[0096]
[0097] Where w0 represents the global bias variable, w i This represents the i-th feature variable (i.e., x) in the feature vector X' of the second sample. i The weight of ). Furthermore, <v i ,v j > Used to characterize the i-th feature variable (i.e., x) in the feature vector X' of the second sample. i ) and the j-th feature variable (i.e., x) j The cross weights between ) are, as an illustrative description, satisfied by formula (4), that is:
[0098]
[0099] Using formulas (4) and (3) above, another variation of formula (3) can be derived. For details, please refer to formula (5) below:
[0100]
[0101] For the transformed first expression (i.e., formula (5)), its This represents the flow prediction value for the n-dimensional second sample feature vector X'. Additionally, w0 represents the global bias variable, w... iThis represents the i-th feature variable (i.e., x) in the feature vector X' of the second sample. i The weight of ). Additionally, v i,f The feature variable x in the feature vector X' of the second sample represents the feature variable x. i The implicit vector.
[0102] In other words, the first expression after its transformation can be understood as a functional expression with the parameters to be estimated as independent variables and the predicted flow rate of the second sample feature vector as the dependent variable. It should be noted that the parameters to be estimated include w0 and w... (the values mentioned above are not directly related to the first expression and can be omitted). i and v i,f .
[0103] S3042. Solve the first-order partial derivatives of the parameters to be estimated in the first expression to obtain the model gradient expression.
[0104] In this example, the process of training the model can be understood as updating the model parameters. Therefore, after extracting the first expression, the parameters to be estimated in the first expression can be updated to obtain the target parameter values. For example, after extracting the first expression, the parameters to be estimated can be solved by first-order partial derivatives to obtain the model gradient expression. Through this model gradient expression, the iterative gradient of the first initial model in each iteration can be clearly understood. As an illustrative description, let θ represent the parameters to be estimated. After solving the first-order partial derivative of the above formula (5), the resulting model gradient expression satisfies the following formula (6), that is:
[0105]
[0106] Wherein, when the parameter to be estimated θ is w0, the corresponding model gradient expression is: Similarly, when the parameter to be estimated θ is w i In this case, the corresponding model gradient expression is: Similarly, when the parameter to be estimated θ is v i,f In this case, the corresponding model gradient expression is: Where i takes the value [1, n], f takes the value [1, k], and i and j are integers.
[0107] S3043. Based on the model gradient expression and the historical gradient information of the parameters to be estimated, calculate the gradient decay information of the parameters to be estimated.
[0108] Traditional factorization machines use the stochastic gradient descent (SGD) algorithm to iteratively update model parameters. However, due to its randomness, the SGD algorithm is prone to oscillations during convergence, such as the squared loss function, which can easily get stuck in local optima and prevent it from escaping to find other optimal parameter solutions.
[0109] Furthermore, optimization algorithms such as Adam consider the exponential decay information of the square of past gradients, thus also taking into account the exponential decay information of past gradients. This exponential decay information helps to avoid getting trapped in local optima during iterative convergence, making it suitable for large datasets and high-dimensional spaces. The described exponential decay information may include, but is not limited to, the exponentially decayed average value. Based on this, this application can also obtain the historical gradient information of the parameter to be estimated, and then, after obtaining the model gradient expression, use the historical gradient information and the model gradient expression to calculate the gradient decay information of the parameter to be estimated. The gradient decay information described in this application may include the aforementioned exponential decay information of the square of the gradient, as well as the exponential decay information of the gradient itself.
[0110] During training, the gradient information of the next iteration is usually influenced by the gradient information of the previous iteration. Therefore, this application only uses the gradient information of the (t-1)th iteration to solve for the gradient information of the tth iteration as an example, where t is an integer greater than 0. As an illustrative description, the calculation of the gradient decay information of the parameter to be estimated can be understood as follows:
[0111] First, obtain the gradient value of the parameter to be estimated in the (t-1)th iteration from the historical gradient information of the parameter to be estimated. For example, the gradient value of the parameter to be estimated in the (t-1)th iteration is m. t-1 .
[0112] Furthermore, after obtaining the gradient value of the parameter to be estimated in the (t-1)th iteration, the gradient value of the parameter to be estimated in the (t-1)th iteration is determined based on the model gradient expression and the gradient value of the (t-1)th iteration, for example, using m tLet represent the gradient value of the t-th iteration. As an illustrative description, the process of solving for the gradient value of the t-th iteration can be specifically described by first obtaining the first weight and the second weight. The sum of the first weight and the second weight is 1. After obtaining the first weight and the second weight, the model gradient expression is weighted using the first weight to obtain the weighted model gradient expression, and the gradient value of the (t-1)-th iteration is weighted based on the second weight to obtain the weighted gradient value of the (t-1)-th iteration. Thus, after obtaining the weighted model gradient expression and the weighted gradient value of the (t-1)-th iteration, the weighted model gradient expression and the weighted gradient value of the (t-1)-th iteration are summed to obtain the gradient value of the parameter to be estimated in the t-th iteration. For example, the gradient value of the parameter to be estimated in the t-th iteration satisfies the following formula (7), that is:
[0113] m t =β1m t-1 +(1-β1)g t Formula (7)
[0114] It should be noted that for the above formula (7), its m t Let m represent the gradient value of the parameter to be estimated in the t-th iteration. t-1 Let represent the gradient value of the parameter to be estimated in the (t-1)th iteration, β1 represent the second weight, and 1-β1 represent the first weight. Furthermore, the parameter gt in formula (7) can be understood as the model gradient expression in the aforementioned formula (6), i.e.
[0115] Furthermore, combining formulas (7) and (6) above, it can be seen that the gradient value of the parameter to be estimated θ in the t-th iteration will vary under different conditions. Specifically, when θ is w0, the gradient value of w0 in the t-th iteration is m. t (w0)=β1m t-1 +(1-β1)·1. When θ is w i In this case, its w i The gradient value for the corresponding t-th iteration is m t (w i )=β1m t-1 +(1-β1)·x i Similarly, when the parameter to be estimated θ is v i,f In this case, its v i,f The gradient value for the corresponding t-th iteration is:
[0116] Finally, after obtaining the gradient value of the parameter to be estimated in the t-th iteration, the gradient decay information of the parameter to be estimated in the t-th iteration can be determined using this gradient value. As an illustrative example, the gradient decay information of the parameter to be estimated in the t-th iteration can be determined based on the gradient value of the parameter in the t-th iteration and the second weight. For example, the gradient decay information of the parameter to be estimated in the t-th iteration satisfies the following formula (8), that is:
[0117]
[0118] in, This represents the gradient decay information of the parameter to be estimated in the t-th iteration.
[0119] Specifically, when θ is w0, the gradient decay information of w0 in the t-th iteration is: When θ is w i In this case, its w i The gradient decay information for the t-th iteration is Similarly, when the parameter to be estimated θ is v i,f In this case, its v i,f The gradient decay information for the t-th iteration is:
[0120] Similarly, the method for determining the gradient squared decay information of the parameter to be estimated in the t-th iteration can be understood as follows:
[0121] First, obtain the squared gradient value of the parameter to be estimated in the (t-1)th iteration from the historical gradient information of the parameter to be estimated. For example, the squared gradient value of the parameter to be estimated in the (t-1)th iteration is p. t-1 .
[0122] Furthermore, after obtaining the squared gradient value of the parameter to be estimated in the (t-1)th iteration, the squared gradient value of the t-th iteration is determined based on the model gradient expression and the squared gradient value of the (t-1)th iteration, for example, using p tLet represent the squared gradient value of the t-th iteration. As an illustrative description, to solve for the squared gradient value of the t-th iteration, we can first obtain the third weight and the fourth weight. It should be noted that the sum of the third weight and the fourth weight is 1. After obtaining the third weight, the third weight can be used as the weight of the model gradient expression, so as to complete the weighted processing of the model gradient expression and obtain the weighted model gradient expression. Similarly, after obtaining the fourth weight, the fourth weight can be used as the weight of the squared gradient value of the (t-1)-th iteration, and then the fourth weight can be used to weight the squared gradient value of the (t-1)-th iteration to obtain the weighted squared gradient value of the (t-1)-th iteration. Then, the weighted model gradient expression and the weighted squared gradient value of the (t-1)-th iteration are summed to solve for the squared gradient value of the parameter to be estimated in the t-th iteration. For example, the squared gradient value of the parameter to be estimated in the t-th iteration satisfies the following formula (9), that is:
[0123]
[0124] It should be noted that for the above formula (9), its p t p represents the squared gradient value of the parameter to be estimated in the t-th iteration. t-1 Let represent the squared gradient value of the parameter to be estimated in the (t-1)th iteration, β2 represent the fourth weight, and 1-β2 represent the third weight. Furthermore, the parameter gt in formula (9) can be understood as the model gradient expression in the aforementioned formula (6), i.e.
[0125] Furthermore, combining formulas (9) and (6) above, it can be seen that the squared gradient value of the parameter to be estimated θ in the t-th iteration will vary under different conditions. Specifically, when θ is w0, the squared gradient value of w0 in the t-th iteration is p. t (w0)=β2p t-1 +(1-β2)·1. When θ is w i In this case, its w i The corresponding squared gradient value for the t-th iteration is Similarly, when the parameter to be estimated θ is v i,f In this case, its v i,f The corresponding squared gradient value for the t-th iteration is:
[0126] Finally, after obtaining the squared gradient value of the parameter to be estimated in the t-th iteration, the squared gradient decay information of the parameter to be estimated in the t-th iteration can be determined using the squared gradient value of the t-th iteration. As an illustrative description, specifically, the squared gradient decay information of the parameter to be estimated in the t-th iteration can be determined based on the squared gradient value of the t-th iteration and the fourth weight. For example, the squared gradient decay information of the parameter to be estimated in the t-th iteration satisfies formula (10), that is:
[0127]
[0128] in, This represents the gradient squared decay information of the parameter to be estimated in the t-th iteration.
[0129] Specifically, when θ is w0, the gradient squared decay information of w0 in the t-th iteration is: When θ is w i In this case, its w i The gradient squared decay information for the t-th iteration is: Similarly, when the parameter to be estimated θ is v i,f In this case, its v i,f The gradient squared decay information for the t-th iteration is:
[0130] S3044. Based on the gradient decay information of the parameter to be estimated, the preset learning rate, and the initial parameter values of the parameter to be estimated, calculate the target parameter value of the parameter to be estimated.
[0131] In this example, after determining the gradient decay information of the parameter to be estimated, the target parameter value can be calculated based on the gradient decay information, the preset learning rate, and the initial parameter value of the parameter to be estimated. It should be noted that the gradient decay information of the parameter to be estimated mentioned in this application includes the gradient decay information of the t-th iteration calculated by formula (8) above, and also includes the gradient squared decay information of the t-th iteration calculated by formula (10) above. Furthermore, the initial parameter value of the parameter to be estimated mentioned in this application may include the initial parameter value of the t-th iteration.
[0132] As an illustrative description, after calculating the gradient decay information of the parameter to be estimated in the t-th iteration and the gradient squared decay information of the t-th iteration, the target parameter value of the parameter to be estimated in the (t+1)-th iteration can be solved using the gradient decay information of the t-th iteration and the gradient squared decay information of the t-th iteration. Specifically, assuming the preset learning rate is η, the process of calculating the target parameter value of the parameter to be estimated in the (t+1)-th iteration can be understood as follows:
[0133] First, based on the gradient decay information of the t-th iteration (i.e. ), the gradient squared decay information of the t-th iteration (i.e. Given a preset learning rate (η), calculate the parameter change in the t-th iteration of the parameter to be estimated. For example, the parameter change in the t-th iteration of the parameter to be estimated satisfies the formula... Here, η represents the preset learning rate, which is greater than 0. Additionally, ε represents a very small quantity, which is greater than 0, to ensure that the denominator is non-zero.
[0134] Thus, after calculating the parameter change ΔT in the t-th iteration, the difference between the initial parameter value of the parameter to be estimated in the t-th iteration and the parameter change in the t-th iteration is calculated, thereby obtaining the target parameter value of the parameter to be estimated in the (t+1)-th iteration. As an illustrative description, the target parameter value of the parameter to be estimated in the (t+1)-th iteration satisfies formula (11), that is:
[0135]
[0136] Where θt+1 represents the target parameter value of the parameter to be estimated in the (t+1)th iteration, and θt represents the initial parameter value of the parameter to be estimated in the tth iteration.
[0137] Therefore, by combining the above formulas (8), (10), and (11), we can solve for θ at w0 and w0 respectively. i v i,f The target parameter values for the (t+1)th iteration in these three cases. Specifically, refer to cases ① to ③ below for understanding, namely:
[0138] Case ①: When θ = w0, the gradient decay information and the squared gradient decay information of w0 in the t-th iteration are respectively Therefore, substituting this into the above formula (11), we can obtain the target parameter value of w0 in the (t+1)th iteration: Among them, w 0(t+1) Let w represent the objective parameter value of w0 in the (t+1)th iteration. 0(t) This represents the initial parameter value for the t-th iteration of w0.
[0139] Case ②: When θ = w i At that time, its w i The gradient decay information and the squared gradient decay information of the t-th iteration are respectively Therefore, by substituting it into the above formula (11), we can obtain w. i The objective parameter value for the (t+1)th iteration is: Among them, w i(t+1) Indicates w i The target parameter value w in the (t+1)th iteration i(t)Indicates w i The initial parameter values for the t-th iteration.
[0140] Case ③: When θ = v i,f At that time, its v i,f The gradient decay information and the squared gradient decay information of the t-th iteration are respectively Therefore, by substituting this into the above formula (11), we can obtain v. i,f The objective parameter value for the (t+1)th iteration is: in, Indicates v i,f The target parameter value for the (t+1)th iteration, Indicates v i,f The initial parameter values for the t-th iteration.
[0141] S3045. Update the model parameters of the first initial model based on the target parameter values to obtain the first target model.
[0142] In this example, after calculating the target parameter value of the parameter to be estimated in step S3044, this target parameter value can be used to update the model parameters of the factorization machine model to obtain the first target model. For example, in case ① obtained by using step S3044... In case ② and in case ③ Update the model parameters of the factorization machine model. More specifically, utilize... as well as By updating the corresponding parameters in the aforementioned formula (5), the first target model can be determined.
[0143] In some alternative examples, after training the first target model, its predictive ability can be verified. For example, the verification process can be understood as follows:
[0144] First, obtain the second sample for verification and its actual transaction value from the verification set, and then extract the sample feature vector of the second sample. It should be noted that the verification set mentioned here can be understood in accordance with the content described in step 301 above, and will not be repeated here.
[0145] Subsequently, the updated sample feature vector of the second sample is determined by using the value of the second dummy variable and the sample feature vector of the second sample. It should be noted that the value of the second dummy variable is used to indicate whether the numerical features in the sample feature vector of the second sample are missing features. Furthermore, how to determine the updated sample feature vector of the second sample using the value of the second dummy variable and the sample feature vector of the second sample can be understood by referring to the process of determining the second sample feature vector of the first sample in step 303 above; it will not be elaborated here.
[0146] Thus, after training the first target model through step 304, the updated feature vector of the second sample can be used as input to the first target model. The updated feature vector of the second sample is then processed by the first target model to estimate the flow rate of the second sample. Subsequently, the estimated flow rate of the second sample, the actual flow rate of the second sample, and the first value are used to calculate the first evaluation value.
[0147] It should be noted that the described first evaluation value can be used to characterize the predictive ability of the first target model. Furthermore, the described first value can be understood as the average of the actual transaction values of the second samples. For example, after obtaining the actual transaction values of all the second samples, the actual transaction values of all the second samples are averaged to obtain this first value.
[0148] As an illustrative description, the first evaluation value mentioned above satisfies the following formula (12), namely:
[0149]
[0150] in, This represents the first evaluation value. Additionally, m represents the number of samples in the second sample set, and its value is greater than 0. i This represents the actual flow rate value of the i-th second sample. Let represent the estimated flow rate of the i-th second sample, where 1 ≤ i ≤ m and i is an integer. Additionally, This indicates the first value.
[0151] Thus, after calculating the first evaluation value using formula (12), the model prediction capability of the first target model can be understood from the first evaluation value. Furthermore, by judging whether the first evaluation value is greater than or equal to the first preset threshold, the result is used to determine whether it is necessary to iteratively stop training the first initial model.
[0152] For example, if the first evaluation value is determined to be greater than or equal to the first preset threshold, it indicates that the first target model has a superior model prediction capability. In this case, there is no need to iterate and train the first initial model again; the first target model can accurately predict the flow rate of the object. In this situation, training the first initial model based on the second sample feature vector can be stopped. Conversely, if the first evaluation value is determined to be less than the first preset threshold, it indicates that the first target model has a poor model prediction capability and cannot accurately predict the flow rate of the object. In this case, step 304 above needs to be executed again for the next round of model iteration training until the convergence condition is met. The described model convergence condition may include, but is not limited to, the total number of iterations being greater than a certain threshold, or the error being less than a certain error threshold, or the parameter change between two iterations being less than a certain threshold, etc., which are not specifically limited in this application.
[0153] In some other alternative examples, after calculating the aforementioned first evaluation value (i.e., R1) 2 Afterwards, this first evaluation value can also be used to determine the weight of the first target model. By dynamically determining the weight of the first target model using the first evaluation value, rather than manually setting the weight of the first target model, the influence of the first target model on the subsequent estimation of the flow value of the object to be estimated can be dynamically reflected.
[0154] In some alternative examples, during the subsequent model usage phase, when predicting the first target flow rate estimate of the object to be estimated using the first target model, the first target flow rate estimate may be non-positive due to reasons such as an abnormal feature, i.e., the estimated first target flow rate estimate may be negative or zero. In this case, this application can also use a logistic regression (LR) model to optimize the prediction result. As an illustrative description, a logistic regression model can be used to logarithmize the first feature vector of the object to be estimated to obtain the first flow rate estimate. For example, the first flow rate estimate can be expressed as: Here, X' represents the first eigenvector. Subsequently, the first flow rate estimate is logarithmically transformed to obtain the third target flow rate estimate. It should be noted that this third target flow rate value is used to determine the target flow rate estimate of the object to be estimated, along with the second target flow rate estimate; details can be found in subsequent sections. Figure 11 The content described in step 1104 needs to be understood, but will not be elaborated on here.
[0155] For example, the estimated value of the third target flow mentioned above satisfies the following formula (13), namely:
[0156]
[0157] in, This represents the estimated flow rate of the third target.
[0158] 305. Update the model parameters of the second initial model based on the feature vector of the first sample to obtain the second target model. The second target model is used to predict the target feature vector to obtain the second target flow rate prediction value.
[0159] In this example, after extracting the first sample feature vector in step 302, the first sample feature vector can also be used as input to the second initial model. Thus, the first sample feature vector is trained using the second initial model to obtain the second target model. Optionally, after training the second target model, it is used to predict the target feature vector of the object to be estimated, thereby obtaining the second target flow rate estimate of the object. The process of using the second target model to predict the second target flow rate estimate can be referred to in the following sections. Figure 11 The content shown is for your understanding; further details will not be elaborated upon here.
[0160] For example, the described second initial model includes an XGBoost model and a ridge regression model. In this application, taking an XGBoost model and a ridge regression model as examples, the process of training the second initial model using the first sample feature vector in step 305 can be referred to... Figure 5 The training process of the second initial model is illustrated in the diagram below for understanding. Figure 5 As shown, the training process includes at least the following steps:
[0161] S3051. The first sample feature vector is processed by one-hot encoding based on the XGBoost model to obtain the first encoded feature vector.
[0162] In this example, the XGBoost model comprises M tree models, each containing at least one leaf node, where M is an integer greater than or equal to 2. During the one-hot encoding of the first sample feature vector using the XGBoost model, each leaf node in each tree model is first numbered to obtain its identification information. This identification information indicates the node position of the corresponding leaf node within the M tree models. Subsequently, the target identification information for each feature point in the first sample feature vector is determined. This target identification information is the identification information of the target leaf node in the M tree models where the corresponding feature point falls. The target leaf node is one of at least one leaf node.
[0163] For example, Figure 6This diagram illustrates the optional processing options for the XGBoost and Ridge Regression models provided in this application. Figure 6 As shown, assume the first sample feature vector is represented by X, for example, X = (x1, x2, ... x2). n Furthermore, if there are M tree models, then the position of each feature point in X within these M tree models can be determined to obtain the target ID information for that feature point. For example, if x1 falls into the first leaf node of the first tree model, then the ID information of the first leaf node in the first tree model can be used as the target ID information for feature point x1. Similarly, if x2 falls into the third leaf node of the second tree model, then the ID information of the third leaf node in the second tree model can be used as the target ID information for feature point x2, and so on.
[0164] In this way, after obtaining the target number information of each feature point, the target number information of each feature point is then subjected to one-hot encoding to obtain the first encoded feature vector corresponding to the first sample feature vector.
[0165] For example, Figure 7 An optional schematic diagram of the encoding process provided in this application is shown. For example... Figure 7 As shown, assuming M=3, there are 3 tree models. The first tree model has 2 leaf nodes, numbered (1|1) and (1|2). (1|1) represents the number of the first leaf node in the first tree model, and (1|2) represents the number of the second leaf node. Similarly, the second tree model has 3 leaf nodes, numbered (2|1), (2|2), and (2|3). Likewise, the third tree model has 3 leaf nodes, numbered (3|1), (3|2), and (3|3). By analyzing the numbering of all leaf nodes, the corresponding features can be constructed as: (1|1), (1|2), (2|1), (2|2), (2|3), (3|1), (3|2), and (3|3).
[0166] For example, when n=3, meaning there are 3 feature points, if x1 falls into the first leaf node of the first tree model, the corresponding target number is (1|1), and the encoded feature obtained after one-hot encoding is 1. Similarly, if x2 falls into the second leaf node of the second tree model, the corresponding target number is (2|2), and the encoded feature obtained after one-hot encoding is 1. If x3 falls into the third leaf node of the third tree model, the corresponding target number is (3|3), and the encoded feature obtained after one-hot encoding is 1. Therefore, the final first encoded feature vector is (1,0,0,1,0,0,0,1).
[0167] It should be noted that the above is only an example using 3 tree models and 3 feature points, and no specific limitations are made in this application.
[0168] S3052. The first encoded feature vector is regressed based on the ridge regression model to obtain the second flow rate estimate.
[0169] like Figure 6 As shown, after determining the first encoded feature vector, it is necessary to use the first encoded feature vector as the input of the ridge regression model, so as to perform regression processing on the first encoded feature vector through the ridge regression model, thereby predicting the second flow rate estimate.
[0170] It should be noted that the described ridge regression model may include, but is not limited to, the Ridge model; this application does not impose any specific limitations. The described Ridge model is a regression model with an added L2 regularization term.
[0171] S3053. Based on the difference between the second flow rate estimate and the actual flow rate of the first sample, the model parameters of the second initial model are updated to obtain the second target model.
[0172] In this example, after the second flow rate estimate is obtained, the difference between the second flow rate estimate and the actual flow rate of the first sample can be calculated. Based on this difference, the model parameters of the second initial model can be adjusted and updated to train the second target model.
[0173] In some optional examples, after training the second target model, its predictive ability can be verified. For example, the verification process can be understood as follows:
[0174] First, obtain the third sample used for verification and its actual transaction value, and then extract the sample feature vector of the third sample. It should be noted that the third sample mentioned here can be understood as the second sample in the aforementioned verification set. For details, please refer to the description in step 301 above, which will not be repeated here.
[0175] Thus, after training the second target model through step S3053, the feature vector of the third sample can be used as input to the second target model. The second target model processes the feature vector of the third sample to estimate its flow rate. Subsequently, the second evaluation value is calculated using the estimated flow rate of the third sample, its actual flow rate, and the second value.
[0176] It should be noted that the described second evaluation value can be used to characterize the predictive ability of the second target model. Furthermore, the described second value can be understood as the average of the actual transaction values of the third samples. For example, after obtaining the actual transaction values of all the third samples, the actual transaction values of all the third samples are averaged to obtain this second value.
[0177] As an illustrative description, the aforementioned second evaluation value satisfies the following formula (14), namely:
[0178]
[0179] in, This indicates the second evaluation value. This indicates the second value.
[0180] Thus, after calculating the second evaluation value using formula (14), the model prediction capability of the second target model can be understood from the second evaluation value. Furthermore, by judging whether the second evaluation value is greater than or equal to the second preset threshold, the result is used to determine whether it is necessary to iteratively stop training the second initial model.
[0181] For example, if the second evaluation value is determined to be greater than or equal to the second preset threshold, it indicates that the second target model has a better model prediction capability. In this case, there is no need to iterate and train the second initial model again, and the second target model can be used to accurately predict the flow rate of the object. In this case, training the second initial model based on the first sample feature vector can be stopped. Conversely, if the second evaluation value is determined to be less than the second preset threshold, it indicates that the model prediction capability of the second target model is poor and cannot accurately predict the flow rate of the object. In this case, step 305 above needs to be executed again for the next round of model iteration training until the convergence condition is met. The described model convergence condition may include, but is not limited to, the total number of iterations being greater than a certain threshold, or the error being less than a certain error threshold, or the parameter change between two iterations being less than a certain threshold, etc., which are not specifically limited in this application.
[0182] In some other alternative examples, after calculating the aforementioned second evaluation value (i.e. Subsequently, this second evaluation value can also be used to determine the weight of the second target model. By using the second evaluation value to dynamically determine the weight of the second target model, rather than manually setting the weight of the second target model, the influence of the second target model on the subsequent estimation of the flow value of the object to be estimated can be dynamically reflected.
[0183] In other alternative examples, traditional methods for finding optimal hyperparameters include empirical judgment and frame search. The determination of traditional optimal hyperparameters is often limited by factors such as the random number seed, sample size, and sample variance. For example, the random number seed includes, but is not limited to, the model random number seed, the random number seed for n-fold cross-validation, and the random number seed for frame search. This application uses the optimal hyperparameters from the previous n periods and the currently discovered random hyperparameters as initial exploration points, which are then incorporated into the Optuna framework. In this way, the Optuna framework can learn information about the hyperparameters from the previous n periods as well as the newly explored hyperparameters in the current period, thereby expanding the search scope, avoiding getting trapped in local optima, and facilitating the determination of the global optimum.
[0184] It should be noted that the Optuna framework mentioned above is an automated hyperparameter optimization software framework specifically designed for machine learning. It features an imperative, define-by-run application programming interface (API). Due to this API, code written using the Optuna framework is highly modular, and users can dynamically construct the hyperparameter search space.
[0185] In this embodiment, compared to traditional flow prediction methods, this application utilizes a first dummy variable to realistically reflect the missing feature information in the training data, and trains multiple different target models to predict the flow of the same object under different models from different perspectives. This not only reduces the dependence on a large number of training samples during model training, but is also suitable for flow prediction scenarios of new objects with small amounts of business data, avoiding overfitting and improving prediction performance.
[0186] The above mainly describes in detail the model training method provided in this application from the perspective of model training. After the above... Figures 3 to 7 After training the first target model and the second target model to obtain them, the first target model and the second target model can be used to predict the flow rate of the object to be estimated. Exemplarily, a data processing method provided by an embodiment of this application will be described below with reference to the accompanying drawings. Figure 8 A flowchart illustrating a data processing method provided in an embodiment of this application is shown. Figure 8 As shown, the data processing method may include the following steps:
[0187] 801. Obtain the object to be estimated and extract the target feature vector of the object to be estimated.
[0188] In this example, the object to be estimated can include, but is not limited to, audio, video, advertisements, games, text, images, virtual games, etc., and this application does not impose specific limitations. After obtaining the object to be estimated, a feature extraction model such as CNN can be used to perform feature extraction processing on the object to be estimated, so as to extract one or more features of the object to be estimated. Subsequently, after extracting one or more features of the object to be estimated, a target feature vector of the object to be estimated is generated based on these one or more features. That is, each element of the target feature vector can be used to reflect a feature of the object to be estimated.
[0189] It should be noted that one or more of the features mentioned above may include, but are not limited to, metrics based on or derived from basic metrics. For example, basic metrics may include, but are not limited to: reservations, followers, comments, ratings, bullet comments, videos, play counts, play duration, clicks, etc. Derivative metrics may include, but are not limited to, the total number of times the highest concurrent online users have entered the top 20 of the entire platform, etc., and are not limited in this embodiment.
[0190] 802. Based on the value of the target dummy variable and the target feature vector, the first feature vector of the object to be estimated is obtained. The value of the target dummy variable is used to indicate whether the numerical feature in the target feature vector is a missing feature value.
[0191] In this example, to avoid the feature values deviating from reality and causing significant errors in subsequent predictions, this application, after extracting the target feature vector in step 801, uses the values of the target dummy variable and the first feature vector to determine the first feature vector of the object to be estimated. This allows the first feature vector, which comprehensively considers missing feature information, to be used as input to the subsequent first target model.
[0192] In some examples, the process of obtaining the first feature vector of the object to be estimated can be understood as follows: First and second target feature values are determined from the target feature vector. It should be noted that the first target feature value is a numerical feature in the target feature vector, and the second target feature value is a non-numerical feature in the target feature vector. Subsequently, a target dummy variable is set for the first target feature value, and the value of the target dummy variable is determined based on the missing values of the first target feature value. Thus, based on the value of the target dummy variable, and by setting the first and second target feature values of the target dummy variable, the first feature vector of the object to be estimated is obtained.
[0193] It should be noted that the specific process of determining the first feature vector of the object to be estimated can be understood by referring to the process of determining the second sample feature vector in step 303 above, and will not be repeated here.
[0194] 803. Using the first feature vector as input to the first target model, the first target flow rate estimate is obtained; and using the target feature vector as input to the second target model, the second target flow rate estimate is obtained.
[0195] In this example, after the above... Figure 3 After training to obtain the first target model, the first feature vector is used as input to the first target model. The first target model processes the first feature vector to predict the first target flow rate estimate of the object to be estimated. Similarly, after the above... Figure 3 After training to obtain the second target model, the target feature vector is used as input to the second target model. The second target model processes the target feature vector to predict the second target flow rate estimate of the object to be estimated.
[0196] It should be noted that the first target model described here is a machine learning model obtained by training the first initial model using the second sample feature vector of the first sample as training data. The second target model is a machine learning model obtained by training the second initial model using the first sample feature vector of the first sample as training data. Furthermore, the second sample feature vector is obtained from the first sample feature vector and the first dummy variable. The first sample feature vector described can be referred to the foregoing. Figure 3The content described in step 302 is for reference only and will not be elaborated upon here. The first dummy variable described can be found in the preceding text. Figure 3 The content described in step 303 is for your understanding and will not be elaborated here.
[0197] Furthermore, the training process for the first and second target models can be referred to the aforementioned methods. Figure 3 The content described herein will be understood in detail here, and will not be elaborated upon further.
[0198] 804. Perform a weighted summation of the first target flow estimate and the second target flow estimate to obtain the target flow estimate of the object to be estimated.
[0199] In this example, after predicting the first target flow rate estimate and the second target flow rate estimate, the first target flow rate estimate and the second target flow rate estimate can be weighted and summed to calculate the target flow rate estimate of the object to be estimated.
[0200] As an illustrative example, the weighted summation of the first and second target flow estimates can be understood as follows:
[0201] First, obtain the first evaluation value and the second evaluation value. The first evaluation value, as described, can be used to characterize the predictive ability of the first target model. The second evaluation value, as mentioned, can be used to characterize the predictive ability of the second target model.
[0202] It should be noted that the calculation process for the first evaluation value can be understood by referring to the content of the aforementioned formula (12), and will not be repeated here. In addition, the calculation process for the second evaluation value can be understood by referring to the content of the aforementioned formula (14), and will not be repeated here.
[0203] After obtaining the first and second evaluation values, the sum of the first and second evaluation values is calculated to obtain the total model evaluation value. After calculating the total model evaluation value, the weights of the first target model are determined based on the first evaluation value and the total model evaluation value. Further, the first target flow rate estimate is weighted based on the weights of the first target model to obtain the weighted first target flow rate estimate. Similarly, after calculating the total model evaluation value, the weights of the second target model are determined based on the second evaluation value and the total model evaluation value. Further, the second target flow rate estimate is weighted based on the weights of the second target model to obtain the weighted second target flow rate estimate.
[0204] Thus, by summing the weighted first target flow estimate and the weighted second target flow estimate, the target flow estimate of the object to be estimated can be obtained.
[0205] As an illustrative description, the aforementioned target flow estimate satisfies the following formula (15), namely:
[0206]
[0207] in, This represents the estimated target cash flow of the object to be valued. This represents the weights of the first objective model. This indicates the first evaluation value. This indicates the second evaluation value. X1' represents the weights of the second objective model. X1' represents the first feature vector of the object to be estimated. X1 represents the first target flow rate estimate obtained by the first target model after estimating the first feature vector, where X1 represents the target feature vector of the object to be estimated. This represents the second target flow rate estimate obtained by the second target model after estimating the target feature vector.
[0208] In some optional examples, if the first target flow rate estimated by the above first target model is... In the case of non-positive numbers, the aforementioned methods can still be used. Figure 3 The third target flow rate estimate mentioned in formula (13) is used to correct the first target flow rate estimate. Specifically, in conjunction with formula (13), the target flow rate estimate satisfies the following formula (16), namely:
[0209]
[0210] Therefore, the total target flow estimate of the object to be estimated can be obtained using the first target model and the second target model, i.e.
[0211] In some alternative examples, the target flow rate estimate of the object to be estimated is calculated. Subsequently, the target revenue forecast can be displayed on the visualization interface, allowing business analysts to intuitively understand the target revenue forecast for the object to be estimated during the first online period, facilitating business analysis and other operations based on the target revenue forecast. Similarly, the revenue forecast for already online objects can also be displayed on the visualization interface to facilitate the study of the aforementioned forecasting models, such as the first initial model and the second initial model.
[0212] For example, Figure 9 This illustration shows a diagram of viewing the estimated flow rate from a visual display interface provided in this application. For example... Figure 9As shown, taking virtual games A and F that have not yet been launched as examples, if virtual games A and F need to be launched on March 25, 2024, with an estimated duration of one month, then, using the aforementioned first and second target models, the estimated target revenue for virtual game A within the next month (i.e., from March 25, 2024 to April 24, 2024) is 3,000,000. Similarly, using the aforementioned first and second target models, the estimated target revenue for virtual game F within the next month (i.e., from March 25, 2024 to April 24, 2024) is 2,000,000.
[0213] It should be noted that the above Figure 9 This application uses any unreleased virtual game A or virtual game F as an example for illustration, without making any specific limitations.
[0214] In some alternative examples, the first evaluation value (i.e., ...) is calculated during model iteration. ) and second evaluation value Its change curve can also be displayed on a visualization interface. For example, Figure 10 A schematic diagram showing the variation curve of the evaluation value provided in this application is illustrated. For example... Figure 10 As shown, on March 20, 2024, the first and second initial models were iteratively updated once, with first and second evaluation values of 0.387 and 0.412 on the validation set, and 0.99975 and 0.94661 on the training set, respectively. Similarly, on March 21, 2024, the first and second initial models were iteratively updated again, with first and second evaluation values of 0.372 and 0.469 on the validation set, and 0.99977 and 0.95244 on the training set, respectively. Similarly, on March 22, 2024, the first and second initial models were iteratively updated again, with first and second evaluation values of 0.385 and 0.379 on the validation set, and 0.99980 and 0.99397 on the training set, respectively.
[0215] It should be noted that the above Figure 10 The values mentioned are merely illustrative and are not specifically limited in this application. Furthermore, Figure 10 The training set scores shown can be used to measure the model's fit; a higher score indicates a better fit, meaning the model is trained more thoroughly. The model scores described can be understood as the aforementioned first evaluation value, second evaluation value, etc., and can be used to measure the model's generalization ability, i.e., its predictive performance.
[0216] The foregoing primarily describes the solutions provided by the embodiments of this application from a methodological perspective. It is understood that to achieve the above functions, corresponding hardware structures and / or software modules are included to execute each function. Those skilled in the art should readily recognize that, based on the modules and algorithm steps described in conjunction with the embodiments disclosed in this application, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0217] This application embodiment can divide the device into functional modules according to the above method example. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0218] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0219] The model training apparatus in the embodiments of this application will now be described in detail. Figure 11 This illustration shows optional functional modules of the model training apparatus provided in an embodiment of this application. For example... Figure 11 As shown, the model training device may include an acquisition unit 1101 and a processing unit 1102.
[0220] The acquisition unit 1101 is used to acquire the first sample. See the preceding description for details. Figure 3 The content described in step 301 should be understood, and will not be elaborated here.
[0221] Processing unit 1102 is used to extract the first sample feature vector of the first sample. See the foregoing for details. Figure 3 The content described in step 302 is for your understanding and will not be elaborated here.
[0222] Processing unit 1102 is used to obtain a second sample feature vector of the first sample based on the value of the first dummy variable and the first sample feature vector. The value of the first dummy variable is used to indicate whether the numerical feature in the first sample feature vector is a missing feature value. See the foregoing for details. Figure 3 The content described in step 303 is for your understanding and will not be elaborated here.
[0223] Processing unit 1102 is used to train a first initial model based on a second sample feature vector to obtain a first target model, and to train a second initial model based on the first sample feature vector to obtain a second target model. The first target model is used to predict the first feature vector of the object to be estimated to obtain a first target flow rate estimate. The second target model is used to predict the target feature vector of the object to be estimated to obtain a second target flow rate estimate. The first and second target flow rate estimates are used to determine the target flow rate estimate of the object to be estimated. The first feature vector is obtained from the value of a target dummy variable and the target feature vector. The value of the target dummy variable is used to indicate whether the numerical feature in the target feature vector is a missing feature value. See the foregoing for details. Figure 3 The content described in steps 304 and 305 is for your understanding and will not be repeated here.
[0224] In some optional implementations, the first initial model includes a factorization machine model; the processing unit 1102 is specifically used for: extracting a first expression to characterize the factorization machine model, the first expression being a function expression with the parameters to be estimated as independent variables and the predicted flow rate of the second sample feature vector as dependent variable, the parameters to be estimated including the global bias variable of the factorization machine model, the weight of the i-th feature variable in the second sample feature vector, and the latent vector of the i-th feature variable, where i is an integer greater than or equal to 1; solving the first-order partial derivative of the parameters to be estimated in the first expression to obtain the model gradient expression; calculating the gradient decay information of the parameters to be estimated based on the model gradient expression and the historical gradient information of the parameters to be estimated; calculating the target parameter value of the parameters to be estimated based on the gradient decay information of the parameters to be estimated, the preset learning rate, and the initial parameter value of the parameters to be estimated; and updating the model parameters of the factorization machine model based on the target parameter value to obtain the first target model.
[0225] In some alternative implementations, the processing unit 1102 is specifically configured to: obtain the gradient value of the parameter to be estimated at the (t-1)th iteration and the squared gradient value of the parameter to be estimated at the (t-1)th iteration from the historical gradient information of the parameter to be estimated; determine the gradient value of the parameter to be estimated at the tth iteration based on the model gradient expression and the gradient value at the (t-1)th iteration, and determine the gradient decay information of the parameter to be estimated at the tth iteration based on the gradient value at the tth iteration, where t is an integer greater than 0; determine the squared gradient value of the parameter to be estimated at the tth iteration based on the model gradient expression and the squared gradient value at the (t-1)th iteration, and determine the squared gradient decay information of the parameter to be estimated at the tth iteration based on the squared gradient value at the tth iteration.
[0226] In some alternative embodiments, the acquisition unit 1101 is specifically used to: acquire a first weight and a second weight, wherein the sum of the first weight and the second weight is 1. The processing unit 1102 is specifically used to: weight the model gradient expression based on the first weight to obtain a weighted model gradient expression, and weight the gradient value of the (t-1)th iteration based on the second weight to obtain a weighted gradient value of the (t-1)th iteration; sum the weighted model gradient expression and the weighted gradient value of the (t-1)th iteration to obtain the gradient value of the parameter to be estimated in the tth iteration; and determine the gradient decay information of the parameter to be estimated in the tth iteration based on the gradient value of the tth iteration and the second weight.
[0227] In some alternative implementations, the acquisition unit 1101 is specifically used to: acquire the third weight and the fourth weight, wherein the sum of the third weight and the fourth weight is 1. The processing unit 1102 is specifically used to: weight the model gradient expression based on the third weight to obtain the weighted model gradient expression, and weight the squared gradient value of the (t-1)th iteration based on the fourth weight to obtain the weighted squared gradient value of the (t-1)th iteration; sum the weighted model gradient expression and the weighted squared gradient value of the (t-1)th iteration to obtain the squared gradient value of the parameter to be estimated in the tth iteration; and determine the squared gradient decay information of the parameter to be estimated in the tth iteration based on the squared gradient value of the tth iteration and the fourth weight.
[0228] In some alternative implementations, the processing unit 1102 is specifically configured to: calculate the parameter change of the parameter to be estimated in the t-th iteration based on the gradient decay information of the t-th iteration, the gradient squared decay information of the t-th iteration, and a preset learning rate; calculate the difference between the initial parameter value of the t-th iteration and the parameter change of the t-th iteration to obtain the target parameter value of the parameter to be estimated in the t-th iteration, wherein the initial parameter value of the model parameter to be estimated includes the initial parameter value of the t-th iteration.
[0229] In some alternative embodiments, the processing unit 1102 is specifically configured to: determine a first feature value and a second feature value from the first sample feature vector, wherein the first feature value is a numerical feature in the first sample feature vector and the second feature value is a non-numerical feature in the first sample feature vector; set a first dummy variable for the first feature value and determine the value of the first dummy variable based on the missing value of the first feature value; and obtain the second sample feature vector of the first sample based on the value of the first dummy variable, the first feature value after setting the first dummy variable, and the second feature value.
[0230] In some alternative embodiments, the acquisition unit 1101 is further configured to: acquire a second sample for verification and the actual flow value of the second sample. The processing unit 1102 is further configured to: extract the sample feature vector of the second sample; based on the value of the second dummy variable and the sample feature vector of the second sample, obtain an updated sample feature vector of the second sample, wherein the value of the second dummy variable is used to indicate whether the numerical feature in the sample feature vector of the second sample is a missing feature value. The processing unit 1102 is further configured to: after training the first initial model based on the second sample feature vector to obtain the first target model, use the updated sample feature vector of the second sample as the input of the first target model to obtain the flow estimate of the second sample; calculate a first evaluation value based on the flow estimate of the second sample, the actual flow value of the second sample, and a first value, wherein the first value is the average value of the actual flow value of the second sample, and the first evaluation value is used to characterize the model prediction capability of the first target model; and stop training the first target model based on the second sample feature vector when the first evaluation value is greater than or equal to a first preset threshold.
[0231] In some alternative embodiments, the processing unit 1102 is further configured to: when the first target flow estimate is non-positive, perform logarithmic processing on the first feature vector to obtain the first flow estimate; perform logarithmic processing on the first flow estimate to obtain the third target flow estimate, and use the third target flow estimate to determine the target flow estimate of the object to be estimated by comparing it with the second target flow estimate.
[0232] In some alternative implementations, the second initial model includes an XGBoost model and a ridge regression model; the processing unit 1102 is specifically used to: perform one-hot encoding on the feature vector of the first sample based on the XGBoost model to obtain a first encoded feature vector; perform regression processing on the first encoded feature vector based on the ridge regression model to obtain a second flow rate estimate; and update the model parameters of the second initial model based on the difference between the second flow rate estimate and the actual flow rate value of the first sample to obtain a second target model.
[0233] In some alternative implementations, the XGBoost model includes M tree models, each tree model including at least one leaf node, where M is an integer greater than or equal to 2; the processing unit 1102 is specifically used for: numbering each leaf node in each tree model to obtain the numbering information of each leaf node, the numbering information being used to indicate the node position of the corresponding leaf node in the M tree models; determining the target numbering information of each feature point in the first sample feature vector, the target numbering information being the numbering information of the target leaf node in the M tree models where the corresponding feature point falls, the target leaf node being one of at least one leaf node; and performing one-hot encoding on the target numbering information of each feature point to obtain the first encoded feature vector corresponding to the first sample feature vector.
[0234] In some alternative embodiments, the acquisition unit 1101 is further configured to: acquire the third sample for verification and the actual flow value of the third sample. The processing unit 1102 is further configured to: extract the sample feature vector of the third sample. The processing unit 1102 is further configured to: after training the second initial model based on the first sample feature vector to obtain the second target model, use the sample feature vector of the third sample as the input of the second target model to obtain the flow estimate of the third sample; calculate a second evaluation value based on the flow estimate of the third sample, the actual flow value of the third sample, and the second value, wherein the second value is the average value of the actual flow value of the third sample, and the second evaluation value is used to characterize the model prediction capability of the second target model; and stop training the second initial model based on the first sample feature vector when the second evaluation value is greater than or equal to a second preset threshold.
[0235] The above Figure 11 The model training device is mainly described from the perspective of functional modules. The data processing device in the embodiments of this application will be described in detail below. Figure 12 This illustration shows an optional schematic diagram of the functional modules of the data processing apparatus provided in an embodiment of this application. For example... Figure 12 As shown, the data processing device may include an acquisition module 1201 and a processing module 1202.
[0236] The acquisition module 1201 is used to acquire the object to be estimated. See the preceding text for details. Figure 8 The content described in step 801 shown in the figure is for your understanding and will not be repeated here.
[0237] Processing module 1202 is used to extract the target feature vector of the object to be estimated. See the preceding description for details. Figure 8 The content described in step 801 shown in the figure is for your understanding and will not be repeated here.
[0238] Processing module 1202 is used to obtain the first feature vector of the object to be estimated based on the value of the target dummy variable and the target feature vector. The value of the target dummy variable is used to indicate whether the numerical features in the target feature vector are missing feature values. See the foregoing for details. Figure 8 The content described in step 802 shown in the figure is for your understanding and will not be repeated here.
[0239] Processing module 1202 is used to take the first feature vector as input to the first target model to obtain the first target pipeline prediction value, and to take the target feature vector as input to the second target model to obtain the second target pipeline prediction value. The first target model is a machine learning model obtained by training the first initial model with the second sample feature vector of the first sample as training data. The second target model is a machine learning model obtained by training the second initial model with the first sample feature vector of the first sample as training data. The second sample feature vector is obtained by taking the values of the first sample feature vector and the first dummy variable. The value of the first dummy variable is used to indicate whether the numerical feature of the first sample feature vector is a missing feature value. See the foregoing for details. Figure 8 The content described in step 803 shown in the figure is for your understanding and will not be repeated here.
[0240] Processing module 1202 is used to perform a weighted summation of the first target flow rate estimate and the second target flow rate estimate to obtain the target flow rate estimate of the object to be estimated. For details, please refer to the aforementioned... Figure 8 The content described in step 804 shown in the figure is for your understanding and will not be repeated here.
[0241] In some optional implementations, the acquisition module 1201 is further configured to: before performing a weighted summation of the first target flow rate estimate and the second target flow rate estimate to obtain the target flow rate estimate of the object to be estimated, acquire a first evaluation value and a second evaluation value, wherein the first evaluation value is used to characterize the model prediction capability of the first target model, and the second evaluation value is used to characterize the model prediction capability of the second target model. The processing module 1202 is specifically configured to: calculate the sum of the first evaluation value and the second evaluation value to obtain the total model evaluation value; determine the weight of the first target model based on the first evaluation value and the total model evaluation value, and perform a weighted summation of the first target flow rate estimate based on the weight of the first target model to obtain the weighted first target flow rate estimate; determine the weight of the second target model based on the second evaluation value and the total model evaluation value, and perform a weighted summation of the second target flow rate estimate based on the weight of the second target model to obtain the weighted second target flow rate estimate; and sum the weighted first target flow rate estimate and the weighted second target flow rate estimate to obtain the target flow rate estimate of the object to be estimated.
[0242] In some alternative implementations, the processing module 1202 is specifically configured to: determine a first target feature value and a second target feature value from the target feature vector, wherein the first target feature value is a numerical feature in the target feature vector and the second target feature value is a non-numerical feature in the target feature vector; set a target dummy variable for the first target feature value and determine the value of the target dummy variable based on the missing value of the first target feature value; and obtain the first feature vector of the object to be estimated based on the value of the target dummy variable, the first target feature value of the first dummy variable, and the second target feature value.
[0243] In some alternative implementations, the processing module 1202 is further configured to: perform a weighted summation of the first target flow estimate and the second target flow estimate to obtain the target flow estimate of the object to be estimated, and then display the target flow estimate on the visualization display interface.
[0244] The data processing device in the embodiments of this application has been described above from the perspective of modular functional entities. The data processing device in the embodiments of this application will now be described below from the perspective of hardware processing. Figure 13 This diagram illustrates an optional hardware structure of the data processing device provided in an embodiment of this application. The data processing device can vary considerably due to differences in configuration or performance, including but not limited to... Figure 11 The model training device shown in the figure Figure 12 The data processing device shown in the figure, etc. For example... Figure 13 As shown, the data processing device 300 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 322 (e.g., one or more processors) and a memory 332, and one or more storage media 330 (e.g., one or more mass storage devices) for storing application programs 342 or data 344. The memory 332 and storage media 330 may be temporary or persistent storage. The program stored in the storage media 330 may include one or more modules (not shown in the figure), each module including a series of instruction operations on the data processing device. Furthermore, the CPU 322 may be configured to communicate with the storage media 330 and execute the series of instruction operations in the storage media 330 on the data processing device 300. Exemplarily, the CPU 322 is used to execute the application program 342 stored in the storage media 330, thereby implementing the model training method or data processing method provided in the above embodiments of this application.
[0245] The data processing device 300 may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input / output interfaces 358, and / or one or more operating systems 341, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0246] For example, Figure 13 The central processing unit 322 can invoke computer execution instructions stored in memory 332 to cause the data processing device to perform actions such as... Figures 3 to 8 The method in the corresponding method embodiment.
[0247] Specifically, Figure 12 The processing module 1202 and Figure 11 The function / implementation process of the processing unit 1102 can be achieved through... Figure 13 The central processing unit 322 in the memory calls computer execution instructions stored in the memory 332 to achieve this. Figure 12 The acquisition module 1201 and Figure 11 The function / implementation process of the acquisition unit 1101 can be achieved through... Figure 13 It is implemented using the input / output interface 358.
[0248] The steps performed by the data processing device in the above embodiments can be based on this Figure 13 The data processing equipment structure is shown.
[0249] This application also provides a computer-readable storage medium storing a computer program or instructions thereon, which, when executed by a processor, implements the steps of the methods described in the foregoing embodiments.
[0250] This application also provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps of the methods described in the foregoing embodiments.
[0251] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0252] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0253] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0254] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0255] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0256] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0257] A computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, they generate, in whole or in part, the processes or functions according to embodiments of this application. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions may be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., SSDs), etc.
[0258] 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. However, 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.
Claims
1. A method for training a model, characterized in that, include: Obtain the first sample and extract the first sample feature vector from the first sample; Based on the value of the first dummy variable and the first sample feature vector, the second sample feature vector of the first sample is obtained. The value of the first dummy variable is used to indicate whether the numerical feature in the first sample feature vector is a missing feature value. The first initial model is trained based on the second sample feature vector to obtain a first target model, and the second initial model is trained based on the first sample feature vector to obtain a second target model. The first target model is used to predict the first feature vector of the object to be estimated to obtain a first target flow rate estimate. The second target model is used to predict the target feature vector of the object to be estimated to obtain a second target flow rate estimate. The first target flow rate estimate and the second target flow rate estimate are used to determine the target flow rate estimate of the object to be estimated. The first feature vector is obtained by the value of the target dummy variable and the target feature vector. The value of the target dummy variable is used to indicate whether the numerical feature in the target feature vector is a missing feature value.
2. The method according to claim 1, characterized in that, The first initial model includes a factorization machine model; the first initial model is trained based on the second sample feature vector to obtain a first target model, including: Extract a first expression to characterize the factorization machine model. This first expression is a functional expression with the parameters to be estimated as independent variables and the predicted flow rate of the second sample feature vector as the dependent variable. The parameters to be estimated include the global bias variable of the factorization machine model and the first bias variable in the second sample feature vector. i The weights of the i-th feature variables and the latent vector of the i-th feature variable, where i is an integer greater than or equal to 1; Solving for the first-order partial derivatives of the parameters to be estimated in the first expression yields the model gradient expression; Based on the model gradient expression and the historical gradient information of the parameter to be estimated, the gradient decay information of the parameter to be estimated is calculated. Based on the gradient decay information of the parameter to be estimated, the preset learning rate, and the initial parameter value of the parameter to be estimated, the target parameter value of the parameter to be estimated is calculated. The model parameters of the factorization machine model are updated based on the target parameter values to obtain the first target model.
3. The method according to claim 2, characterized in that, Based on the model gradient expression and the historical gradient information of the parameter to be estimated, the gradient decay information of the parameter to be estimated is calculated, including: The gradient value of the parameter to be estimated in the (t-1)th iteration and the squared gradient value of the parameter to be estimated in the (t-1)th iteration are obtained from the historical gradient information of the parameter to be estimated. Based on the model gradient expression and the gradient value of the (t-1)th iteration, the gradient value of the parameter to be estimated in the tth iteration is determined, and the gradient decay information of the parameter to be estimated in the tth iteration is determined based on the gradient value of the tth iteration, where t is an integer greater than 0. Based on the model gradient expression and the gradient squared value at the (t-1)th iteration, the gradient squared value of the parameter to be estimated at the tth iteration is determined, and the gradient squared decay information of the parameter to be estimated at the tth iteration is determined based on the gradient squared value at the tth iteration.
4. The method according to claim 3, characterized in that, Based on the model gradient expression and the gradient value of the (t-1)th iteration, the gradient value of the parameter to be estimated in the t-th iteration is determined, including: Obtain a first weight and a second weight, wherein the sum of the first weight and the second weight is 1; The model gradient expression is weighted based on the first weight to obtain the weighted model gradient expression, and the gradient value of the (t-1)th iteration is weighted based on the second weight to obtain the weighted gradient value of the (t-1)th iteration. The gradient value of the parameter to be estimated is obtained by summing the weighted model gradient expression and the weighted gradient value of the (t-1)th iteration. Determining the gradient decay information of the parameter to be estimated in the t-th iteration based on the gradient value of the t-th iteration includes: Based on the gradient value of the t-th iteration and the second weight, the gradient decay information of the parameter to be estimated in the t-th iteration is determined.
5. The method according to claim 3, characterized in that, Based on the model gradient expression and the squared gradient value of the (t-1)th iteration, the squared gradient value of the parameter to be estimated in the t-th iteration is determined, including: Obtain the third weight and the fourth weight, wherein the sum of the third weight and the fourth weight is 1; The model gradient expression is weighted based on the third weight to obtain the weighted model gradient expression, and the squared gradient value of the (t-1)th iteration is weighted based on the fourth weight to obtain the squared gradient value of the (t-1)th iteration. The weighted model gradient expression and the weighted squared gradient value of the (t-1)th iteration are summed to obtain the squared gradient value of the parameter to be estimated in the tth iteration. Determining the gradient squared decay information of the parameter to be estimated in the t-th iteration based on the gradient squared value of the t-th iteration includes: Based on the squared gradient value of the t-th iteration and the fourth weight, the squared gradient decay information of the parameter to be estimated in the t-th iteration is determined.
6. The method according to any one of claims 3 to 5, characterized in that, Based on the gradient decay information of the parameter to be estimated, the preset learning rate, and the initial parameter value of the parameter to be estimated, the target parameter value of the parameter to be estimated is calculated, including: Based on the gradient decay information of the t-th iteration, the gradient squared decay information of the t-th iteration, and the preset learning rate, calculate the parameter change of the parameter to be estimated in the t-th iteration; The difference between the initial parameter value of the t-th iteration and the parameter change in the t-th iteration is calculated to obtain the target parameter value of the parameter to be estimated in the t-th iteration. The initial parameter value of the model parameter to be estimated includes the initial parameter value of the t-th iteration.
7. The method according to any one of claims 1 to 6, characterized in that, Based on the value of the first dummy variable and the first sample feature vector, the second sample feature vector of the first sample is obtained, including: A first feature value and a second feature value are determined from the first sample feature vector, wherein the first feature value is a numerical feature in the first sample feature vector and the second feature value is a non-numerical feature in the first sample feature vector; A first dummy variable is set for the first feature value, and the value of the first dummy variable is determined based on the missing value of the first feature value; Based on the value of the first virtual variable, the first feature value and the second feature value of the first virtual variable are set to obtain the second sample feature vector of the first sample.
8. The method according to any one of claims 1 to 7, characterized in that, The method further includes: Obtain the second sample used for verification and the actual transaction value of the second sample; Extract the sample feature vector of the second sample; Based on the value of the second dummy variable and the sample feature vector of the second sample, the updated sample feature vector of the second sample is obtained. The value of the second dummy variable is used to indicate whether the numerical features in the sample feature vector of the second sample are missing feature values. After training the first initial model based on the second sample feature vector to obtain the first target model, the method further includes: The updated sample feature vector of the second sample is used as the input of the first target model to obtain the flow rate estimate of the second sample. Based on the estimated flow rate of the second sample, the actual flow rate of the second sample, and the first value, a first evaluation value is calculated. The first value is the average of the actual flow rate of the second sample. The first evaluation value is used to characterize the model prediction capability of the first target model. When the first evaluation value is greater than or equal to the first preset threshold, training of the first target model based on the second sample feature vector is stopped.
9. The method according to any one of claims 1 to 8, characterized in that, The method further includes: When the first target flow rate estimate is non-positive, the first feature vector is logarithmized to obtain the first flow rate estimate. The first flow rate estimate is logarithmically processed to obtain a third target flow rate estimate. The third target flow rate estimate is used to determine the target flow rate estimate of the object to be estimated by comparing it with the second target flow rate estimate.
10. The method according to claim 1, characterized in that, The second initial model includes an XGBoost model and a ridge regression model; the second initial model is trained based on the feature vector of the first sample to obtain the second target model, which includes: Based on the XGBoost model, the first sample feature vector is subjected to one-hot encoding to obtain the first encoded feature vector. The first encoded feature vector is regressed based on the ridge regression model to obtain the second flow rate estimate; Based on the difference between the second estimated flow rate and the actual flow rate of the first sample, the model parameters of the second initial model are updated to obtain the second target model.
11. The method according to claim 10, characterized in that, The XGBoost model comprises M tree models, each of which includes at least one leaf node, where M is an integer greater than or equal to 2; Based on the XGBoost model, the first sample feature vector is subjected to one-hot encoding to obtain the first encoded feature vector, including: Each leaf node in each tree model is numbered to obtain the numbering information of each leaf node. The numbering information is used to indicate the node position of the corresponding leaf node in the M tree models. Determine the target number information for each feature point in the first sample feature vector. The target number information is the number information of the target leaf node in the M tree models corresponding to the feature point. The target leaf node is one of the at least one leaf node. One-hot encoding is performed on the target number information of each feature point to obtain the first encoded feature vector corresponding to the first sample feature vector.
12. The method according to any one of claims 10 to 11, characterized in that, The method further includes: Obtain the third sample for verification and the actual flow value of the third sample; Extract the sample feature vector of the third sample; After training the second initial model based on the first sample feature vector to obtain the second target model, the method further includes: The sample feature vector of the third sample is used as the input of the second target model to obtain the flow rate prediction of the third sample. Based on the estimated flow rate of the third sample, the actual flow rate of the third sample, and the second value, a second evaluation value is calculated. The second value is the average of the actual flow rate of the third sample. The second evaluation value is used to characterize the model prediction capability of the second target model. When the second evaluation value is greater than or equal to the second preset threshold, training of the second initial model based on the first sample feature vector is stopped.
13. A data processing method, characterized in that, include: Obtain the object to be estimated and extract the target feature vector of the object to be estimated; Based on the value of the target dummy variable and the target feature vector, the first feature vector of the object to be estimated is obtained, wherein the value of the target dummy variable is used to indicate whether the numerical feature in the target feature vector is a missing feature value; The first feature vector is used as input to the first target model to obtain a first target flow prediction value, and the target feature vector is used as input to the second target model to obtain a second target flow prediction value. The first target model is a machine learning model obtained by training the first initial model with the second sample feature vector of the first sample as training data, and the second target model is a machine learning model obtained by training the second initial model with the first sample feature vector of the first sample as training data. The second sample feature vector is obtained by taking the values of the first sample feature vector and the first dummy variable. The value of the first dummy variable is used to indicate whether the numerical feature of the first sample feature vector is a missing feature value. The first target flow estimate and the second target flow estimate are weighted and summed to obtain the target flow estimate of the object to be estimated.
14. The method according to claim 13, characterized in that, Before performing a weighted summation of the first target flow estimate and the second target flow estimate to obtain the target flow estimate of the object to be estimated, the method further includes: Obtain a first evaluation value and a second evaluation value, wherein the first evaluation value is used to characterize the model prediction capability of the first target model, and the second evaluation value is used to characterize the model prediction capability of the second target model; The first target flow estimate and the second target flow estimate are weighted and summed to obtain the target flow estimate of the object to be estimated, including: Calculate the sum of the first evaluation value and the second evaluation value to obtain the total evaluation value of the model; The weights of the first target model are determined based on the first evaluation value and the total evaluation value of the model, and the first target flow rate estimate is weighted based on the weights of the first target model to obtain the weighted first target flow rate estimate. The weights of the second target model are determined based on the second evaluation value and the total evaluation value of the model, and the second target flow rate estimate is weighted based on the weights of the second target model to obtain the weighted second target flow rate estimate. The weighted first target flow estimate and the weighted second target flow estimate are summed to obtain the target flow estimate of the object to be estimated.
15. The method according to any one of claims 13 to 14, characterized in that, Based on the values of the target dummy variables and the target feature vector, the first feature vector of the object to be estimated is obtained, including: Determine a first target feature value and a second target feature value from the target feature vector, wherein the first target feature value is a numerical feature in the target feature vector and the second target feature value is a non-numerical feature in the target feature vector; A target dummy variable is set for the first target feature value, and the value of the target dummy variable is determined based on the missing value of the first target feature value; Based on the value of the target dummy variable, and by setting the first target feature value and the second target feature value of the target dummy variable, the first feature vector of the object to be estimated is obtained.
16. A model training device, characterized in that, include: The acquisition unit is used to acquire the first sample; The processing unit is used to extract the first sample feature vector of the first sample; The processing unit is used to obtain a second sample feature vector of the first sample based on the value of the first dummy variable and the first sample feature vector, wherein the value of the first dummy variable is used to indicate whether the numerical feature in the first sample feature vector is a missing feature value. The processing unit is configured to train a first initial model based on the second sample feature vector to obtain a first target model, and to train the second initial model based on the first sample feature vector to obtain a second target model. The first target model is used to predict the first feature vector of the object to be estimated to obtain a first target flow rate estimate. The second target model is used to predict the target feature vector of the object to be estimated to obtain a second target flow rate estimate. The first target flow rate estimate and the second target flow rate estimate are used to determine the target flow rate estimate of the object to be estimated. The first feature vector is obtained from the value of the target dummy variable and the target feature vector. The value of the target dummy variable is used to indicate whether the numerical feature in the target feature vector is a missing feature value.
17. A data processing apparatus, characterized in that, include: The acquisition module is used to acquire the object to be valued. The processing module is used to extract the target feature vector of the object to be estimated; The processing module is used to obtain a first feature vector of the object to be estimated based on the value of the target dummy variable and the target feature vector, wherein the value of the target dummy variable is used to indicate whether the numerical feature in the target feature vector is a missing feature value; The processing module is configured to use the first feature vector as input to a first target model to obtain a first target pipeline prediction value, and to use the target feature vector as input to a second target model to obtain a second target pipeline prediction value. The first target model is a machine learning model obtained by training a first initial model using the second sample feature vector of the first sample as training data. The second target model is a machine learning model obtained by training a second initial model using the first sample feature vector of the first sample as training data. The second sample feature vector is obtained by taking the values of the first sample feature vector and a first dummy variable. The value of the first dummy variable is used to indicate whether the numerical feature of the first sample feature vector is a missing feature value. The processing module is used to perform a weighted summation of the first target flow estimate and the second target flow estimate to obtain the target flow estimate of the object to be estimated.
18. A data processing device, characterized in that, include: Input / output interface, processor, and memory, wherein the memory stores program instructions; The processor is configured to execute the program instructions stored in the memory, and to perform the method as described in any one of claims 1 to 15.
19. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed on a computer device, cause the computer device to perform the method as described in any one of claims 1 to 15.
20. A computer program product, characterized in that, The computer program product includes instructions that, when executed on a computer device, cause the computer device to perform the method as described in any one of claims 1 to 15.