Sales prediction method and device
Feature construction and feature selection are solved through automated machine learning methods, and the problems of long development and training of sales prediction models in the existing technology are solved, and more efficient and accurate sales prediction model training is achieved.
Patent Information
- Application Number
- CN202411448329.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, it is difficult to fit very accurate sales forecast results in the timing model, while the feature model is time-consuming and labor-intensive in building feature engineering, model selection and feature selection, and the model effect is unstable.
Through automated machine learning methods, feature construction and feature selection are automated, which reduces the time cost of model development and training and improves the performance of sales forecast models. The specific methods include obtaining the attribute data and historical sales data of the item, constructing multiple original features, performing feature derivation and candidate feature construction, conducting multiple model training, and eliminating and determining the candidate features after each model training to update the features.
This method realizes the automation of feature construction, feature selection, model selection and model tuning through automated machine learning, reducing model development and training time, improving the performance and accuracy of sales prediction models, and is suitable for rapid data sets Expand without manual intervention, reducing labor costs and technical barriers.
Smart Images

Figure CN119444301A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a sales forecasting method and device. Background Art
[0002] As logistics supply chain capabilities continue to improve, merchant customers can rely on supply chain services for forecasting, replenishment, product layout, etc. The accuracy of the forecast results has an important impact on whether merchants recognize the supply chain service capabilities. Therefore, a method that can quickly and accurately predict sales data is needed.
[0003] In the related technology, there are two main directions of commonly used prediction methods: one is the time series model direction, which makes predictions based on the stability and correlation of the sequence; the other is the feature model direction, which optimizes the prediction results by constructing complex features, and then selecting features and models to find a suitable prediction model. However, the time series model direction only considers the time series itself, and it is difficult to fit a very accurate result; the feature model direction is time-consuming and laborious in the process of constructing feature engineering, model selection and feature selection, and the model effect is unstable. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a sales forecasting method and device, which automatically constructs and selects features through an automated machine learning method, reduces the time cost of model development and training, and improves the performance of the sales forecasting model. Using the sales forecasting model to forecast sales can improve the forecast accuracy.
[0005] To achieve the above object, according to one aspect of an embodiment of the present invention, a training method for a sales prediction model is provided, comprising:
[0006] Acquire attribute data and historical sales data of the item, and obtain a plurality of original features according to the attribute data and the historical sales data;
[0007] Performing feature derivation on the multiple original features to obtain multiple derived features; constructing multiple candidate features based on the multiple original features and the multiple derived features;
[0008] Performing multiple model trainings based on the multiple candidate features and the historical sales data to obtain a sales prediction model;
[0009] After each model training, the multiple candidate features are subjected to elimination judgment to obtain a elimination judgment result. When the elimination judgment result indicates elimination, some candidate features are eliminated from the multiple candidate features to update the multiple candidate features.
[0010] Optionally, feature derivation is performed on the multiple original features to obtain multiple derived features, including:
[0011] Obtaining a feature index value of each original feature, and selecting a plurality of candidate original features from the plurality of original features in descending order of the feature index values;
[0012] The plurality of derived features are generated according to the plurality of candidate original features and preset derivation rules.
[0013] Optionally, performing elimination determination on the multiple candidate features to obtain a elimination determination result includes:
[0014] Obtain the first loss value obtained from each model training and the first feature index value of each candidate feature;
[0015] Eliminate a first number of candidate features from the plurality of candidate features in ascending order according to the first feature index values, to obtain the plurality of candidate features after elimination;
[0016] Performing model training using the multiple candidate features after elimination to obtain a second loss value;
[0017] In response to the second loss value being less than the first loss value, the rejection decision result is determined to be a result indicating that the first number of candidate features are rejected.
[0018] Optionally, the historical sales data includes historical sales in each of a plurality of historical time periods, and the method further includes:
[0019] After each model training, differential judgment is performed on the historical sales volume of each historical time period to obtain a differential judgment result; when the differential judgment result indicates differential processing, differential processing is performed on the historical sales volume of each historical time period to update the historical sales volume of each historical time period.
[0020] Optionally, a differential determination is performed on the historical sales volume in each historical time period to obtain a differential determination result, including:
[0021] Get the first loss value obtained from each model training;
[0022] Performing differential processing on the historical sales volume in each historical time period to obtain the differential historical sales volume in each historical time period, and using the differential historical sales volume to perform model training to obtain a third loss value;
[0023] In response to the third loss value being less than the first loss value, determining the difference determination result as a result indicating a difference processing;
[0024] In response to the third loss value being not less than the first loss value, the difference determination result is determined to be a result indicating no difference processing.
[0025] Another aspect of an embodiment of the present invention provides a sales volume forecasting method, comprising:
[0026] Obtaining attribute data of the item and historical sales data of multiple historical time periods corresponding to the forecast time period;
[0027] Inputting the attribute data and the historical sales quantities of the multiple historical time periods into a sales forecasting model to obtain target sales data for the forecasting time period;
[0028] The sales volume prediction model is obtained by training according to the sales volume prediction model training method of an embodiment of the present invention.
[0029] According to another aspect of an embodiment of the present invention, a training device for a sales forecasting model is provided, comprising:
[0030] A first acquisition module acquires attribute data and historical sales data of an item, and obtains a plurality of original features according to the attribute data and the historical sales data;
[0031] A derivation module performs feature derivation on the multiple original features to obtain multiple derived features; and constructs multiple candidate features based on the multiple original features and the multiple derived features;
[0032] A training module, performing multiple model trainings based on the multiple candidate features and the historical sales data to obtain a sales prediction model;
[0033] The updating module performs elimination judgment on the multiple candidate features after each model training to obtain a elimination judgment result. When the elimination judgment result indicates elimination, some candidate features are eliminated from the multiple candidate features to update the multiple candidate features.
[0034] According to another aspect of an embodiment of the present invention, there is provided a sales volume forecasting device, comprising:
[0035] A second acquisition module acquires attribute data of the item and historical sales data of multiple historical time periods corresponding to the predicted time period;
[0036] A prediction module, inputting the attribute data and the historical sales quantities of the multiple historical time periods into a sales prediction model to obtain target sales data for the prediction time period;
[0037] The sales volume prediction model is obtained by training according to the sales volume prediction model training method of an embodiment of the present invention.
[0038] According to another aspect of an embodiment of the present invention, there is provided an electronic device, including:
[0039] one or more processors;
[0040] a storage device for storing one or more programs,
[0041] When the one or more programs are executed by the one or more processors, the one or more processors implement the sales forecasting model training method or sales forecasting method provided by the present invention.
[0042] According to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the training method of the sales forecasting model or the sales forecasting method provided by the present invention is implemented.
[0043] One embodiment of the above invention has the following advantages or beneficial effects: the training method of the sales prediction model of the embodiment of the present invention first obtains the attribute data and historical sales data of the item to construct multiple original features; then derives features from the multiple original features to obtain multiple derived features; performs multiple model trainings based on the multiple derived features and historical sales data to obtain a sales prediction model, and after each model training, multiple candidate features are eliminated and judged to update the multiple candidate features. This method realizes automated feature construction, feature selection, model selection, model tuning and other processes through automated machine learning, reducing the time required for model development and model training; machine learning automation helps to find better model structures and model parameters by systematically searching for optimal model configurations, optimizes model performance, and thereby improves the prediction accuracy of the model; this method can achieve rapid expansion and adapt to different data rules and complexities when processing large-scale data sets, without the need for manual intervention, reducing labor costs, lowering technical barriers, and improving repeatability.
[0044] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific implementation examples. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0046] Figure 1 is a schematic diagram of the main process of a training method for a sales forecasting model according to an embodiment of the present invention;
[0047] Figure 2 It is a flowchart of a training method for a sales forecasting model according to an embodiment of the present invention;
[0048] Figure 3is a schematic diagram of the main process of a sales forecasting method according to an embodiment of the present invention;
[0049] Figure 4 is a schematic diagram of main modules of a training device for a sales volume prediction model according to an embodiment of the present invention;
[0050] Figure 5 is a schematic diagram of main modules of a sales volume forecasting device according to an embodiment of the present invention;
[0051] Figure 6 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0052] Figure 7 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0053] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0054] Figure 1 FIG. 1 is a schematic diagram of the main process of a training method for a sales forecasting model according to an embodiment of the present invention. Figure 1 As shown, the training method of the sales prediction model includes the following steps:
[0055] Step S101: Acquire attribute data and historical sales data of an item, and obtain a plurality of original features according to the attribute data and historical sales data;
[0056] Step S102: deriving features from the multiple original features to obtain multiple derived features; constructing multiple candidate features based on the multiple original features and the multiple derived features;
[0057] Step S103: performing multiple model trainings based on multiple candidate features and historical sales data to obtain a sales prediction model;
[0058] After each model training, multiple candidate features are subjected to elimination judgment to obtain elimination judgment results. When the elimination judgment results indicate elimination, some candidate features are eliminated from the multiple candidate features to update the multiple candidate features.
[0059] In an embodiment of the present invention, the training method of the sales prediction model is implemented by an automated machine learning (AutoML) method. When training the sales prediction model, firstly, the attribute data of the item to be predicted (such as a commodity) of the merchant to be predicted and the historical sales data of the item are obtained, wherein the item, i.e., the item to be predicted, can be one or more items of the merchant to be predicted, and the attribute data of the item is used to describe the attributes of the item. The attribute data of the item includes various attributes of the item, and the various attributes of the item can include one or more of the item identification, the warehouse identification of the warehouse where it is located, the item category, the item category, the item price, the item material, the item specification, the item color, the item size, the item use, the item shelf life, the item origin, etc. The historical sales data of the item includes the historical sales of each historical time period in multiple historical time periods, and the multiple historical time periods and each historical time period can be customized. The multiple historical time periods can be continuous, such as multiple historical time periods can be multiple days in the past month, and each historical time period is each day in the multiple days, and each day can be represented by a date. That is, the historical sales data of the item can be the historical sales of the item every day in the past month, that is, the time series sales data of the item.
[0060] After obtaining the attribute data of the item and the historical sales data of the item, the process of feature construction, model selection, feature selection, and model training can be automatically executed to obtain a sales prediction model.
[0061] Specifically, firstly, a data identifier is generated, for example, a data identifier can be generated based on a warehouse identifier and an item identifier; and multiple original features are constructed based on the item's attribute data, historical sales data and preset rules. For example, each attribute of the item and the historical sales volume in each historical time period can be converted according to preset rules to obtain multiple original features.
[0062] Among them, the preset rules can be customized, and the preset rules can include data specifications such as the feature name, feature meaning, and feature type of each original feature. The feature name is the field name, the feature meaning is the field meaning, and the feature type is the field type. The field type can include numeric type, category type, and time type. The category type can be a string type. For example, the date field is represented by ds, the feature type is the time type, that is, timestamp, and the field value can be 2020-01-01. The sales volume field is represented by y, the field type is a numeric type, and the field value can be 20.
[0063] Among them, the preset rules also include setting a preset training time for the model, stopping the iteration loop when the loop iteration reaches the preset training time, and obtaining the final sales prediction model.
[0064] In the embodiment of the present invention, before constructing a plurality of original features, data preprocessing may be performed on the attribute data and the historical sales data. The data preprocessing may include data cleaning, missing value processing, and the like.
[0065] In an embodiment of the present invention, feature derivation is performed on multiple original features to obtain multiple derived features, including: obtaining a feature index value of each original feature, screening out multiple candidate original features from the multiple original features in descending order of the feature index values; and generating multiple derived features based on the multiple candidate original features and preset derivation rules.
[0066] In the embodiment of the present invention, feature derivation may be performed on all original features to obtain multiple derived features, or multiple candidate original features may be selected from the multiple original features and multiple derived features may be derived from the candidate original features.
[0067] Specifically, when constructing a derived feature, a corresponding derived feature is constructed according to a feature type of the original feature. The feature types of the multiple original features include a numerical type, a category type, and a date type.
[0068] Among them, for the original features of the category type, the embedding encoding method can be used to encode the original features and convert the original features of the category type into derived features of the numerical type. For example, if the original feature is the item category, the numerical values 1, 2, and 3 can be used to represent different item categories.
[0069] For original features of numerical type, the feature index value of each original feature can be obtained by using a trained machine learning model, and the feature index value is the feature importance value, wherein the machine learning model can be one of the LightGBM model, the XGBoost model and the linear regression model; sorting is performed in descending order according to the feature index value, and a preset number of original features before sorting are selected from multiple original features to obtain multiple candidate original features, and then the multiple candidate original features can be derived according to the preset derivation rules to obtain multiple derived features, thereby realizing the automatic generation of high-order features; wherein the preset derivation rules can be addition, subtraction, multiplication and division operations, and the preset number can be 3, that is, the three original features are used to perform addition, subtraction, multiplication and division operations to generate derived features. For example, the results of adding, subtracting, multiplying and dividing the sales volume on the i-th day and the sales volume on the j-th day are calculated respectively to obtain multiple derived features.
[0070] Derived features may include lagged features. Based on the original features of numerical types, lagged features may also be generated. For example, if the original feature is daily sales, the lagged features may be sales 1 day ago, 2 days ago, 3 days ago, 7 days ago, 14 days ago, etc.
[0071] Derived features may also include differential features, which may be obtained based on original features of numerical type or based on lagged features. For example, corresponding differential features may be obtained based on sales volume 14 days ago and sales volume 1 day ago.
[0072] For the original features of the time type, derived features such as rolling features and sliding window features can be obtained based on the original features of the time type. The rolling features obtained based on the original features can be the year, month, day of the week, and day of the month for each day; the sliding window features can be obtained based on the lagged features, such as the i-th sliding window feature can be the quotient of the sum of the previous i lagged features and i.
[0073] By automatically constructing multiple derived features, and after obtaining the multiple derived features, constructing multiple candidate features based on the multiple derived features and the multiple original features, the feature information is enriched, which is conducive to improving the prediction accuracy of the sales forecasting model.
[0074] After constructing multiple candidate features, multiple model trainings are performed based on the multiple candidate features and historical sales data to obtain a sales prediction model. For example, each training sample may include each candidate feature and the historical sales of the historical day. Each candidate feature is used as an independent variable, and the historical sales of the historical day is used as a dependent variable. Multiple model trainings are performed to obtain a sales prediction model.
[0075] In an embodiment of the present invention, a plurality of candidate features are subjected to elimination determination to obtain an elimination determination result, including: obtaining a first loss value obtained from each model training and a first feature index value of each candidate feature; eliminating a first number of candidate features from the plurality of candidate features in ascending order of the first feature index values to obtain a plurality of eliminated candidate features; performing model training using the plurality of eliminated candidate features to obtain a second loss value; and in response to the second loss value being less than the first loss value, determining that the elimination determination result is a result indicating that the first number of candidate features are eliminated.
[0076] In an embodiment of the present invention, after each model training, the first loss value of the model training and the first feature index value of each candidate feature are obtained. The first feature index value of each candidate feature is the feature importance value obtained after the model is trained once. A first number of candidate features are eliminated from multiple candidate features in the order of the first feature index values from small to large, that is, the first number of candidate features before sorting are eliminated, wherein the first number can be set by user, or the first number can be determined according to the first ratio, and the first number or the first ratio set for each model training can be different, for example, the first ratio of multiple model trainings can be set to 0.2, 0.5, 0.75, 0.05, 0.1, etc. The first loss value or the second loss value is obtained based on the actual historical sales and the predicted historical sales, for example, the first loss value and the second loss value can be RMSE (root mean square error), and the one with a smaller RMSE can be automatically selected through automated feature selection.
[0077] After obtaining multiple candidate features after elimination, the model is trained using the multiple candidate features after elimination to obtain a second loss value, and it is determined whether the second loss value is less than the first loss value. If so, it means that the loss value has decreased, and the elimination judgment result is to eliminate the first number of candidate features. If not, it means that the loss value has not decreased, and no elimination is performed.
[0078] In an embodiment of the present invention, the historical sales data includes historical sales in each of the multiple historical time periods, and the method further includes:
[0079] After each model training, differential judgment is performed on the historical sales volume of each historical time period to obtain a differential judgment result; when the differential judgment result indicates differential processing, differential processing is performed on the historical sales volume of each historical time period to update the historical sales volume of each historical time period.
[0080] In the embodiment of the present invention, in order to further improve the accuracy of model prediction, two transformation methods can be used to train the model on the historical sales data to perform differential judgment and obtain differential judgment results. The two transformation methods are to perform differential processing on the historical sales in each historical time period or not to perform differential processing. Among them, differential judgment can be performed at each model training, or at the first model training or any model training.
[0081] If the differential judgment result indicates differential processing, differential processing is performed on the historical sales volume in each historical time period, and the historical sales volume after differential processing is used as the dependent variable for model training; if the differential judgment result indicates no differential processing, the historical sales volume without differential processing is used as the dependent variable for model training.
[0082] In an embodiment of the present invention, a differential judgment is performed on the historical sales volume of each historical time period to obtain a differential judgment result, including: obtaining a first loss value obtained from each model training; performing differential processing on the historical sales volume of each historical time period to obtain the differential historical sales volume of each historical time period, using the differential historical sales volume to perform model training to obtain a third loss value; in response to the third loss value being less than the first loss value, determining that the differential judgment result is a result indicating differential processing; in response to the third loss value being not less than the first loss value, determining that the differential judgment result is a result indicating no differential processing.
[0083] Specifically, when performing differential judgment on the historical sales volume in each historical time period, the historical sales volume without differential processing is used for model training to obtain a first loss value, and the historical sales volume after differential processing is used for model training to obtain a third loss value. Then, it is determined whether the third loss value is smaller than the first loss value. If so, it means that differentiating the historical sales volume is more effective, and the differential judgment result indicates differential processing. If not, it means that not differentiating the historical sales volume is more effective, and the model training is performed using the historical sales volume without differential processing as the dependent variable.
[0084] In an embodiment of the present invention, the model of automated machine learning can be a LightGBM model or an XGBoost model. In order to save training time, the LightGBM model can be selected. Through multiple model training, a sales prediction model is obtained, and hyperparameters such as learning rate, tree depth, and column sampling are traversed. For example, the learning rate, number of leaf nodes, etc. are searched using the grid search method, and the hyperparameters are tuned to obtain the hyperparameters with the best effect, thereby obtaining a trained sales prediction model.
[0085] The sales forecasting model can also achieve multi-step forecasting and accurately predict the sales value for multiple days in the future. By continuously updating the training set, the features and parameters are reselected each time to make predictions for the future. For example, the sales for the next five days can be predicted through historical sales data. The sales for the first day in the future are gradually predicted. The sales for the first day are updated to the training set, the features and parameters are reselected, the model is updated, and the sales for the next two days are predicted using the updated model. Thus, the sales for the next five days can be obtained through multi-step forecasting. By continuously updating the training set, reselecting features and tuning parameters, and continuously updating the model, the model prediction accuracy can be improved.
[0086] Figure 2 The flowchart of a sales forecasting model training method of an embodiment of the present invention is as follows: First, the original data is input, including the attribute data and historical sales data of the merchant's goods, and multiple original features are constructed according to preset rules; data identification is constructed;
[0087] Then, the numerical type feature processing, category type feature encoding and date type feature processing are automated to obtain multiple derived features. Among them, the automated numerical type feature processing includes simple model fitting to obtain the feature importance of each original feature, and selects the top N important features in the feature importance ranking, where N is a positive integer. Then, the selected important original features are automatically processed for derived features to obtain high-order features, as well as differential features, lag features, sliding window features, etc.; the automated category type feature processing includes embedding encoding of the original features of the category type; the automated time type feature processing includes constructing time features and rolling features;
[0088] Multiple derived features and multiple original features are concatenated to obtain multiple candidate features. Multiple candidate features and target values are used to train the LightGBM model. During training, target value differential transformation and feature elimination are determined. The target value transformation method and important candidate features are selected based on the model effect, and the optimal model is updated.
[0089] The training model is iterated in a loop until the preset training time is reached to obtain the final sales prediction model.
[0090] The training method of the sales prediction model of the embodiment of the present invention first obtains the attribute data and historical sales data of the item to construct multiple original features; then derives features from the multiple original features to obtain multiple derived features; performs multiple model trainings based on the multiple derived features and historical sales data to obtain a sales prediction model, and after each model training, determines the elimination of multiple candidate features to update the multiple candidate features. This method automates the processes of feature construction, feature selection, model selection, model tuning, etc. through automated machine learning, reducing the time required for model development and model training; machine learning automation helps to discover better model structures and parameter settings by systematically searching for optimal model configurations, optimizes model performance, and thereby improves the prediction accuracy of the model; this method can achieve rapid expansion when processing large-scale data sets, adapt to different data rules and complexities, and does not require manual intervention, thereby reducing labor costs, lowering technical barriers, and improving repeatability, and can be applied to smart business warehouse scenarios.
[0091] According to another aspect of the embodiment of the present invention, Figure 3 As shown, a sales volume forecasting method is provided, including:
[0092] Step S301: Acquire attribute data of the item and historical sales data of multiple historical time periods corresponding to the forecast time period;
[0093] Step S302: inputting the attribute data and the historical sales quantities of multiple historical time periods into the sales forecasting model to obtain the target sales data of the forecasting time period;
[0094] The sales forecasting model is obtained by training according to the training method of the sales forecasting model of the embodiment of the present invention.
[0095] In the embodiment of the present invention, after obtaining the sales forecasting model, the sales forecasting model can be used to perform sales forecasting. Specifically, the attribute data and historical sales data of the predicted goods of the predicted merchant are obtained. The historical sales data is the historical sales data of multiple historical time periods corresponding to the prediction time period. For example, if the preset time period is every day of the next week, the historical sales data of multiple historical time periods can be the historical sales data of every day in recent weeks. Then, the attribute data and the historical sales data of multiple historical time periods are input into the sales forecasting model to obtain the sales data of the prediction time period.
[0096] The sales forecasting method of an embodiment of the present invention first obtains the attribute data of the item and the historical sales data of multiple historical time periods corresponding to the forecast time period, and uses the sales forecasting model trained based on the automated machine learning method to perform sales forecasting for the forecast time period, thereby improving the efficiency and accuracy of sales forecasting.
[0097] According to another aspect of the embodiment of the present invention, Figure 4 As shown, a training device 400 for a sales forecasting model is provided, comprising:
[0098] The first acquisition module 401 acquires attribute data and historical sales data of the item, and obtains a plurality of original features according to the attribute data and historical sales data;
[0099] A derivation module 402 performs feature derivation on the multiple original features to obtain multiple derived features; and constructs multiple candidate features based on the multiple original features and the multiple derived features;
[0100] The training module 403 performs multiple model trainings based on multiple candidate features and historical sales data to obtain a sales prediction model;
[0101] The updating module 404 performs elimination determination on the multiple candidate features after each model training to obtain elimination determination results. When the elimination determination results indicate elimination, some candidate features are eliminated from the multiple candidate features to update the multiple candidate features.
[0102] In an embodiment of the present invention, the derivation module 402 is further used to: obtain a feature index value of each original feature, and filter out multiple candidate original features from multiple original features in order of the feature index values from large to small; generate multiple derived features based on the multiple candidate original features and preset derivation rules.
[0103] In the embodiment of the present invention, the updating module 404 is further used to: obtain a first loss value obtained from each model training and a first feature index value of each candidate feature;
[0104] Eliminate a first number of candidate features from the plurality of candidate features in ascending order of first feature index values to obtain a plurality of eliminated candidate features;
[0105] The model is trained using the eliminated multiple candidate features to obtain a second loss value;
[0106] In response to the second loss value being less than the first loss value, determining the rejection decision result as a result indicating that the first number of candidate features are rejected.
[0107] In an embodiment of the present invention, the historical sales data includes the historical sales of each historical time period in multiple historical time periods. The update module 404 is also used to: after each model training, perform differential judgment on the historical sales of each historical time period to obtain a differential judgment result; when the differential judgment result indicates differential processing, perform differential processing on the historical sales of each historical time period to update the historical sales of each historical time period.
[0108] In the embodiment of the present invention, the updating module 404 is further used to: obtain a first loss value obtained from each model training;
[0109] Perform differential processing on the historical sales volume in each historical time period to obtain the differential historical sales volume in each historical time period, use the differential historical sales volume to train the model, and obtain the third loss value;
[0110] In response to the third loss value being less than the first loss value, determining the difference determination result as a result indicative of a difference process;
[0111] In response to the third loss value being not less than the first loss value, the difference determination result is determined to be a result indicating no difference processing.
[0112] According to another aspect of the embodiment of the present invention, Figure 5 As shown, a sales volume prediction device 500 is provided, comprising:
[0113] The second acquisition module 501 acquires attribute data of the item and historical sales data of multiple historical time periods corresponding to the predicted time period;
[0114] The prediction module 502 inputs the attribute data and the historical sales quantity of multiple historical time periods into the sales prediction model to obtain the target sales data of the prediction time period;
[0115] The sales forecasting model is obtained by training according to the training method of the sales forecasting model of the embodiment of the present invention.
[0116] According to another aspect of an embodiment of the present invention, there is provided an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the training method of the sales forecasting model or the sales forecasting method provided by the present invention.
[0117] According to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the training method of the sales forecasting model or the sales forecasting method provided by the present invention is implemented.
[0118] Figure 6 An exemplary system architecture 600 of a sales forecasting model training method or a sales forecasting model training device, as well as a sales forecasting method or a sales forecasting device according to an embodiment of the present invention is shown.
[0119] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, 603, network 604 and server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0120] Users can use terminal devices 601, 602, and 603 to interact with server 605 through network 604 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 601, 602, and 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).
[0121] The terminal devices 601 , 602 , and 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.
[0122] The server 605 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 601, 602, and 603. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.
[0123] It should be noted that the sales prediction model training method or sales prediction method provided in the embodiment of the present invention is generally executed by the server 605. Accordingly, the sales prediction model training device or sales prediction device is generally arranged in the server 605.
[0124] It should be understood that Figure 6 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0125] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 of a terminal device suitable for implementing an embodiment of the present invention. Figure 7 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0126] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0127] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.
[0128] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.
[0129] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0130] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0131] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes a first acquisition module, a derivative module, a training module and an update module. The names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the first acquisition module may also be described as a "module for acquiring attribute data and historical sales data of items".
[0132] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: obtaining the attribute data and historical sales data of the item, and obtaining multiple original features according to the attribute data and historical sales data; performing feature derivation on the multiple original features to obtain multiple derived features; constructing multiple candidate features according to the multiple original features and the multiple derived features; performing multiple model training according to the multiple candidate features and the historical sales data to obtain a sales prediction model; wherein, after each model training, multiple candidate features are subjected to elimination judgment to obtain elimination judgment results, and when the elimination judgment results indicate elimination, some candidate features are eliminated from the multiple candidate features to update the multiple candidate features.
[0133] According to the technical solution of the embodiment of the present invention, the training method of the sales prediction model of the embodiment of the present invention first obtains the attribute data and historical sales data of the item to construct multiple original features; then derives features from the multiple original features to obtain multiple derived features; performs multiple model trainings based on the multiple derived features and historical sales data to obtain a sales prediction model, and after each model training, multiple candidate features are eliminated and judged to update the multiple candidate features. This method realizes automated feature construction, feature selection, model selection, model tuning and other processes through automated machine learning, reducing the time required for model development and model training; machine learning automation helps to find better model structures and parameter settings by systematically searching for optimal model configurations, optimizes model performance, and thereby improves the prediction accuracy of the model; when processing large-scale data sets, this method can achieve rapid expansion and adapt to different data rules and complexities without manual intervention, thereby reducing labor costs, lowering technical barriers, and improving repeatability.
[0134] The sales forecasting method of an embodiment of the present invention first obtains the attribute data of the item and the historical sales data of multiple historical time periods corresponding to the forecast time period, and uses the sales forecasting model trained based on the automated machine learning method to perform sales forecasting for the forecast time period, thereby improving the efficiency and accuracy of sales forecasting.
[0135] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A training method for a sales forecasting model, characterized in that: include: Acquire attribute data and historical sales data of the item, and obtain a plurality of original features according to the attribute data and the historical sales data; Performing feature derivation on the multiple original features to obtain multiple derived features; constructing a plurality of candidate features according to the plurality of original features and the plurality of derived features; Performing multiple model trainings based on the multiple candidate features and the historical sales data to obtain a sales prediction model; After each model training, the multiple candidate features are subjected to elimination judgment to obtain a elimination judgment result. When the elimination judgment result indicates elimination, some candidate features are eliminated from the multiple candidate features to update the multiple candidate features.
2. The method according to claim 1, characterized in that Perform feature derivation on the multiple original features to obtain multiple derived features, including: Obtaining a feature index value of each original feature, and selecting a plurality of candidate original features from the plurality of original features in descending order of the feature index values; The plurality of derived features are generated according to the plurality of candidate original features and preset derivation rules.
3. The method according to claim 1, characterized in that Performing elimination judgment on the multiple candidate features to obtain elimination judgment results includes: Obtain the first loss value obtained from each model training and the first feature index value of each candidate feature; Eliminate a first number of candidate features from the plurality of candidate features in ascending order according to the first feature index values, to obtain the plurality of candidate features after elimination; Performing model training using the multiple candidate features after elimination to obtain a second loss value; In response to the second loss value being less than the first loss value, the rejection decision result is determined to be a result indicating that the first number of candidate features are rejected.
4. The method according to claim 1, characterized in that: The historical sales data includes historical sales in each of a plurality of historical time periods, and the method further includes: After each model training, differential judgment is performed on the historical sales volume of each historical time period to obtain a differential judgment result; when the differential judgment result indicates differential processing, differential processing is performed on the historical sales volume of each historical time period to update the historical sales volume of each historical time period.
5. The method according to claim 4, characterized in that in, Perform differential judgment on the historical sales volume in each historical time period to obtain differential judgment results, including: Get the first loss value obtained from each model training; Performing differential processing on the historical sales volume in each historical time period to obtain the differential historical sales volume in each historical time period, and using the differential historical sales volume to perform model training to obtain a third loss value; In response to the third loss value being less than the first loss value, determining the difference determination result as a result indicating a difference processing; In response to the third loss value being not less than the first loss value, the difference determination result is determined to be a result indicating no difference processing.
6. A sales forecasting method, characterized in that: include: Obtaining attribute data of the item and historical sales data of multiple historical time periods corresponding to the forecast time period; Inputting the attribute data and the historical sales quantities of the multiple historical time periods into a sales forecasting model to obtain target sales data for the forecasting time period; Wherein, the sales volume prediction model is trained according to any one of the methods described in claims 1-5.
7. A training device for a sales forecasting model, characterized in that: include: A first acquisition module acquires attribute data and historical sales data of an item, and obtains a plurality of original features according to the attribute data and the historical sales data; A derivation module, performing feature derivation on the plurality of original features to obtain a plurality of derived features; constructing a plurality of candidate features according to the plurality of original features and the plurality of derived features; A training module, performing multiple model trainings based on the multiple candidate features and the historical sales data to obtain a sales forecasting model; The updating module performs elimination judgment on the multiple candidate features after each model training to obtain a elimination judgment result. When the elimination judgment result indicates elimination, some candidate features are eliminated from the multiple candidate features to update the multiple candidate features.
8. A sales forecasting device, characterized in that: include: A second acquisition module acquires attribute data of the item and historical sales data of multiple historical time periods corresponding to the predicted time period; A prediction module, inputting the attribute data and the historical sales quantities of the multiple historical time periods into a sales prediction model to obtain target sales data for the prediction time period; Wherein, the sales volume prediction model is trained according to any one of the methods described in claims 1-5.
9. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.