A task indicator data prediction method and system
By generating missing data in adversarial network fill task indicator data, the accuracy of the prediction model is improved, the problem of missing data affecting task completion is solved, and more efficient target task completion is achieved.
Patent Information
- Application Number
- CN202011302287.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-19
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2040-11-19
AI Technical Summary
The prior art predicts task index data due to the lack of data, which affects the completion of the target task.
A pre-trained generator is used to fill missing data based on the generation adversarial network, and a filled target time feature matrix is generated, and an prediction model is used to predict index data.
The prediction accuracy of indicator data is improved, the completion degree of target tasks is enhanced, and the task executors are assisted to complete the goals through accurate indicator data.
Smart Images

Figure CN112381303B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the field of data processing technology, and in particular, to a method and system for predicting task indicator data. Background Art
[0002] With the development of social economy, more and more stores have emerged, such as online stores and offline stores. In the actual operation of the store, in order to complete the target tasks, such as increasing sales and / or profits, it is necessary to issue indicator data corresponding to the target tasks to different stores, so as to conduct performance appraisal of store employees based on the indicator data. Therefore, it is necessary to propose a task indicator data prediction method and system to accurately predict the indicator data and improve the completion of the target tasks. Summary of the invention
[0003] One aspect of an embodiment of the present specification provides a task indicator data prediction method, the method comprising: obtaining original data related to a target task, the original data comprising at least historical feature data and time data; preprocessing the original data to obtain an initial time feature matrix; determining whether the initial time feature matrix includes missing data; if so, based on the initial time feature matrix, using a pre-trained generator to obtain a target time feature matrix after filling in the missing data, the generator being trained based on a generative adversarial network; processing the target time feature matrix using a pre-trained prediction model to determine the prediction indicator data for the target task.
[0004] One aspect of an embodiment of the present specification provides a task indicator data prediction system, the system comprising: an original data acquisition module, used to acquire original data related to a target task, the original data comprising at least historical feature data and time data; a preprocessing module, used to preprocess the original data to obtain an initial time feature matrix; a judgment module, used to judge whether the initial time feature matrix includes missing data; a filling module, used to obtain a target time feature matrix after filling the missing data based on the initial time feature matrix using a pre-trained generator when the missing data is included, the generator being trained based on a generative adversarial network; a determination module, used to process the target time feature matrix using a pre-trained prediction model to determine the prediction indicator data of the target task.
[0005] One aspect of an embodiment of the present specification provides a task indicator data prediction device, the device comprising a processor and a memory, the memory being used to store instructions, and the processor being used to execute the instructions to implement operations corresponding to the task indicator data prediction method as described in any of the preceding items.
[0006] One aspect of an embodiment of the present specification provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a processor, operations corresponding to the task indicator data prediction method described in any of the preceding items are implemented.
[0007] One aspect of an embodiment of the present specification provides a training method for a generator for filling missing data, wherein the generator is trained based on a generative adversarial network, wherein the generative adversarial network includes a generator and a discriminator, and the method includes: obtaining a plurality of first training samples including missing data, each first training sample including at least first sample historical feature data and first sample time data; each first training sample is related to a target task; based on the plurality of first training samples and the discriminator, iteratively updating the parameters of the generator to reduce the first target loss function value corresponding to each first training sample, to obtain a trained generator.
[0008] One aspect of an embodiment of the present specification provides a training system for a generator for filling missing data, wherein the generator is trained based on a generative adversarial network, wherein the generative adversarial network includes a generator and a discriminator, and the system includes: a first training sample acquisition module, used to acquire multiple first training samples including missing data, each first training sample includes at least first sample historical feature data and first sample time data; each first training sample is related to a target task; a generator training module, used to iteratively update the parameters of the generator based on the multiple first training samples and the discriminator to reduce the first target loss function value corresponding to each first training sample, so as to obtain a trained generator.
[0009] One aspect of an embodiment of the present specification provides a training device for a generator for filling missing data, the device comprising a processor and a memory, the memory being used to store instructions, and characterised in that the processor is used to execute the instructions to implement operations corresponding to the training method for a generator for filling missing data as described in any of the preceding items.
[0010] One aspect of an embodiment of the present specification provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a processor, operations corresponding to the training method for a generator for filling missing data as described in any of the preceding items are implemented.
[0011] One aspect of an embodiment of the present specification provides a method for training a prediction model for predicting indicator data of a target task, the method comprising: obtaining a plurality of second training samples containing complete data and carrying a second label, each second training sample comprising second sample historical feature data and second sample time data; the second training sample is related to the target task, and the second label is used to characterize the indicator data of the target task; iteratively updating the parameters of the initial prediction model based on the plurality of second training samples to reduce the third target loss function value corresponding to each second training sample, to obtain a trained prediction model; wherein the third target loss function value corresponding to each second training sample is determined by the following process: processing the second training sample through the initial prediction model to obtain the prediction indicator data of the target task; determining the third target loss function value based at least on the difference between the prediction indicator data and the second label.
[0012] One aspect of an embodiment of the present specification provides a training system for a prediction model for predicting indicator data of a target task, the system comprising: a second training sample acquisition module, used to acquire multiple second training samples containing complete data and carrying a second label, each second training sample comprising second sample historical feature data and second sample time data; the second training sample is related to the target task, and the second label is used to characterize the indicator data of the target task; a prediction model training module, used to iteratively update the parameters of an initial prediction model based on the multiple second training samples to reduce the third target loss function value corresponding to each second training sample, so as to obtain a trained prediction model; wherein the third target loss function value corresponding to each second training sample is determined by the following process: processing the second training sample through the initial prediction model to obtain the prediction indicator data of the target task; determining the third target loss function value based at least on the difference between the prediction indicator data and the second label.
[0013] One aspect of an embodiment of the present specification provides a task indicator data prediction device, which includes a processor and a memory, the memory is used to store instructions, and the processor is used to execute the instructions to implement operations corresponding to the training method of the prediction model for predicting the indicator data of the target task as described above.
[0014] One aspect of an embodiment of the present specification provides a computer-readable storage medium, and when the computer instructions are executed by a processor, the operations corresponding to the training method of the prediction model for predicting the indicator data of the target task as described above are implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] This specification will be further described in the form of exemplary embodiments, which will be described in detail by the accompanying drawings. These embodiments are not restrictive, and in these embodiments, the same number represents the same structure, wherein:
[0016] Figure 1 is a schematic diagram of an application scenario of a task indicator data prediction system according to some embodiments of this specification;
[0017] Figure 2 is a flowchart of a task indicator data prediction method according to some embodiments of this specification;
[0018] Figure 3 is a flowchart of determining a target time feature matrix according to some embodiments of this specification;
[0019] Figure 4 is a flowchart of a training method for a generator for filling missing data according to some embodiments of this specification;
[0020] Figure 5 is a flowchart of determining a first objective loss function value according to some embodiments of this specification;
[0021] Figure 6 is a flowchart of determining a first objective loss function value according to some embodiments of this specification;
[0022] Figure 7 is a schematic flow chart of a training method for a generator for filling missing data according to some embodiments of this specification;
[0023] Figure 8 is a flowchart of a method for training a prediction model for predicting indicator data of a target task according to some embodiments of this specification;
[0024] Fig. 9 is a module diagram of a task indicator data prediction system according to some embodiments of this specification;
[0025] Fig.10 is a module diagram of a training system for a generator for filling missing data according to some embodiments of this specification;
[0026] Fig.11 It is a module diagram of a training system for a prediction model for predicting indicator data of a target task according to some embodiments of this specification. DETAILED DESCRIPTION
[0027] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the following is a brief introduction to the drawings required for the description of the embodiments. Obviously, the drawings described below are only some examples or embodiments of this specification. For ordinary technicians in this field, this specification can also be applied to other similar scenarios based on these drawings without creative work. Unless it is obvious from the language environment or otherwise explained, the same reference numerals in the figures represent the same structure or operation.
[0028] It should be understood that the "system", "device", "unit" and / or "module" used in this specification is a method for distinguishing different components, elements, parts, parts or assemblies at different levels. However, if other words can achieve the same purpose, the words can be replaced by other expressions.
[0029] As shown in this specification and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "comprise" and "include" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.
[0030] Flowcharts are used in this specification to illustrate the operations performed by the system according to the embodiments of this specification. It should be understood that the preceding or following operations are not necessarily performed precisely in order. Instead, the steps may be processed in reverse order or simultaneously. At the same time, other operations may also be added to these processes, or one or more operations may be removed from these processes.
[0031] Figure 1 It is a schematic diagram of an application scenario of a task indicator data prediction system according to some embodiments of this specification.
[0032] like Figure 1 As shown, the task indicator data prediction system 100 may include a processing device 110 , a network 120 , and a user terminal 130 .
[0033] The processing device 110 can be used to process information and / or data associated with the prediction task indicator data to perform one or more functions disclosed in this specification. In some embodiments, the processing device 110 can be used to obtain raw data related to the target task. In some embodiments, the processing device 110 can pre-process the raw data to obtain an initial time feature matrix. In some embodiments, the processing device 110 can use a pre-trained generator based on the initial time feature matrix to obtain a target time feature matrix after filling in missing data. In some embodiments, the processing device 110 can use a pre-trained prediction model to process the target time feature matrix to determine the prediction indicator data for the target task.
[0034] In some embodiments, the processing device 110 may include one or more processing engines (e.g., a single-core processing engine or a multi-core processor). By way of example only, the processing device 110 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), an application specific instruction set processor (ASIP), a graphics processing unit (GPU), a physical processing unit (PPU), a digital signal processor (DSP), a field programmable gate array (FPGA), a programmable logic device (PLD), a controller, a microcontroller unit, a reduced instruction set computer (RISC), a microprocessor, or the like. One or more combinations thereof.
[0035] The network 120 can facilitate the exchange of information and / or data. In some embodiments, one or more components of the task indicator data prediction system 100 (e.g., the processing device 110, the user terminal 130) can transmit information to other components based on the task indicator data prediction system 100 through the network 120. For example, the processing device 110 can obtain the original data stored by the user terminal 130 through the network 120. For another example, the user terminal 130 can obtain the prediction indicator data of the target task determined by the processing device 110 through the network 120. In some embodiments, the network 120 can be any form of wired or wireless network, or any combination thereof. As an example only, the network 120 can be a wired network, a fiber optic network, a telecommunication network, an intranet, the Internet, a local area network (LAN), a wide area network (WAN), a wireless local area network (WLAN), a metropolitan area network (MAN), a wide area network (WAN), a public switched telephone network (PSTN), a Bluetooth network, etc. One or more combinations thereof.
[0036] The user terminal 130 may be a device with data acquisition, storage and / or transmission functions. In some embodiments, the user terminal 130 may include but is not limited to a mobile device 130-1, a tablet computer 130-2, a laptop computer 130-3, a desktop computer 130-4, etc. or any combination thereof. Exemplarily, the mobile device 130-1 may include but is not limited to a smart phone, a personal digital assistant (PDA), a handheld game console, a smart watch, a wearable device, a virtual display device, a display enhancement device, etc. or any combination thereof.
[0037] The technical solutions disclosed in the embodiments of this specification can be applied to scenarios of indicator data prediction. In some embodiments, the indicator data may be indicator data of a target task. For example, if the target task is to increase the sales volume and / or profit of a store, the indicator data may be a sales indicator and / or profit indicator of the store. For another example, if the target task is to increase the sales volume and / or profit of a product sold by a sales company, the indicator data may be a sales indicator and / or profit indicator of the product. As an example only, in some scenarios, the predicted indicator data may be sent to the corresponding task executor (e.g., the store manager, the company's salesperson, etc.) as a performance evaluation standard for the task executor to improve the final sales volume and / or profit.
[0038] In some embodiments, the acquired data related to the target task (e.g., historical feature data and time data) may be processed by a prediction model to obtain predicted index data, wherein the prediction model may include but is not limited to an XGBoost model, an RNN model, or an LSTM model, etc. However, when the acquired data contains a large amount of missing data, the prediction effect of the prediction model is poor, resulting in a large deviation in the predicted index data, resulting in poor completion of the final target task.
[0039] Therefore, an embodiment of the present specification discloses a method for predicting task indicator data, which uses a pre-trained generator to fill in the missing data contained in the acquired original data related to the target task, and then uses the prediction model to predict the indicator data. This not only accurately fills in the missing data, but also improves the prediction accuracy of the indicator data, thereby improving the completion of the target task.
[0040] The technical solution disclosed in this specification is described in detail below in conjunction with the accompanying drawings.
[0041] Figure 2 is a flowchart of a task indicator data prediction method according to some embodiments of this specification. Figure 2 As shown, the process 200 includes the following steps:
[0042] Step 202 , obtaining raw data related to the target task, wherein the raw data at least includes historical feature data and time data. In some embodiments, step 202 may be performed by the raw data obtaining module 810 .
[0043] In some embodiments, the target task may be related to the sales volume and / or profit of the preset object. For example, the target task may be to increase the sales volume and / or profit of the preset object. In some embodiments, the preset object may be specifically set according to actual needs. For example, the preset object may be a target store, a target enterprise and / or a target manufacturer, etc.
[0044] In some embodiments, the raw data may be data related to the target task. Correspondingly, the raw data may be data reflecting the sales volume and / or profit of a preset object. In some embodiments, the raw data may be data reflecting the sales volume and / or profit of a preset object in a preset historical time period.
[0045] In some embodiments, the original data includes at least historical feature data and time data. In some embodiments, the historical feature data may be data reflecting the sales volume and / or profit of a preset object. The time data may be the time corresponding to the sales volume and / or profit generated in a preset historical time period. It is understandable that the historical feature data and the time data have a corresponding relationship.
[0046] As mentioned above, in some embodiments, the target task may be related to the sales volume and / or profit of the target store. Correspondingly, the historical feature data may include one or more of the following data: historical sales data of the target object included in the target store, target store information, target object information, historical sales data of the target store, historical profit data of the target store, historical sales data of other stores related to the target store, and historical profit data of other stores; the time data may include one or more of the following data: date information, holiday information, and working day information.
[0047] In some embodiments, the target object included in the target store may be a manager of the target store, such as a store manager, a sales manager, a sales supervisor, etc. In some embodiments, the historical sales data of the target object included in the target store may include: attribute information of objects sold by the target object per unit time period within a preset historical time period, and / or sales information of objects sold by the target object per unit time period within a preset historical time period.
[0048] In some embodiments, the preset historical time period can be specifically set according to actual needs, for example, the past month, the past quarter, the past year, etc. In some embodiments, the unit time period can be flexibly set according to actual needs, for example, daily, weekly, monthly, etc.
[0049] In some embodiments, the attribute information of the object sold by the target object per unit time period may include one or more of the following data: the brand name, brand model, and cost price of the object sold by the target object every day. The sales information of the object sold by the target object per unit time period may include: the sales price and / or quantity of the object sold by the target object every day. It can be understood that the object sold is related to the target store. For example, if the target store is a store engaged in vehicle rental and / or vehicle sales, the object sold is a vehicle. For another example, if the target store is a store engaged in furniture sales, the object sold is furniture.
[0050] In some embodiments, the target store information may include one or more of the following data: the name of the target store, the address of the target store, the business model of the target store, the number of employees in the target store, and the opening time of the target store, etc.
[0051] In some embodiments, the target object information may include one or more of the following data: the qualifications of the target object, the historical assessment standards of the target object (eg, the historical indicator data of the target object), and the target object's employment time.
[0052] In some embodiments, the historical sales data of the target store may include: attribute information of objects sold by the target store within a preset historical time period, and / or sales information of objects sold by the target store within a preset historical time period. The attribute information and sales information of objects sold by the target store can be found in the above statements and will not be repeated here.
[0053] In some embodiments, the historical profit data of the target store may be the profit information generated by the target store within a preset historical time period. In some embodiments, other stores related to the target store may be other stores operated by the same company as the target store or other stores operated by other companies of the same type as the target store. For example, if the vehicle rental stores operated by Company A include Store 1, Store 2, and Store 3, and the vehicle rental stores operated by Company B include Store 4 and Store 5, if the target store is Store 1, then the other stores may be Store 2 and Store 3, or may be Store 4 and Store 5.
[0054] The historical sales data of other stores related to the target store and the historical profit data of other stores can be found in the historical sales data of the target store and the historical profit data of the target store respectively, which will not be repeated here.
[0055] In some embodiments, the raw data acquisition module 810 may acquire raw data related to the target task from the user terminal 130 or a storage device.
[0056] Step 204 , preprocessing the raw data to obtain an initial time feature matrix. In some embodiments, step 204 may be performed by the preprocessing module 820 .
[0057] In some embodiments, the initial time feature matrix may be a matrix generated based on historical feature data and time data, for example, a matrix generated with time data as the horizontal axis and historical feature data as the vertical axis.
[0058] In some embodiments, the preprocessing module 820 may preprocess the original data (i.e., historical feature data and time data) to obtain an initial time feature matrix. In some embodiments, the preprocessing includes one or more of the following processes: normalizing the historical feature data, performing outlier processing on the historical feature data, binning the time data, encoding the time data based on holiday information, encoding the time data based on working day information, performing outlier processing on the time data, and calculating the sales volume and profit of the target store based on the historical feature data.
[0059] In some embodiments, normalizing the historical feature data may be normalizing the price data included in the historical feature data. For example, the cost price and the sales price are normalized. By normalizing the price data, the price data can be unified in dimension, thereby avoiding the reduction of the prediction accuracy of the generator and the prediction model due to the confusion of the quotation.
[0060] In some embodiments, performing outlier processing on historical feature data may be processing abnormal data included in the historical feature data, wherein the abnormal data may refer to data whose deviation exceeds a preset range. The preset range may be specifically set according to actual needs. In some embodiments, processing the abnormal data may include: filling the abnormal data (for example, filling with a mode or mean, etc.) or determining the abnormal data as missing data.
[0061] In some embodiments, binning the time data may be binning the time data according to day, week, or month. For example, the corresponding historical feature data is divided into corresponding categories according to day, week, or month. In some embodiments, encoding the time data based on holiday information may be one-hot encoding the time data based on holiday information. For example, the time data corresponding to holidays is marked with "1", and the time data corresponding to non-holidays is marked with "0".
[0062] In some embodiments, encoding the time data based on the working day information may be one-hot encoding the time data based on the working day information. For example, the time data corresponding to the working day is marked with "1", and the time data corresponding to the non-working day is marked with "0".
[0063] In some embodiments, outlier processing of time data may be one-hot encoding of the time data corresponding to the outliers (or outlier data) included in the historical feature data. For example, the time data corresponding to the outliers is marked with "1", and the time data corresponding to the non-outliers is marked with "0". The embodiments of this specification can reduce the correlation of the features included in the initial time feature matrix and improve the prediction effect of the generator on missing data by encoding the time data.
[0064] In some embodiments, the sales volume and profit of the target store based on the historical feature data may be the sales volume and profit of the target store in a preset historical time period, for example, the sales volume and / or profit in the past month, or the sales volume and / or profit in the past quarter.
[0065] Step 206 , determining whether the initial time feature matrix includes missing data. In some embodiments, step 206 may be performed by the determination module 830 .
[0066] In some embodiments, missing data may represent that the historical feature data included in the initial time feature matrix is missing in the corresponding time data. For example, the initial time feature matrix A is:
[0067] <![CDATA[x 11 ]]> <![CDATA[x 21 ]]> <![CDATA[x 51 ]]> <![CDATA[x 12 ]]> <![CDATA[x 32 ]]> <![CDATA[x 52 ]]> <![CDATA[x 23 ]]> <![CDATA[x 43 ]]> <![CDATA[x 14 ]]> <![CDATA[x 34 ]]> <![CDATA[x 44 ]]>
[0068] Then the initial time feature matrix A includes missing data, which are eigenvalues x 21 The two eigenvalues and eigenvalue x included later 12 Then include an eigenvalue, eigenvalue x 32 Then include an eigenvalue, eigenvalue x 23 An eigenvalue, eigenvalue x, included before 23 Then include an eigenvalue, eigenvalue x 43 Then include an eigenvalue, eigenvalue x 14 Then include an eigenvalue, and the eigenvalue x 44 After that, an eigenvalue is included. Assuming that the horizontal axis of the initial time feature matrix A corresponds to the time t1, t2, t3, t4 and t5, the missing data: eigenvalue x 21 The two eigenvalues included later can indicate that the two eigenvalues are missing at the time data of t3 and t4 respectively. Missing data: eigenvalue x 12 A feature value included later may indicate that the feature value is missing in the time data of t2. And so on.
[0069] Step 208 , if yes, then based on the initial time feature matrix, a pre-trained generator is used to obtain a target time feature matrix after filling the missing data, wherein the generator is trained based on a generative adversarial network. In some embodiments, step 208 may be performed by the filling module 840 .
[0070] In some embodiments, the generator can be a pre-trained machine learning model. In some embodiments, the generator can be a bidirectional recurrent neural network model (Bi-directional Recurrent Neural Network, Bi-RNN).
[0071] In some embodiments, the generator can be trained based on a generative adversarial network. In some embodiments, the generative adversarial network can include a generator and a discriminator. The trained generator can process the initial time feature matrix with missing data to obtain a target time feature matrix after filling the missing data. For more information about the training process of the generator, please refer to Figure 4 And the related description will not be repeated here.
[0072] In some embodiments, the target time feature matrix can be a matrix obtained by filling the missing data in the initial time feature matrix. For details on determining the target time feature matrix, see Figure 3 And the related description will not be repeated here.
[0073] Step 210, using a pre-trained prediction model to process the target time feature matrix to determine the prediction index data of the target task.
[0074] In some embodiments, the prediction model can be a pre-trained machine learning model. In some embodiments, the prediction model can include an Extreme Gradient Boosting (XGBoost), a Recurrent Neural Network (RNN), or a Long-Short Term Memory (LSTM). The trained prediction model can process the target time feature matrix to determine the prediction index data of the target task. For more information about the training process of the prediction model, please refer to Figure 7 And the related description will not be repeated here.
[0075] In some embodiments, the prediction indicator data may be related to a target task. For example, if the target task is to increase the sales volume and / or profit of a store, the prediction indicator data may be a predicted store sales indicator and / or store profit indicator.
[0076] The embodiments of this specification accurately fill in the missing data included in the initial time feature matrix through a generator, and then input the filled target time feature matrix into the prediction model to predict the index data. This avoids the prediction model from directly processing the time feature data containing missing data, improves the prediction accuracy of the prediction model, and then can assist in the completion of the target task through accurate index data, thereby improving the completion of the target task. For example, if the target task is to increase the sales volume and / or profit of a store, the predicted sales volume index and / or profit index can be used to assist in determining the assessment criteria for the store manager, and then the assessment criteria can be used to promote the store manager to complete the target task.
[0077] Figure 3 FIG. 1 is a flow chart of determining a target time feature matrix according to some embodiments of this specification. Figure 3 As shown, the process 300 may include step 302, step 304, and step 306. In some embodiments, step 302, step 304, and step 306 may be performed by the filling module 840.
[0078] Step 302, performing forward calculation and backward calculation on the initial time feature matrix respectively to determine a forward matrix and a backward matrix.
[0079] In some embodiments, the forward calculation may be to use the first column vector of the initial time feature matrix as the starting direction, and sequentially calculate the values of each element in the initial time feature matrix. In some embodiments, the backward calculation may be to use the last column vector of the initial time feature matrix as the starting direction, and sequentially calculate the values of each element in the initial time feature matrix.
[0080] In some embodiments, the filling module 840 can be further used to: use the first column vector of the initial time feature matrix as the starting direction, calculate the distance between each element value in the initial time feature matrix and its nearest neighbor element value in turn, and determine the forward matrix; and use the last column vector of the initial time feature matrix as the starting direction, calculate the distance between each element value in the initial time feature matrix and its nearest neighbor element value in turn, and determine the backward matrix.
[0081] In some embodiments, the starting direction may also be a direction for determining the nearest neighbor element value. In some embodiments, calculating the distance between each element value in the initial time feature matrix and its nearest neighbor element value may be: calculating the distance between each element value in the initial time feature matrix and the nearest neighbor element value determined toward the starting direction. In some embodiments, the distance may be a lateral distance.
[0082] For example, still using the above initial time feature matrix A:
[0083] <![CDATA[x 11 ]]> <![CDATA[x 21 ]]> <![CDATA[x 51 ]]> <![CDATA[x 12 ]]> <![CDATA[x 32 ]]> <![CDATA[x 52 ]]> <![CDATA[x 23 ]]> <![CDATA[x 43 ]]> <![CDATA[x 14 ]]> <![CDATA[x 34 ]]> <![CDATA[x 44 ]]> For example,
[0084] When calculating the forward matrix, since x 11 The elements included in the first column vector have no nearest neighbor element value facing the starting direction, then the forward matrix with x 11 The element value at the corresponding position is 0; since x 21 The nearest neighbor element value facing the starting direction is x 11 , the distance between the two is 1, then the forward matrix is 21 The element value at the corresponding position is 1; since x 21 The nearest neighbor element value of the next eigenvalue is x 21 , the distance between the two is 1, then the forward matrix is 21 The element value of the position corresponding to the next eigenvalue is 1; and so on, the forward matrix is:
[0085] 0 1 1 2 3 0 1 2 1 2 0 1 1 2 1 0 1 2 1 1
[0086] Similarly, the calculated backward matrix is:
[0087] 1 3 2 1 0 2 1 2 1 0 1 2 1 1 0 2 1 1 1 0
[0088] Step 304: Utilize the generator to fill in the missing data included in the initial time feature matrix based on the forward matrix and the backward matrix, respectively, to determine a forward interpolation matrix and a backward interpolation matrix.
[0089] In some embodiments, the forward interpolation matrix may be a matrix determined by filling the missing data included in the initial time feature matrix based on the forward matrix using the generator. The backward interpolation matrix may be a matrix determined by filling the missing data included in the initial time feature matrix based on the backward matrix using the generator.
[0090] Step 306: Perform a weighted operation on the forward interpolation matrix and the backward interpolation matrix to determine the target time feature matrix.
[0091] In some embodiments, the weighting operation may include, but is not limited to, a weighted averaging operation.
[0092] Figure 4 1 is a flowchart of a training method for a generator for filling missing data according to some embodiments of this specification. In some embodiments, the generator can be trained based on a generative adversarial network. The generative adversarial network includes a generator and a discriminator. Figure 4 As shown, the process 400 may include the following steps:
[0093] Step 402 , obtaining a plurality of first training samples including missing data, each first training sample including at least first sample historical feature data and first sample time data; each first training sample is related to a target task. In some embodiments, step 402 may be performed by the first training sample acquisition module 910 .
[0094] In some embodiments, the first training sample may be training data for training the generator. In some embodiments, the first training sample is related to the target task. For details about the target task, please refer to step 202 and its related description, which will not be repeated here.
[0095] In some embodiments, the first training sample includes at least first sample historical feature data and first sample time data. In some embodiments, the target task is related to the sales volume and / or profit of the sample store, and the first sample historical feature data includes one or more of the following data: historical sales data of the sample objects included in the sample store, sample store information, sample object information, historical sales data of the sample store, historical profit data of the sample store, historical sales data of other stores related to the sample store, and historical profit data of other stores. In some embodiments, the first sample time data includes one or more of the following data: date information, holiday information, and working day information. For specific details about the first training sample, please refer to the above step 202 and its related description, which will not be repeated here.
[0096] Step 404, based on the multiple first training samples and the discriminator, iteratively update the parameters of the generator to reduce the first objective loss function value corresponding to each first training sample, to obtain a trained generator. In some embodiments, step 402 can be performed by the generator training module 920.
[0097] In some embodiments, iteratively updating the parameters of the generator based on the discriminator may refer to iteratively updating the parameters of the generator based on the target loss function value (e.g., the third target loss function value) corresponding to the discriminator.
[0098] During the training process of the generator, the generator training module 920 will continuously update the parameters of the generator based on the target loss function values corresponding to the multiple first training samples and the discriminator to obtain a trained generator. Specifically, the generator training module 920 will continuously adjust the parameters of the generator to reduce the first target loss function values corresponding to each first training sample so that the first target loss function value meets the preset conditions. For example, the first target loss function value converges, or the first target loss function value is less than the preset value. For details on determining the first target loss function value, please refer to Figure 5 And the related description will not be repeated here.
[0099] It can be understood that when the first objective loss function meets the preset conditions, the generator training is completed and a trained generator is obtained. The trained generator can obtain a target time feature matrix after filling the missing data based on the initial time feature matrix, that is, fill the missing data in the original data.
[0100] Figure 5 is a flowchart of determining the first objective loss function value according to some embodiments of this specification. Figure 5 As shown, the process 500 may include steps 502, 504, 506, 508, 510, and 512. In some embodiments, steps 502, 504, 506, 508, 510, and 512 may be performed by the generator training module 920.
[0101] Step 502: preprocess the first training sample to obtain an initial time feature matrix of the sample.
[0102] In some embodiments, the preprocessing may include one or more of the following processes: normalizing the first sample historical feature data, performing outlier processing on the first sample historical feature data, binning the first sample time data, encoding the first sample time data based on holiday information, encoding the first sample time data based on working day information, performing outlier processing on the first sample time data, and calculating the sales volume and profit of the sample store based on the first sample historical feature data. For the specific details of step 502 and preprocessing, please refer to step 204 and its related description, which will not be repeated here.
[0103] Step 504: Perform forward calculation and backward calculation on the sample initial time feature matrix to determine a sample forward matrix and a sample backward matrix.
[0104] In some embodiments, forward calculation and backward calculation are performed on the sample initial time feature matrix respectively to determine the sample forward matrix and the sample backward matrix, including: taking the first column vector of the sample initial time feature matrix as the starting direction, calculating the distance between each element value in the sample initial time feature matrix and its nearest neighbor element value in turn, and determining the sample forward matrix; and taking the last column vector of the sample initial time feature matrix as the starting direction, calculating the distance between each element value in the sample initial time feature matrix and its nearest neighbor element value in turn, and determining the sample backward matrix. For the specific details of step 504, please refer to step 302 and its related description, which will not be repeated here.
[0105] Step 506: Utilize the generator to fill in the missing data included in the sample initial time feature matrix based on the sample forward matrix and the sample backward matrix, respectively, to determine a sample forward interpolation matrix and a sample backward interpolation matrix.
[0106] For specific details of step 506, please refer to step 304 and its related description, which will not be repeated here.
[0107] Step 508: Perform a weighted operation on the sample forward interpolation matrix and the sample backward interpolation matrix to determine a sample target time feature matrix.
[0108] For the specific details of step 508, please refer to step 306 and its related description, which will not be repeated here.
[0109] Step 510: Use the discriminator to process the sample target time feature matrix to obtain a probability matrix.
[0110] In some embodiments, the discriminator can be a bidirectional long short-term memory model (Bi-directional Long-short Term Memory, Bi-LSTM) or a bidirectional encoder representation based on Transformer (BidirectionalEncoder Representations from Transformers, BERT), etc. In some embodiments, the probability matrix can be used to characterize the probability that the element values included in the sample target time feature matrix belong to real data. In some embodiments, the real data can be non-filled data, that is, non-missing data.
[0111] Step 512, determine the first objective loss function value based on the sample initial time feature matrix, the sample target time feature matrix, the sample forward interpolation matrix, the sample backward interpolation matrix, the probability matrix, and the first label of the missing data and the real data used to characterize the sample initial time feature matrix.
[0112] In some embodiments, the first label can be used to characterize the missing data and real data of the sample initial time feature matrix. As mentioned above, the real data can be non-filled data, that is, non-missing data. In some embodiments, the missing data of the sample initial time feature matrix can be marked as 0, and the real data can be marked as 1 to obtain the first label. For example, taking the above initial time feature matrix A as the sample initial time feature matrix as an example, the first label can be:
[0113] 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0
[0114] In some embodiments, the first target loss function value is the target loss function value corresponding to the generator. For details on determining the first target loss function value, see Figure 6 And the related description will not be repeated here.
[0115] Figure 6 is a flowchart of determining the first objective loss function value according to some embodiments of this specification. Figure 6 As shown, the process 600 may include step 602, step 604, step 606, and step 608. In some embodiments, step 602, step 604, step 606, and step 608 may be performed by the generator training module 920.
[0116] Step 602: Determine a first loss function value based on the difference between the sample initial time feature matrix and the sample target time feature matrix.
[0117] In some embodiments, the first loss function value can be used to evaluate the difference between the sample initial time feature matrix and the sample target time feature matrix. In some embodiments, the first loss function value can include but is not limited to a cross entropy loss function value, a mean square error loss function value, or an exponential loss function value.
[0118] Step 604: Determine a second loss function value based on the difference between the sample forward interpolation matrix and the sample backward interpolation matrix.
[0119] In some embodiments, the second loss function value may be used to evaluate the difference between the sample forward interpolation matrix and the sample backward interpolation matrix. In some embodiments, the second loss function value may include but is not limited to a cross entropy loss function value, a mean square error loss function value, or an exponential loss function value.
[0120] Step 606: Determine a third loss function value based on the difference between the probability matrix and the first label.
[0121] In some embodiments, the third loss function value can be used to evaluate the difference between the probability matrix and the first label. In some embodiments, the third loss function value can include but is not limited to a cross entropy loss function value, a mean square error loss function value, or an exponential loss function value, etc.
[0122] In some embodiments, the training method of the generator for filling missing data further includes: based on the third loss function values corresponding to multiple first training samples, iteratively updating the parameters of the discriminator to reduce the second target loss function value corresponding to each first training sample, to obtain a trained discriminator.
[0123] During the training process of the discriminator, the discriminator training module 930 will continuously update the parameters of the discriminator based on the third loss function values corresponding to the multiple first training samples to obtain a trained discriminator. Specifically, the discriminator training module 930 will continuously adjust the parameters of the discriminator to reduce the second target loss function values corresponding to each first training sample so that the second target loss function value meets the preset conditions. For example, the second target loss function value converges, or the second target loss function value is less than the preset value. When the second target loss function meets the preset conditions, the discriminator training is completed and a trained discriminator is obtained.
[0124] Step 608: Determine the first target loss function value based at least on the sum of the first loss function value, the second loss function value, and the third loss function value.
[0125] In order to explain the training method of the generator more clearly and completely, Figure 7 is a schematic flowchart of a training method for a generator for filling missing data according to some embodiments of the present specification.
[0126] like Figure 7 As shown in the process 700, the generator can obtain the sample forward interpolation matrix and the sample backward interpolation matrix based on the sample initial time feature matrix, the sample forward matrix and the sample backward matrix. The sample forward interpolation matrix and the sample backward interpolation matrix can obtain the sample target time feature matrix through weighted operation.
[0127] The first target loss function value of the generator includes a first loss function value determined by the sample initial time feature matrix and the sample target time feature matrix, a second loss function value determined by the sample forward interpolation matrix and the sample backward interpolation matrix, and a third loss function value determined by the probability matrix output by the discriminator and the first label. The second target loss function value of the discriminator includes a third loss function value determined by the probability matrix output by the discriminator and the first label.
[0128] The embodiments of this specification use the first loss function value and the second loss function value as components of the first target loss function value of the generator. As the generator is continuously trained, the sample target time feature matrix and the sample initial time feature matrix become closer and closer, and the sample forward interpolation matrix and the sample backward interpolation matrix become closer and closer. By jointly training the generator with multiple loss function values, the prediction effect of the trained generator can be improved, and the accuracy of the generator in filling missing data can be improved.
[0129] At the same time, the embodiment of this specification adopts adversarial training on the generator based on the generative adversarial network to obtain a trained generator, that is, the third loss function value of the discriminator is used as a component of the first target loss function value of the generator. Through this adversarial training method, the missing data filled by the generator is very close to the real data. At the same time, the very powerful discriminator cannot accurately judge the authenticity of the missing data filled by the generator, which further improves the accuracy of the generator in filling the missing data.
[0130] Figure 8 1 is a flowchart of a method for training a prediction model for predicting indicator data of a target task according to some embodiments of this specification. Figure 8 As shown, the process 800 may include the following steps:
[0131] Step 802, obtaining a plurality of second training samples containing complete data and carrying a second label, each second training sample including second sample historical feature data and second sample time data; the second training sample is related to the target task, and the second label is used to characterize the indicator data of the target task. In some embodiments, step 702 can be performed by the second training sample acquisition module 1010.
[0132] In some embodiments, the target task is related to the sales volume and / or profit of the sample store, and the second sample historical feature data includes one or more of the following data: historical sales data of the sample object included in the sample store, sample store information, sample object information, historical sales data of the sample store, historical profit data of the sample store, historical sales data of other stores related to the sample store, and historical profit data of other stores; the second sample time data includes one or more of the following data: date information, holiday information, and working day information. For specific details about the second training sample, please refer to step 202 and its related description, which will not be repeated here.
[0133] In some embodiments, the second tag is used to characterize the indicator data of the target task. For example, if the target task is to increase the sales volume and / or profit of the sample store, the second tag may be the sales volume indicator and / or profit indicator of the sample store.
[0134] In some embodiments, the second training sample may be annotated with the second label by manual annotation. In some embodiments, the second training sample acquisition module 1010 may acquire the training sample from a storage device of the processing device 110 .
[0135] Step 804 , iteratively update the parameters of the initial prediction model based on the plurality of second training samples to reduce the third objective loss function value corresponding to each second training sample, and obtain a trained prediction model. In some embodiments, step 704 may be performed by the prediction model training module 1020 .
[0136] During the training process of the prediction model, the prediction model training module 1020 will continuously update the parameters of the initial prediction model based on multiple second training samples. Specifically, the prediction model training module 1020 will continuously adjust the parameters of the initial prediction model to reduce the third target loss function value corresponding to each second training sample so that the third target loss function value meets the preset conditions. For example, the third target loss function value converges, or the third target loss function value is less than the preset value. When the third target loss function meets the preset conditions, the model training is completed and a trained prediction model is obtained. The trained prediction model can obtain the prediction index data of the target task based on the historical feature data and time data related to the target task without missing data.
[0137] In some embodiments, the third target loss function value corresponding to each second training sample can be determined by the following process: the second training sample is processed by the initial prediction model to obtain the prediction index data of the target task, and the third target loss function is determined based on at least the difference between the prediction index data and the second label. In some embodiments, the third target loss function value may include but is not limited to a cross entropy loss function value, a mean square error loss function value, or an exponential loss function value.
[0138] Fig. 9 is a module diagram of a task indicator data prediction system according to some embodiments of this specification. Fig. 9 As shown, the task indicator data prediction system 900 may include a raw data acquisition module 910 , a preprocessing module 920 , a judgment module 930 , a filling module 940 , and a determination module 950 .
[0139] In some embodiments, the raw data acquisition module 910 may be used to acquire raw data related to the target task, where the raw data includes at least historical feature data and time data.
[0140] In some embodiments, the preprocessing module 920 may be used to preprocess the raw data to obtain an initial time feature matrix.
[0141] In some embodiments, the determination module 930 may be used to determine whether the initial time feature matrix includes missing data.
[0142] In some embodiments, the filling module 940 can be used to obtain a target time feature matrix after filling the missing data based on the initial time feature matrix using a pre-trained generator in the case of missing data, where the generator is trained based on a generative adversarial network.
[0143] In some embodiments, the determination module 950 may be used to process the target time feature matrix using a pre-trained prediction model to determine prediction index data for the target task.
[0144] Fig.10 is a module diagram of a training system for a generator for filling missing data according to some embodiments of this specification. Fig.10 As shown, the generator training system 1000 may include a first training sample acquisition module 1010 , a generator training module 1020 , and a discriminator training module 1030 .
[0145] In some embodiments, the first training sample acquisition module 1010 can be used to acquire multiple first training samples including missing data, each first training sample at least including first sample historical feature data and first sample time data; each first training sample is related to the target task.
[0146] In some embodiments, the generator training module 1020 can be used to iteratively update the parameters of the generator based on multiple first training samples and discriminators to reduce the first objective loss function value corresponding to each first training sample to obtain a trained generator.
[0147] Fig.11 1 is a block diagram of a training system for a prediction model for predicting indicator data of a target task according to some embodiments of this specification. Fig.11 As shown, the prediction model training system 1100 may include a second training sample acquisition module 1110 and a prediction model training module 1120 .
[0148] In some embodiments, the second training sample acquisition module 1110 can be used to acquire multiple second training samples containing complete data and carrying second labels, each second training sample including second sample historical feature data and second sample time data; the second training sample is related to the target task, and the second label is used to characterize the indicator data of the target task.
[0149] In some embodiments, the prediction model training module 1120 can be used to iteratively update the parameters of the initial prediction model based on multiple second training samples to reduce the third target loss function value corresponding to each second training sample to obtain a trained prediction model; wherein the third target loss function value corresponding to each second training sample is determined by the following process: processing the second training sample through the initial prediction model to obtain prediction index data for the target task; determining the third target loss function value based at least on the difference between the prediction index data and the second label.
[0150] It should be understood that the above-mentioned system and its modules can be implemented in various ways. For example, in some embodiments, the system and its modules can be implemented by hardware, software or a combination of software and hardware. Among them, the hardware part can be implemented by dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or a dedicated design hardware. Those skilled in the art will understand that the above-mentioned methods and systems can be implemented using computer executable instructions and / or included in a processor control code, for example, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the system and its modules of this specification. Not only can the hardware circuits such as ultra-large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc. be implemented, it can also be implemented by software such as executed by various types of processors, and it can also be implemented by a combination of the above-mentioned hardware circuits and software (for example, firmware).
[0151] It should be noted that the above description of each module is only for convenience of description and does not limit this specification to the scope of the embodiments. It is understandable that for those skilled in the art, after understanding the principle of the system, it is possible to arbitrarily combine the modules or form a subsystem connected with other modules without deviating from this principle. Such variations are all within the scope of protection of this specification.
[0152] An embodiment of the present specification also provides a task indicator data prediction device, which includes a processor and a memory, the memory is used to store instructions, and the processor is used to execute the instructions to implement operations corresponding to the task indicator data prediction method as described in any of the preceding items.
[0153] An embodiment of the present specification also provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a processor, operations corresponding to the task indicator data prediction method described in any of the preceding items are implemented.
[0154] An embodiment of the present specification also provides a training device for a generator for filling missing data, the device comprising a processor and a memory, the memory being used to store instructions, and the processor being used to execute the instructions to implement operations corresponding to the training method for a generator for filling missing data as described in any of the preceding items.
[0155] An embodiment of the present specification also provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a processor, operations corresponding to the training method for a generator for filling missing data as described in any of the preceding items are implemented.
[0156] An embodiment of the present specification also provides a training device for a prediction model for predicting indicator data of a target task, the device comprising a processor and a memory, the memory being used to store instructions, and the processor being used to execute the instructions to implement operations corresponding to the training method for a prediction model for predicting indicator data of a target task as described above.
[0157] An embodiment of this specification also provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a processor, operations corresponding to the training method of a prediction model for predicting indicator data of a target task as described in claim 29 are implemented.
[0158] It should be noted that different embodiments may produce different beneficial effects. In different embodiments, the beneficial effects that may be produced may be any one or a combination of the above, or any other beneficial effects that may be obtained.
[0159] The basic concepts have been described above. Obviously, for those skilled in the art, the above detailed disclosure is only for example and does not constitute a limitation of this specification. Although not explicitly stated here, those skilled in the art may make various modifications, improvements and corrections to this specification. Such modifications, improvements and corrections are suggested in this specification, so such modifications, improvements and corrections still belong to the spirit and scope of the exemplary embodiments of this specification.
[0160] At the same time, this specification uses specific words to describe the embodiments of this specification. For example, "one embodiment", "an embodiment", and / or "some embodiments" refer to a certain feature, structure or characteristic related to at least one embodiment of this specification. Therefore, it should be emphasized and noted that "one embodiment" or "an embodiment" or "an alternative embodiment" mentioned twice or more in different positions in this specification does not necessarily refer to the same embodiment. In addition, certain features, structures or characteristics in one or more embodiments of this specification can be appropriately combined.
[0161] In addition, it will be understood by those skilled in the art that various aspects of this specification may be illustrated and described by a number of patentable categories or situations, including any new and useful process, machine, product or combination of substances, or any new and useful improvements thereto. Accordingly, various aspects of this specification may be performed entirely by hardware, entirely by software (including firmware, resident software, microcode, etc.), or by a combination of hardware and software. The above hardware or software may be referred to as "data blocks", "modules", "engines", "units", "components" or "systems". In addition, various aspects of this specification may be represented as a computer product located in one or more computer-readable media, which includes computer-readable program code.
[0162] A computer storage medium may include a propagated data signal containing computer program code, for example, in baseband or as part of a carrier wave. The propagated signal may be in a variety of forms, including electromagnetic, optical, etc., or a suitable combination. A computer storage medium may be any computer-readable medium other than a computer-readable storage medium, which can be connected to an instruction execution system, device or apparatus to communicate, propagate or transmit the program for use. The program code on the computer storage medium may be transmitted via any suitable medium, including radio, cable, fiber optic cable, RF, or similar media, or any combination of the above media.
[0163] The computer program code required for the operation of each part of this specification can be written in any one or more programming languages, including object-oriented programming languages such as Java, Scala, Smalltalk, Eiffel, JADE, Emerald, C++, C#, VB.NET, Python, etc., conventional procedural programming languages such as C language, Visual Basic, Fortran2003, Perl, COBOL2002, PHP, ABAP, dynamic programming languages such as Python, Ruby and Groovy, or other programming languages, etc. The program code can be run entirely on the user's computer, or run on the user's computer as an independent software package, or run partially on the user's computer and partially on a remote computer, or run entirely on a remote computer or processing device. In the latter case, the remote computer can be connected to the user's computer through any network form, such as a local area network (LAN) or a wide area network (WAN), or connected to an external computer (e.g., via the Internet), or in a cloud computing environment, or used as a service such as software as a service (SaaS).
[0164] In addition, unless explicitly stated in the claims, the order of the processing elements and sequences described in this specification, the use of alphanumeric characters, or the use of other names are not intended to limit the order of the processes and methods of this specification. Although the above disclosure discusses some invention embodiments that are currently considered useful through various examples, it should be understood that such details are only for illustrative purposes, and the attached claims are not limited to the disclosed embodiments. On the contrary, the claims are intended to cover all modifications and equivalent combinations that are consistent with the essence and scope of the embodiments of this specification. For example, although the system components described above can be implemented by hardware devices, they can also be implemented only by software solutions, such as installing the described system on an existing processing device or mobile device.
[0165] Similarly, it should be noted that in order to simplify the description disclosed in this specification and thus help understand one or more embodiments of the invention, in the above description of the embodiments of this specification, multiple features are sometimes combined into one embodiment, figure or description thereof. However, this disclosure method does not mean that the features required by the subject matter of this specification are more than the features mentioned in the claims. In fact, the features of the embodiments are less than all the features of the single embodiment disclosed above.
[0166] In some embodiments, numbers describing the number of components and attributes are used. It should be understood that such numbers used in the description of the embodiments are modified by the modifiers "about", "approximately" or "substantially" in some examples. Unless otherwise specified, "about", "approximately" or "substantially" indicate that the numbers are allowed to vary by ±20%. Accordingly, in some embodiments, the numerical parameters used in the specification and claims are approximate values, which may change according to the required features of individual embodiments. In some embodiments, the numerical parameters should take into account the specified significant digits and adopt the general method of retaining digits. Although the numerical domains and parameters used to confirm the breadth of their range in some embodiments of this specification are approximate values, in specific embodiments, the setting of such numerical values is as accurate as possible within the feasible range.
[0167] Each patent, patent application, patent application publication, and other materials, such as articles, books, specifications, publications, documents, etc., cited in this specification are hereby incorporated by reference in their entirety. Except for application history documents that are inconsistent with or conflicting with the contents of this specification, documents that limit the broadest scope of the claims of this specification (currently or later attached to this specification) are also excluded. It should be noted that if the descriptions, definitions, and / or use of terms in the materials attached to this specification are inconsistent or conflicting with the contents described in this specification, the descriptions, definitions, and / or use of terms in this specification shall prevail.
[0168] Finally, it should be understood that the embodiments described in this specification are only used to illustrate the principles of the embodiments of this specification. Other variations may also fall within the scope of this specification. Therefore, as an example and not a limitation, alternative configurations of the embodiments of this specification may be considered consistent with the teachings of this specification. Accordingly, the embodiments of this specification are not limited to the embodiments explicitly introduced and described in this specification.
Claims
1. A task indicator data prediction method, characterized in that: The method comprises: Acquire original data related to the target task, wherein the original data at least includes historical feature data and time data; Preprocessing the raw data to obtain an initial time feature matrix; Determine whether the initial time feature matrix includes missing data, where the missing data refers to historical feature data included in the initial time feature matrix being missing in corresponding time data; If yes, then based on the initial time feature matrix, a pre-trained generator is used to obtain a target time feature matrix after filling the missing data, wherein the generator is trained based on a generative adversarial network; The target time feature matrix is processed using a pre-trained prediction model to determine the prediction index data of the target task.
2. The method according to claim 1, characterized in that The target task is related to the sales volume and / or profit of the target store, and the historical feature data includes one or more of the following data: historical sales data of the target object included in the target store, target store information, target object information, historical sales data of the target store, historical profit data of the target store, historical sales data of other stores related to the target store, and historical profit data of the other stores; The time data includes one or more of the following data: date information, holiday information, and working day information.
3. The method according to claim 2, characterized in that The preprocessing includes one or more of the following processes: normalizing the historical feature data, performing outlier processing on the historical feature data, binning the time data, encoding the time data based on the holiday information, encoding the time data based on the working day information, performing outlier processing on the time data, and calculating the sales volume and profit of the target store based on the historical feature data.
4. The method according to claim 1, characterized in that The method of obtaining a target time feature matrix after filling the missing data based on the initial time feature matrix using a pre-trained generator includes: Perform forward calculation and backward calculation on the initial time feature matrix to determine the forward matrix and the backward matrix, which include: Taking the first column vector of the initial time feature matrix as the starting direction, sequentially calculating the distance between each element value in the initial time feature matrix and its nearest neighbor element value, and determining the forward matrix; and Taking the last column vector of the initial time feature matrix as the starting direction, sequentially calculating the distance between each element value in the initial time feature matrix and its nearest neighbor element value, and determining the backward matrix; Using the generator to fill the missing data included in the initial time feature matrix based on the forward matrix and the backward matrix, respectively, to determine a forward interpolation matrix and a backward interpolation matrix; A weighted operation is performed on the forward interpolation matrix and the backward interpolation matrix to determine the target time feature matrix.
5. A task indicator data prediction system, characterized in that: The system comprises: A raw data acquisition module, used to acquire raw data related to the target task, wherein the raw data at least includes historical feature data and time data; A preprocessing module, used for preprocessing the raw data to obtain an initial time feature matrix; A judgment module, used to judge whether the initial time feature matrix includes missing data, wherein the missing data refers to the historical feature data included in the initial time feature matrix being missing in the corresponding time data; A filling module, used for obtaining a target time feature matrix after filling the missing data based on the initial time feature matrix using a pre-trained generator when the missing data is included, wherein the generator is trained based on a generative adversarial network; The determination module is used to process the target time feature matrix using a pre-trained prediction model to determine the prediction index data of the target task.
6. The system according to claim 5, characterized in that The target task is related to the sales volume and / or profit of the target store, and the historical feature data includes one or more of the following data: historical sales data of the target object included in the target store, target store information, target object information, historical sales data of the target store, historical profit data of the target store, historical sales data of other stores related to the target store, and historical profit data of the other stores; The time data includes one or more of the following data: date information, holiday information, and working day information.
7. The system according to claim 6, characterized in that The preprocessing includes one or more of the following processes: normalizing the historical feature data, performing outlier processing on the historical feature data, binning the time data, encoding the time data based on the holiday information, encoding the time data based on the working day information, performing outlier processing on the time data, and calculating the sales volume and profit of the target store based on the historical feature data.
8. The system according to claim 5, characterized in that The filling module is further used for: Perform forward calculation and backward calculation on the initial time feature matrix to determine the forward matrix and the backward matrix, which include: Taking the first column vector of the initial time feature matrix as the starting direction, sequentially calculating the distance between each element value in the initial time feature matrix and its nearest neighbor element value, and determining the forward matrix; and Taking the last column vector of the initial time feature matrix as the starting direction, sequentially calculating the distance between each element value in the initial time feature matrix and its nearest neighbor element value, and determining the backward matrix; Using the generator to fill the missing data included in the initial time feature matrix based on the forward matrix and the backward matrix, respectively, to determine a forward interpolation matrix and a backward interpolation matrix; A weighted operation is performed on the forward interpolation matrix and the backward interpolation matrix to determine the target time feature matrix.
9. A task indicator data prediction device, comprising a processor and a memory, wherein the memory is used to store instructions, characterized in that: The processor is used to execute the instructions to implement operations corresponding to the task indicator data prediction method as described in any one of claims 1 to 4.
10. A computer-readable storage medium storing computer instructions, characterized in that: When the computer instructions are executed by the processor, operations corresponding to the task indicator data prediction method according to any one of claims 1 to 4 are implemented.
11. The method according to claim 1, wherein the generative adversarial network comprises a generator and a discriminator, and the training process of the generator comprises: Acquire a plurality of first training samples including missing data, each first training sample including at least first sample historical feature data and first sample time data; Each first training sample is related to the target task; Based on the multiple first training samples and the discriminator, the parameters of the generator are iteratively updated to reduce the first objective loss function value corresponding to each first training sample, so as to obtain a trained generator.
12. The method according to claim 11, characterized in that The target task is related to the sales volume and / or profit of the sample store, and the first sample historical feature data includes one or more of the following data: historical sales data of the sample object included in the sample store, sample store information, sample object information, historical sales data of the sample store, historical profit data of the sample store, historical sales data of other stores related to the sample store, and historical profit data of the other stores; The first sample time data includes one or more of the following data: date information, holiday information, and working day information.
13. The method according to claim 11, characterized in that The first objective loss function value corresponding to each first training sample is determined by the following process: Preprocessing the first training sample to obtain an initial time feature matrix of the sample; Performing forward calculation and backward calculation on the sample initial time feature matrix respectively to determine a sample forward matrix and a sample backward matrix; Using the generator to fill the missing data included in the sample initial time feature matrix based on the sample forward matrix and the sample backward matrix, respectively, to determine a sample forward interpolation matrix and a sample backward interpolation matrix; Performing a weighted operation on the sample forward interpolation matrix and the sample backward interpolation matrix to determine a sample target time feature matrix; Processing the sample target time feature matrix using the discriminator to obtain a probability matrix; The first objective loss function value is determined based on the sample initial time feature matrix, the sample target time feature matrix, the sample forward interpolation matrix, the sample backward interpolation matrix, the probability matrix, and a first label of the missing data and the real data used to characterize the sample initial time feature matrix.
14. The method according to claim 13, characterized in that The preprocessing includes one or more of the following processes: normalizing the first sample historical feature data, performing outlier processing on the first sample historical feature data, binning the first sample time data, encoding the first sample time data based on the holiday information, encoding the first sample time data based on the working day information, performing outlier processing on the first sample time data, and calculating the sales volume and profit of the sample store based on the first sample historical feature data.
15. The method according to claim 13, characterized in that The performing forward calculation and backward calculation on the sample initial time feature matrix respectively to determine the sample forward matrix and the sample backward matrix includes: Taking the first column vector of the sample initial time feature matrix as the starting direction, sequentially calculating the distance between each element value and its nearest neighbor element value in the sample initial time feature matrix to determine the sample forward matrix; and The last column vector of the sample initial time feature matrix is used as the starting direction, and the distance between each element value and its nearest neighbor element value in the sample initial time feature matrix is calculated in sequence to determine the sample backward matrix.
16. The method according to claim 13, characterized in that The determining the first objective loss function value based on the sample initial time feature matrix, the sample target time feature matrix, the sample forward interpolation matrix, the sample backward interpolation matrix, the probability matrix, and the missing values and the first label of the real data characterizing the sample initial time feature matrix includes: Determining a first loss function value based on a difference between the sample initial time feature matrix and the sample target time feature matrix; Determining a second loss function value based on a difference between the sample forward interpolation matrix and the sample backward interpolation matrix; Determining a third loss function value based on a difference between the probability matrix and the first label; The first target loss function value is determined based at least on the sum of the first loss function value, the second loss function value, and the third loss function value.
17. The method according to claim 16, characterized in that The method further includes: based on the third loss function values corresponding to the multiple first training samples, iteratively updating the parameters of the discriminator to reduce the second target loss function value corresponding to each first training sample, so as to obtain a trained discriminator.
18. The system of claim 5, wherein the generative adversarial network comprises a generator and a discriminator, and the system further comprises: A first training sample acquisition module, used to acquire a plurality of first training samples including missing data, each first training sample at least including first sample historical feature data and first sample time data; each first training sample is related to a target task; The generator training module is used to iteratively update the parameters of the generator based on the multiple first training samples and the discriminator to reduce the first objective loss function value corresponding to each first training sample to obtain a trained generator.
19. The system of claim 18, wherein: The target task is related to the sales volume and / or profit of the sample store, and the first sample historical feature data includes one or more of the following data: historical sales data of the sample object included in the sample store, sample store information, sample object information, historical sales data of the sample store, historical profit data of the sample store, historical sales data of other stores related to the sample store, and historical profit data of the other stores; The first sample time data includes one or more of the following data: date information, holiday information, and working day information.
20. The system of claim 18, wherein: The generator training module is further used to: Preprocessing the first training sample to obtain an initial time feature matrix of the sample; Performing forward calculation and backward calculation on the sample initial time feature matrix respectively to determine a sample forward matrix and a sample backward matrix; Using the generator to fill the missing data included in the sample initial time feature matrix based on the sample forward matrix and the sample backward matrix, respectively, to determine a sample forward interpolation matrix and a sample backward interpolation matrix; Performing a weighted operation on the sample forward interpolation matrix and the sample backward interpolation matrix to determine a sample target time feature matrix; Processing the sample target time feature matrix using the discriminator to obtain a probability matrix; The first objective loss function value is determined based on the sample initial time feature matrix, the sample target time feature matrix, the sample forward interpolation matrix, the sample backward interpolation matrix, the probability matrix, and a first label of the missing data and the real data used to characterize the sample initial time feature matrix.
21. The system of claim 20, wherein: The preprocessing includes one or more of the following processes: normalizing the first sample historical feature data, performing outlier processing on the first sample historical feature data, binning the first sample time data, encoding the first sample time data based on the holiday information, encoding the first sample time data based on the working day information, performing outlier processing on the first sample time data, and calculating the sales volume and profit of the sample store based on the first sample historical feature data.
22. The system of claim 21, wherein: The generator training module is further used to: Taking the first column vector of the sample initial time feature matrix as the starting direction, sequentially calculating the distance between each element value and its nearest neighbor element value in the sample initial time feature matrix to determine the sample forward matrix; and The last column vector of the sample initial time feature matrix is used as the starting direction, and the distance between each element value and its nearest neighbor element value in the sample initial time feature matrix is calculated in sequence to determine the sample backward matrix.
23. The system of claim 21, wherein: The generator training module is further used to: Determining a first loss function value based on a difference between the sample initial time feature matrix and the sample target time feature matrix; Determining a second loss function value based on a difference between the sample forward interpolation matrix and the sample backward interpolation matrix; Determining a third loss function value based on a difference between the probability matrix and the first label; The first target loss function value is determined based at least on the sum of the first loss function value, the second loss function value, and the third loss function value.
24. The system of claim 23, wherein: The system also includes a discriminator training module, which is used to iteratively update the parameters of the discriminator based on the third loss function values corresponding to the multiple first training samples to reduce the second target loss function value corresponding to each first training sample, so as to obtain a trained discriminator.
25. The device according to claim 9, characterized in that The processor is also used to execute the instructions to implement operations corresponding to the training method for a generator for filling missing data as described in any one of claims 11 to 17.
26. The storage medium according to claim 10, wherein: When the computer instructions are executed by the processor, operations corresponding to the training method for a generator for filling missing data as described in any one of claims 11 to 17 are also implemented.
27. The method of claim 1, wherein the training process of the prediction model comprises: Acquire a plurality of second training samples containing complete data and carrying second labels, each second training sample including second sample historical feature data and second sample time data; The second training sample is related to the target task, and the second label is used to characterize the indicator data of the target task; Iteratively updating the parameters of the initial prediction model based on the multiple second training samples to reduce the third objective loss function value corresponding to each second training sample, thereby obtaining a trained prediction model; The third objective loss function value corresponding to each second training sample is determined by the following process: Processing the second training sample by the initial prediction model to obtain prediction index data of the target task; The third objective loss function value is determined based at least on a difference between the prediction indicator data and the second label.
28. The method of claim 27, wherein: The target task is related to the sales volume and / or profit of the sample store, and the second sample historical feature data includes one or more of the following data: historical sales data of the sample object included in the sample store, sample store information, sample object information, historical sales data of the sample store, historical profit data of the sample store, historical sales data of other stores related to the sample store, and historical profit data of the other stores; The second sample time data includes one or more of the following data: date information, holiday information, and working day information.
29. The system of claim 5, wherein the pre-trained prediction model is obtained through training, and the system further comprises: A second training sample acquisition module, used to acquire a plurality of second training samples containing complete data and carrying a second label, each second training sample including second sample historical feature data and second sample time data; the second training sample is related to a target task, and the second label is used to characterize the indicator data of the target task; A prediction model training module, used for iteratively updating the parameters of the initial prediction model based on the multiple second training samples to reduce the third objective loss function value corresponding to each second training sample, so as to obtain a trained prediction model; The third objective loss function value corresponding to each second training sample is determined by the following process: Processing the second training sample by the initial prediction model to obtain prediction index data of the target task; The third objective loss function value is determined based at least on a difference between the prediction indicator data and the second label.
30. The system of claim 29, wherein: The target task is related to the sales volume and / or profit of the sample store, and the second sample historical feature data includes one or more of the following data: historical sales data of the sample object included in the sample store, sample store information, sample object information, historical sales data of the sample store, historical profit data of the sample store, historical sales data of other stores related to the sample store, and historical profit data of the other stores; The second sample time data includes one or more of the following data: date information, holiday information, and working day information.
31. The device according to claim 9, characterized in that The processor is also used to execute the instructions to implement operations corresponding to the training method of the prediction model for predicting indicator data of the target task as described in any one of claims 27 to 28.
32. The storage medium according to claim 10, wherein: When the computer instructions are executed by the processor, operations corresponding to the training method of a prediction model for predicting indicator data of a target task as described in any one of claims 27 to 28 are also implemented.
Citation Information
Patent Citations
sales volume forecasting method and a training method, a device and an electronic system of a model thereof
CN109509030A
Data prediction model generation method and device and data prediction method and device
CN111291867A
