CN114549046A - Sales prediction method, system, device and storage medium based on fusion model - Google Patents

Sales prediction method, system, device and storage medium based on fusion model Download PDF

Info

Publication number
CN114549046A
CN114549046A CN202210049250.9A CN202210049250A CN114549046A CN 114549046 A CN114549046 A CN 114549046A CN 202210049250 A CN202210049250 A CN 202210049250A CN 114549046 A CN114549046 A CN 114549046A
Authority
CN
China
Prior art keywords
data
target
sales
prediction
training
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210049250.9A
Other languages
Chinese (zh)
Inventor
黄博
杨磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Deepexi Technology Co Ltd
Original Assignee
Beijing Deepexi Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Deepexi Technology Co Ltd filed Critical Beijing Deepexi Technology Co Ltd
Priority to CN202210049250.9A priority Critical patent/CN114549046A/en
Publication of CN114549046A publication Critical patent/CN114549046A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0201Market modelling; Market analysis; Collecting market data
    • G06Q30/0202Market predictions or forecasting for commercial activities

Landscapes

  • Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • Finance (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Game Theory and Decision Science (AREA)
  • Data Mining & Analysis (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the disclosure provides a sales prediction method, a sales prediction system, sales prediction equipment and a storage medium based on a fusion model. The method discloses that historical sales data of a preset period is obtained; preprocessing historical sales data to generate target training data and target test data; inputting first training data into a preset initial time sequence prediction model for first training, and outputting a first prediction result; determining a first target parameter according to the first prediction result and the first test data; inputting second training data into a preset initial long-short term memory network for second training, and outputting a second prediction result; determining a second target parameter according to the second prediction result and the second test data; and constructing a fusion model function according to the first target parameter and the second target parameter, and determining a target predicted sales result according to the fusion model function. The prediction accuracy can be improved through the embodiment of the disclosure.

Description

Sales prediction method, system, device and storage medium based on fusion model
Technical Field
The invention relates to the technical field of computers, in particular to a sales prediction method, a sales prediction system, sales prediction equipment and a storage medium based on a fusion model.
Background
Currently, with the rise of online merchants, the operation of new offline retail is becoming more difficult, facing a new trend that is becoming more severe, in order to reduce the cost increase benefit, increase the turnover of the enterprise, two demand scenarios that retailers often use: before annual planning, determining a more accurate ordering plan according to sales data of the past years; and secondly, after the commodities are sold in the market in the season, determining which commodities are subjected to order replenishment sent to the factory in advance according to the sales condition along with the occurrence of a sales event. According to the method, a retailer needs to judge advance stock according to historical sales data according to a scene one, however, due to impact of online merchants, errors of online advance order and actual sales are too large, goods are difficult to sell due to too many orders, and therefore the goods need to be thrown away due to loss discount, the order is less, market requirements cannot be met, brand image is influenced, and losses caused to enterprises are difficult to predict. In the second scenario, due to a certain period in the factory production process, specific commodity sales needs to be predicted, and replenishment preparation is made in advance. Therefore, accurate and effective commodity sales prediction has important reference value for ordering before annual planning and replenishing at the late stage of sales of retail enterprises.
However, sales prediction of retail goods is influenced by a large number of factors. Whether the passenger flow volume, the commodity discount, the commodity attribute or the current day weather are all the restriction factors influencing the commodity sales volume. Under the condition that main influence factors cannot be acquired, the existing prediction algorithm usually predicts future sales by mining useful deep information through data analysis, and the common methods mainly comprise deep learning prediction and time series prediction: the deep learning method mainly adopts a special recurrent neural network (LSTM) (long-short memory network) method, and can determine the useful information degree in the predicted sequence by adding a forgetting gate, so that the future sequence value can be predicted better; the time series prediction mainly includes ES (exponential smoothing method), AR (autoregressive model), ARIMA (differential autoregressive moving average model) methods, and the like.
In the related technology, through the analysis of sales data of retailers, the types of commodities with periodic characteristics can be generally predicted by adopting a time sequence algorithm, but offline retail is influenced by external factors more, and the prediction of a single algorithm cannot meet the requirement of offline prediction. The time sequence prediction algorithm mainly predicts the sales condition in a period of time in the future according to historical and current store sales data, but only considers the time sequence correlation of the data and does not consider the influence of external factors such as weather, market passenger flow and the like on a prediction object, so that the prediction result deviation is probably larger when the time sequence prediction algorithm is used in special periods such as holidays and the like.
Disclosure of Invention
The present invention is directed to solving at least one of the problems of the prior art. Therefore, the invention provides a sales prediction method, a sales prediction system, a sales prediction device and a storage medium based on a fusion model, which can construct the fusion model by processing historical sales data and then determine a target prediction sales result according to the fusion model, thereby improving the prediction accuracy.
In order to achieve the above object, a first aspect of the embodiments of the present disclosure provides a sales prediction method based on a fusion model, including:
acquiring historical sales data of a preset period;
preprocessing historical sales data to generate target training data and target test data, wherein the target training data at least comprises one of the following data: the first training data, the second training data, the target test data includes at least one of: first test data and second test data;
inputting first training data into a preset initial time sequence prediction model for first training, and outputting a first prediction result;
determining a first target parameter according to the first prediction result and the first test data, and determining a target time sequence prediction model according to the first target parameter;
inputting second training data into a preset initial long-short term memory network for second training, and outputting a second prediction result;
determining a second target parameter according to the second prediction result and the second test data, and determining a target long-term and short-term memory network according to the second target parameter;
and constructing a fusion model function according to the first target parameter and the second target parameter, and determining a target predicted sales result according to the fusion model function.
In some embodiments, the predetermined operation function includes at least one of: the method comprises the steps of preprocessing historical sales data through a logarithm function and a normalization feature function to generate target training data and target test data, and comprises the following steps:
cleaning historical sales data according to a preset cleaning rule to obtain target sales data;
performing aggregation processing on the target sales data to obtain sales time dimension data and sales volume information dimension data corresponding to the sales time dimension data;
calculating the sales volume information dimensional data according to the logarithmic function and the normalized characteristic function respectively to obtain corresponding logarithmic data and normalization data respectively;
and classifying the logarithmic data and the normalized data according to a preset time division rule to generate target training data and target test data.
In some embodiments, the historical sales data includes at least one of: the method comprises the following steps of cleaning historical sales data according to preset cleaning rules to obtain target sales data, wherein the commodity attribute data, the commodity sales data and the loading information data comprise:
according to a preset data analysis library code, merging historical sales data in different historical periods to obtain first merged information;
based on the first combination information, carrying out first combination processing on the commodity sales data and the information data on the counter to obtain first combination data;
performing first cleaning processing on the first combined data according to a cleaning rule to obtain first cleaning data;
performing second combination processing on the first cleaning data and the commodity attribute data to obtain second combination data;
and carrying out second cleaning treatment on the second combined data according to the cleaning rule to obtain target sales data.
In some embodiments, inputting first training data into a preset initial time series prediction model for first training, and outputting a first prediction result, includes:
setting holiday node data influencing sales volume and influence factor data corresponding to the holiday node data;
combining the influence factor data and the parameter value data of the initial time series prediction model into parameter space combination data;
combining the parameter space combination data and the first training data to obtain first parameter data;
and inputting the first parameter data into the initial time series prediction model for first training, and outputting a first prediction result.
In some embodiments, determining a first target parameter according to the first prediction result and the first test data, and determining a target time series prediction model according to the first target parameter includes:
defining a preset evaluation function as a prediction evaluation index, wherein the evaluation function at least comprises one of the following: a mean square error function and a root mean square error function;
inputting the first prediction result and the first test data into a mean square error function and a root mean square error function respectively to obtain a corresponding first mean square error function value and a corresponding first root mean square error function value respectively;
and determining a first target parameter according to the first mean square error function value and the first mean square error function value, wherein the first target parameter is used for determining a target time sequence prediction model.
In some embodiments, inputting the second training data into a preset initial long-short term memory network for second training, and outputting a second prediction result, includes:
combining the parameter space combination data and the second training data to obtain second parameter data;
and inputting the second parameter data into the initial long-short term memory network for second training, and outputting a second prediction result.
In some embodiments, determining the target forecast sales result according to the fusion model function comprises:
determining a target parameter group for obtaining the target function value according to the target function value of the fusion model function and the historical sales value corresponding to the same period;
and inputting the target parameter group into the fusion model function for calculation processing to obtain a target prediction sale result.
To achieve the above object, a second aspect of the embodiments of the present disclosure provides a sales prediction system based on a fusion model, including:
the acquisition module is used for acquiring historical sales data in a preset period;
the preprocessing module is used for preprocessing the historical sales data to generate target training data and target test data, wherein the target training data at least comprises one of the following data: the first training data, the second training data, the target test data includes at least one of: first test data and second test data;
the first training module is used for inputting first training data into a preset initial time sequence prediction model for first training and outputting a first prediction result;
the first determining module is used for determining a first target parameter according to the first prediction result and the first test data, and determining a target time sequence prediction model according to the first target parameter;
the second training module is used for inputting second training data into a preset initial long-short term memory network for second training and outputting a second prediction result;
the second determining module is used for determining a second target parameter according to a second prediction result and second test data and determining a target long-short term memory network according to the second target parameter;
and the prediction module is used for constructing a fusion model function according to the first target parameter and the second target parameter and determining a target prediction sale result according to the fusion model function.
In order to achieve the above object, a third aspect of the embodiments of the present disclosure provides a sales prediction apparatus based on a fusion model, including:
at least one memory;
at least one processor;
at least one program;
the programs are stored in a memory, and a processor executes the at least one program to implement:
a method for predicting sales based on a fusion model according to the first aspect.
To achieve the above object, a fourth aspect of the embodiments of the present disclosure proposes a storage medium that is a computer-readable storage medium storing computer-executable instructions for causing a computer to perform:
a method for predicting sales based on a fusion model according to the first aspect.
According to the sales prediction method, the sales prediction system, the sales prediction equipment and the sales prediction storage medium based on the fusion model, which are provided by the embodiment of the invention, at least the following beneficial effects are achieved:
the embodiment of the disclosure provides a sales prediction method, a system, a device and a storage medium based on a fusion model, which are implemented by firstly acquiring historical sales data of a preset period; preprocessing historical sales data to generate target training data and target test data, wherein the target training data at least comprises one of the following data: the first training data, the second training data, the target test data includes at least one of: first test data and second test data; inputting first training data into a preset initial time sequence prediction model for first training, and outputting a first prediction result; determining a first target parameter according to the first prediction result and the first test data, and determining a target time sequence prediction model according to the first target parameter; inputting second training data into a preset initial long-short term memory network for second training, and outputting a second prediction result; determining a second target parameter according to the second prediction result and the second test data, and determining a target long-term and short-term memory network according to the second target parameter; and constructing a fusion model function according to the first target parameter and the second target parameter, and determining a target predicted sales result according to the fusion model function. According to the embodiment of the disclosure, the historical sales data can be processed to construct the fusion model, and then the target prediction sales result is determined according to the fusion model, so that the prediction accuracy is improved.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The invention is further described with reference to the following figures and examples, in which:
FIG. 1 is a schematic flow chart of a specific method for predicting sales based on a fusion model according to the present invention;
FIG. 2 is a flowchart illustrating a specific process of step S200 in FIG. 1;
FIG. 3 is a flowchart illustrating a specific process of step S210 in FIG. 2;
FIG. 4 is a flowchart illustrating a specific process of step S300 in FIG. 1;
FIG. 5 is a flowchart illustrating a specific process of step S400 in FIG. 1;
FIG. 6 is a flowchart illustrating a specific process of step S500 in FIG. 1;
FIG. 7 is a flowchart illustrating a specific process of step S700 in FIG. 1;
FIG. 8 is a visualization of historical sales data for a preset period of time provided by the present invention;
FIG. 9 is a sales prediction curve fitted to a class of initial time series prediction models provided by the present invention;
FIG. 10 is a diagram of the flow of data to and gate processing within the cells of the initial long-short term memory network model provided by the present invention;
FIG. 11 is a comparison graph of predicted values and actual values of a class of the initial long-short term memory network model provided by the present invention;
FIG. 12 is a comparison graph of the actual value and the predicted value of a certain class of weekly combination of the fusion model provided by the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
In the description of the present invention, it should be understood that the orientation or positional relationship referred to in the description of the orientation, such as the upper, lower, front, rear, left, right, etc., is based on the orientation or positional relationship shown in the drawings, and is only for convenience of description and simplification of description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus, should not be construed as limiting the present invention.
In the description of the present invention, the meaning of a plurality is one or more, the meaning of a plurality is two or more, and the above, below, exceeding, etc. are understood as excluding the present numbers, and the above, below, within, etc. are understood as including the present numbers. If the first and second are described for the purpose of distinguishing technical features, they are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated.
In the description of the present invention, unless otherwise explicitly limited, terms such as arrangement, installation, connection and the like should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific contents of the technical solutions.
In the description of the present invention, reference to the description of the terms "one embodiment," "some embodiments," "an illustrative embodiment," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
First, several terms referred to in the present application are resolved:
initial time series prediction model: also called prophet time sequence prediction model, is a data prediction tool based on Python and R language from Facebook. First, a known time series and corresponding values are input (Prophet is a single feature model, input has only two columns, the date column must be called "ds", and the value column called "y"); then, the length of the time series to be predicted is input, such as period setting 365, so that 365 new values are predicted; the existing time sequence and corresponding values are used for training the model, the output result comprises a target value, an upper bound, a lower bound and the like, and a trend curve can be drawn.
Initial Long Short Term Memory network (LSTM, Long Short-Term Memory): the time-cycle neural network is specially designed for solving the long-term dependence problem of the general RNN (cyclic neural network), and all the RNNs have a chain form of repeated neural network modules. In the standard RNN, this repeated structure block has only a very simple structure, e.g. one tanh layer.
In the related technology, through the analysis of sales data of retailers, the types of commodities with periodic characteristics can be generally predicted by adopting a time sequence algorithm, but offline retail is influenced by external factors more, and the prediction of a single algorithm cannot meet the requirement of offline prediction. The time sequence prediction algorithm mainly predicts the sales condition in a period of time in the future according to historical and current store sales data, but only considers the time sequence correlation of the data and does not consider the influence of external factors such as weather, market passenger flow and the like on a prediction object, so that the prediction result deviation is probably larger when the time sequence prediction algorithm is used in special periods such as holidays and the like.
Based on this, the embodiment of the present disclosure provides a sales prediction method, system, device and storage medium based on a fusion model. Respectively constructing Prophet and LSTM prediction methods aiming at sales data, date information, weather information and other information of historical years, combining the Prophet and the LSTM based on a weight coefficient method, and optimizing the model by introducing Mean Square Error (MSE) and Root Mean Square Error (RMSE) to obtain a final Prophet-LSTM fusion model. According to the sales prediction method based on the fusion model in the embodiment of the disclosure, the actual sales data of the retailer in a certain industry is verified, and the result shows that the Prophet-LSTM fusion model has higher prediction precision than the Prophet model and the LSTM model.
Specifically, the following embodiments are used to illustrate, and first, a sales prediction method based on a fusion model in the embodiments of the present disclosure is described.
As shown in fig. 1, which is a schematic flow chart of an implementation of a sales prediction method based on a fusion model according to an embodiment of the present application, the sales prediction method based on the fusion model may include, but is not limited to, steps S100 to S700.
S100, acquiring historical sales data in a preset period;
s200, preprocessing the historical sales data to generate target training data and target test data, wherein the target training data at least comprises one of the following data: the first training data, the second training data, the target test data includes at least one of: first test data and second test data;
s300, inputting first training data into a preset initial time sequence prediction model for first training, and outputting a first prediction result;
s400, determining a first target parameter according to the first prediction result and the first test data, and determining a target time sequence prediction model according to the first target parameter;
s500, inputting second training data into a preset initial long-short term memory network for second training, and outputting a second prediction result;
s600, determining a second target parameter according to a second prediction result and second test data, and determining a target long-term and short-term memory network according to the second target parameter;
s700, constructing a fusion model function according to the first target parameter and the second target parameter, and determining a target predicted sales result according to the fusion model function.
In step S100 of some embodiments, historical sales data for a preset period of time is obtained. It can be understood that, a certain retail commodity is selected from the database through the computer program, and then offline historical sales data of a certain retail commodity in a preset period is obtained.
Optionally, the historical sales data includes at least one of: commodity attribute data, commodity sales data and loading information data.
Optionally, the preset period is a certain period selected according to actual requirements, and in the embodiment of the present application, the time period from year 2018 to year 2021, month 8 may be selected as the preset period.
In step S200 of some embodiments, the historical sales data is pre-processed to generate target training data and target test data. It is understood that the specific implementation steps can be as follows: firstly, historical sales data of different historical periods are merged according to a preset data analysis library code to obtain first merged information, commodity sales data and information data of a loading cabinet are subjected to first combined processing based on the first merged information to obtain first combined data, the first combined data are subjected to first cleaning processing according to cleaning rules to obtain first cleaning data, the first cleaning data and commodity attribute data are subjected to second combined processing to obtain second combined data, the second combined data are subjected to second cleaning processing according to the cleaning rules to obtain target sales data, the target sales data are subjected to aggregation processing to obtain sales time dimension data and sales volume information dimension data corresponding to the sales time dimension data, and the sales volume information dimension data are respectively subjected to calculation processing according to a logarithm function and a normalization characteristic function, and respectively obtaining corresponding logarithmic data and normalization data, and respectively carrying out classification processing on the logarithmic data and the normalization data according to a preset time division rule to generate target training data and target test data.
It should be noted that the target training data includes at least one of the following: the first training data, the second training data, the target test data includes at least one of: first test data and second test data
In step S300 of some embodiments, first training data is input into a preset initial time series prediction model for first training, and a first prediction result is output. It is understood that the specific implementation steps can be as follows: firstly, setting holiday node data influencing sales and influence factor data corresponding to the holiday node data, combining the influence factor data and parameter value data of an initial time sequence prediction model into parameter space combination data, combining the parameter space combination data and first training data to obtain first parameter data, inputting the first parameter data into the initial time sequence prediction model for first training, and outputting a first prediction result.
It should be noted that, the initial time series prediction model: also called prophet time sequence prediction model, is a data prediction tool based on Python and R language from Facebook. First, a known time series and corresponding values are input (Prophet is a single feature model, input has only two columns, the date column must be called "ds", and the value column called "y"); then, the length of the time series to be predicted is input, such as period setting 365, so that 365 new values are predicted; the existing time sequence and corresponding values are used for training the model, the output result comprises a target value, an upper bound, a lower bound and the like, and a trend curve can be drawn.
In step S400 of some embodiments, a first target parameter is determined according to the first prediction result and the first test data, so as to determine a target time series prediction model according to the first target parameter. It is understood that the specific implementation steps may be: firstly, a preset evaluation function is defined as a prediction evaluation index, and the evaluation function at least comprises one of the following: the method comprises the steps of inputting a first prediction result and first test data into a mean square error function and a root mean square error function respectively to obtain a corresponding first mean square error function value and a corresponding first root mean square error function value respectively, and determining a first target parameter according to the first mean square error function value and the first root mean square error function value, wherein the first target parameter is used for determining a target time sequence prediction model.
In step S500 of some embodiments, second training data is input into a preset initial long-short term memory network for second training, and a second prediction result is output. It is understood that the specific implementation steps can be as follows: firstly, the parameter space combination data and the second training data are combined to obtain second parameter data, then the second parameter data are input into the initial long-short term memory network to carry out second training, and a second prediction result is output.
Note that, the initial Long Short Term Memory network (LSTM), Long Short-Term Memory: the time-cycle neural network is specially designed for solving the long-term dependence problem of the general RNN (cyclic neural network), and all the RNNs have a chain form of repeated neural network modules. In the standard RNN, this repeated structure block has only a very simple structure, e.g. one tanh layer.
In step S600 of some embodiments, a second target parameter is determined according to the second prediction result and the second test data, so as to determine the target long-short term memory network according to the second target parameter. It is understood that the specific implementation steps can be as follows: firstly, a second prediction result and second test data are respectively input into a mean square error function and a root mean square error function to respectively obtain a corresponding second mean square error function value and a corresponding second root mean square error function value, and a second target parameter is determined according to the second mean square error function value and the second root mean square error function value, wherein the second target parameter is used for determining the target long-term and short-term memory network.
In step S700 of some embodiments, a fusion model function is constructed according to the first objective parameter and the second objective parameter, and a target predicted sales result is determined according to the fusion model function. It is understood that the specific implementation steps can be as follows: firstly, according to the objective function value of the fusion model function and the historical sales value corresponding to the same period, an objective parameter group used for obtaining the objective function value is determined, and the objective parameter group is input into the fusion model function to be calculated, so that an objective prediction sales result is obtained.
In some embodiments, as shown with reference to fig. 2, step S200 may also include, but is not limited to, steps S210 to S240.
S210, cleaning historical sales data according to a preset cleaning rule to obtain target sales data;
s220, performing aggregation processing on the target sales data to obtain sales time dimension data and sales volume information dimension data corresponding to the sales time dimension data;
s230, calculating the sales information dimensional data according to the logarithmic function and the normalized characteristic function to respectively obtain corresponding logarithmic data and normalization data;
and S240, classifying the logarithmic data and the normalized data according to a preset time division rule to generate target training data and target test data.
In step S210 of some embodiments, the historical sales data is cleaned according to a preset cleaning rule, so as to obtain the target sales data. It is understood that the specific implementation steps can be as follows: the method comprises the steps of firstly carrying out merging processing on historical sales data in different historical periods according to preset data analysis library codes to obtain first merging information, carrying out first combining processing on commodity sales data and information data on a loading cabinet based on the first merging information to obtain first combining data, carrying out first cleaning processing on the first combining data according to cleaning rules to obtain first cleaning data, carrying out second combining processing on the first cleaning data and commodity attribute data to obtain second combining data, and carrying out second cleaning processing on the second combining data according to the cleaning rules to obtain target sales data.
In the embodiment of the present application, the target sales data is also data recorded in the commodity sales information summary table.
In step S220 of some embodiments, the target sales data is aggregated to obtain sales time dimension data and sales volume information dimension data corresponding to the sales time dimension data. It can be understood that a category can be defined according to the requirement to aggregate the target sales data according to the category, so as to obtain the sales time dimension data and the sales volume information dimension data corresponding to the sales time dimension data.
Optionally, the categories in the embodiments of the present application may include at least: style details and season and gender.
In some embodiments, the style, season and gender are defined as a category, and the corresponding categories are aggregated according to the year from the commodity sales information table corresponding to the target sales data to obtain the sales time dimension data and the sales volume information dimension data corresponding to the sales time dimension data, wherein the sales time dimension data t and the sales volume information dimension data y (t) are the sales time dimension data t and the sales volume information dimension data y (t) respectively.
In step S230 of some embodiments, the sales information dimension data is respectively calculated according to the logarithmic function and the normalized feature function, so as to respectively obtain corresponding logarithmic data and normalization data. It can be understood that, logarithmic transformation operation processing is performed on the sales information dimensional data y (t) according to a logarithmic function to obtain logarithmic data, since the actual sales data is distributed between 0 and 300, in order to make the data more amenable to gaussian distribution when training a Prophet model, log1p function is required to perform logarithmic transformation on the original data, the output result is restored by an expm1 function, and a specific calculation formula for obtaining the logarithmic data is as follows:
log1p:=ln(x+1) (1)
expm1:=exp(x)-1 (2)
normalizing the sales information dimensional data Y (t) according to the normalized feature function to obtain normalized data, wherein the LSTM model comprises a sigmoid function and a tanh function, so that a MinMaxScale function is required to be adopted to normalize the original data, and an inverse _ transform function is adopted to restore the data during prediction output, so that a specific calculation formula for obtaining the normalized data is as follows:
Figure BDA0003473785600000101
x(t)=x′(t)(xmax-xmin)+xmin (4)
where x (t) is sales data for a certain day, and x' (t) is converted data, i.e., normalized data.
In step S240 of some embodiments, the logarithmic data and the normalization data are classified according to a preset time division rule, so as to generate target training data and target test data. It is understood that the preset time rule may be to divide a time node in a time period, and may specify that training data is present before the time node, and data after the time node is test data, so in this embodiment of the present application, a time node may be present in 12/31/2020, and the logarithmic data and the normalization data are classified based on the time node, that is, the logarithmic data P '(t) and the normalization data L' (t) before the time node are target training data, and the logarithmic data P "(t) and the normalization data L" (t) after the time node are target test data.
Further, the target training data includes at least one of: first training data P '(t), second training data L' (t); the target test data includes at least one of: first test data P "(t), second test data L" (t).
In some embodiments, as shown with reference to fig. 3, step S210 may also include, but is not limited to, steps S211-S215.
S211, merging the historical sales data in different historical periods according to a preset data analysis library code to obtain first merged information;
s212, based on the first combined information, carrying out first combined processing on the commodity sales data and the information data on the counter to obtain first combined data;
s213, performing first cleaning processing on the first combined data according to a cleaning rule to obtain first cleaning data;
s214, performing second combination processing on the first cleaning data and the commodity attribute data to obtain second combination data;
and S215, performing second cleaning processing on the second combined data according to the cleaning rule to obtain target sales data.
In step S211 of some embodiments, the historical sales data of different historical periods are merged according to a preset data analysis library code, so as to obtain first merged information. It is understood that program code, such as a call to the Pandas library, may be used to merge historical sales data for a past year to obtain the first merged information and to obtain the first merged data.
In some embodiments, after the first consolidated information is obtained, sales record data with a discount of zero in the merchandise sales data is deleted, and the sales record data contains non-merchandise sales information such as gifts or shopping bags.
Optionally, the historical sales data includes at least one of: commodity attribute data, commodity sales data and loading information data.
In step S212 of some embodiments, the first combination processing is performed on the commodity sales data and the loading information data based on the first combination information, so as to obtain first combination data. It is understood that after the preliminary combination of the historical sales data is performed in step S211, the first combination processing is performed on the commodity sales data and the upper cabinet information data in the historical sales data to obtain first combination data, which is used for cleaning the data to remove invalid data.
In step S213 of some embodiments, a first cleaning process is performed on the first combined data according to a cleaning rule, so as to obtain first cleaning data. It can be understood that after the first combined data is obtained by performing the first combined processing on the commodity sales data and the loading information data, the first combined data is cleaned according to a preset cleaning rule, so that invalid data is removed, and the first cleaned data is obtained.
In step S214 of some embodiments, the first cleaning data and the article attribute data are subjected to a second combination process to obtain second combination data. It is understood that the second combination processing of the first cleaning data and the article attribute data in the historical sales data results in second combination data for cleaning the data again to remove invalid data.
In step S215 of some embodiments, a second cleaning process is performed on the second combined data according to the cleaning rule, so as to obtain the target sales data. It can be understood that after the first cleaning data and the article attribute data are subjected to the second combination processing to obtain the second combination data, the second combination data are cleaned according to a preset cleaning rule, so that invalid data are removed, and target sales data are obtained.
In some embodiments, as shown with reference to fig. 4, step S300 may also include, but is not limited to, steps S310 to S340.
S310, setting holiday node data influencing sales volume and influence factor data corresponding to the holiday node data;
s320, combining the influence factor data and the parameter value data of the initial time series prediction model into parameter space combination data;
s330, combining the parameter space combination data and the first training data to obtain first parameter data;
s340, inputting the first parameter data into the initial time series prediction model for first training, and outputting a first prediction result.
In step S310 of some embodiments, holiday node data that affects the sales volume and impact factor data corresponding to the holiday node data are set. It is to be appreciated that in some embodiments of the present application, the holiday node data may include at least one of: the legal holiday data of China between 2018 and 2021 comprise holidays in the retail industry field, such as 618, 11 and 12, and the holiday data of teacher festivals and the data of corresponding influence factors are added.
In step S320 of some embodiments, parameter space combination data is combined according to the influence factor data and the parameter value data of the initial time series prediction model. It can be understood that the influence factor data obtained in step S340 and the parameter value data of the initial time series prediction model are combined to form the parameter space combination data.
Optionally, the parameter value data of the initial time series prediction model at least includes one of the following data: yearly _ search, weekly _ search, changes, day _ search, search _ prior _ scale, change _ prior _ scale, holiys _ prior _ scale, n _ changes.
Further, growth trend (growth), seasonal trend (seakeeping), and holiday effect (holidabys), Yearly _ seakeeping, are used to fit the annual seasonal trend. (ii) a Weekly _ seasonal to fit Weekly seasonal trends. (ii) a Daily _ seanouity to fit seasonal trends of each day; hollidays, the input data frame containing the vacation name and time. (ii) a seaselectivity _ prior _ scale, which is used for changing the parameter of seaselectivity model strength; a holoday _ prior _ scale used for changing parameters of the intensity of the holoday model; changes points.
In step S330 of some embodiments, the parameter space combination data and the first training data are combined to obtain first parameter data. It is understood that the parameter space combination data obtained in step S320 and the first training data P' (t) obtained in step S240 are combined to obtain first parameter data for inputting the initial time series prediction model for training.
In step S340 of some embodiments, the first parameter data is input into the initial time series prediction model for the first training, and the first prediction result is output. It is understood that the first parameter data obtained in step S330 is input to the initial time series prediction model for training to obtain the first prediction result.
It should be noted that the output first prediction result is restored by using the expm1 function
Figure BDA0003473785600000135
Then aggregating the daily sales data of the target sales data into weekly sales prediction data, and taking the sales prediction data of the previous n weeks
Figure BDA0003473785600000136
In some embodiments, as shown with reference to fig. 5, step S400 may also include, but is not limited to, steps S410 to S430.
S410, defining a preset evaluation function as a prediction evaluation index, wherein the evaluation function at least comprises one of the following: a mean square error function and a root mean square error function;
s420, inputting the first prediction result and the first test data into a mean square error function and a root mean square error function respectively to obtain a corresponding first mean square error function value and a corresponding first root mean square error function value respectively;
and S430, determining a first target parameter according to the first mean square error function value and the first mean square error function value, wherein the first target parameter is used for determining a target time series prediction model.
In step S410 of some embodiments, a preset evaluation function is defined as a predictive evaluation index. It is understood that the first prediction result and the second prediction result are evaluated by referring to the existing evaluation function, and are used as evaluation indexes.
Optionally, the evaluation function includes at least one of: mean square error function (MSE) and root mean square error function (RMSE).
The specific formula of the evaluation function is as follows:
Figure BDA0003473785600000131
Figure BDA0003473785600000132
wherein y istIn order to be a true sales value,
Figure BDA0003473785600000133
for sales prediction, n is the predicted future number of weeks, and typically, the retailer will take a 28-week life cycle for sales of the item class, which is applicable to conventional sales means such as sales promotion and replenishment.
In step S420 of some embodiments, the first prediction result and the first test data are respectively input into a mean square error function and a root mean square error function, so as to obtain a corresponding first mean square error function value and a corresponding first root mean square error function value. It can be understood that the first prediction result obtained through the step S340 will be
Figure BDA0003473785600000134
And inputting the first test data P "(t) obtained in step S240 into the evaluation function in step S410 for calculation, so as to obtain a corresponding first mean square error function value and a corresponding first root mean square error function value, respectively.
In step S430 of some embodiments, a first target parameter is determined according to the first mean square error function value and the first root mean square error function value, and the first target parameter is used for determining the target time series prediction model. It can be understood that, according to the first mean square error function value and the first root mean square error function value obtained by the evaluation calculation in step S420, a parameter combination with the lowest first mean square error function value and the lowest first root mean square error function value is taken as a first target parameter, and a time series prediction model corresponding to the first target parameter is taken as a target time series prediction model.
In some embodiments, as shown with reference to fig. 6, step S500 may also include, but is not limited to, steps S510 to S520.
S510, combining the parameter space combination data and the second training data to obtain second parameter data;
s520, inputting the second parameter data into the initial long-short term memory network for second training, and outputting a second prediction result.
In step S510 of some embodiments, the parameter space combination data and the second training data are combined to obtain second parameter data. It is understood that the parameter space combination data obtained in step S320 and the second training data P "(t) obtained in step S240 are combined to obtain second parameter data for inputting the initial long-short term memory network for training.
In step S520 of some embodiments, second parameter data is input into the initial long-short term memory network for second training, and a second prediction result is output. It is understood that the second parameter data obtained in step S510 is input to the initial long-short term memory network for training to obtain the second prediction result.
It should be noted that the output result is restored by using inverse _ transform function
Figure BDA0003473785600000141
Then aggregating the daily sales data of the target sales data into weekly sales prediction data, and taking the sales prediction data of the previous n weeks
Figure BDA0003473785600000142
In some embodiments, as shown with reference to fig. 7, step S700 may also include, but is not limited to, steps S710-S720.
S710, determining a target parameter group for obtaining a target function value according to the target function value of the fusion model function and the historical sales value corresponding to the same period;
and S720, inputting the target parameter group into the fusion model function for calculation processing to obtain a target prediction sale result.
In step S710 of some embodiments, an objective parameter set for obtaining the objective function value is determined according to the objective function value of the fusion model function and the historical sales value corresponding to the same period. It is understood that a fusion model function is constructed according to the first objective parameter obtained in step S400 and the second objective parameter obtained in step S600, and a set of objective parameters for obtaining the objective function values is determined according to the objective function values of the fusion model function and the historical sales values corresponding to the same period.
Setting the first target parameter to ω1tAnd the second target parameter is ω2tJointly form two sets of parameter space sets, wherein t is belonged to [1, n ∈],ω1t2t∈[0,1]I.e. taking a parameter set of n weeks.
Fusing model functions:
Figure BDA0003473785600000151
when the value of the objective function
Figure BDA0003473785600000152
The parameter set omega is set when the evaluation value based on MSE and RMSE is minimum compared with the actual sales value Y (t)1tAnd ω2tI.e. the target parameter set.
In step S720 of some embodiments, the target parameter set is input into the fusion model function for calculation processing, so as to obtain a target predicted sales result. It can be understood that the target parameter group is input into the constructed fusion model function for calculation processing, so that a target predicted sales result can be obtained, and the retail commodity is reasonably planned according to the target predicted sales result.
Furthermore, experiments show that by comparing MSE and RMSE values of three models, namely Prophet, LSTM and Prophet-LSTM (fusion model), the algorithm model disclosed by the technical scheme of the embodiment of the disclosure can well relieve the prediction smoothness of a Prophet single time sequence algorithm, also makes up the disadvantages of a short period and single prediction output of LSTM, and can be suitable for prediction scenes of other time sequence characteristics.
In addition, the sales prediction method based on the fusion model corresponding to the present application also discloses a specific embodiment:
in some embodiments, offline historical sales data of a retailer from 2018 to 2021 for 8 months are selected, the data comprise commodity attribute data, commodity sales data and information data of a loading counter, then data cleaning is performed, interference data of non-prediction items and repeated sales data are removed, a feature project is constructed according to two dimensions of time and sales selected by the fusion model of the invention, the feature project is respectively input into a Prophet model and an LSTM model for training and prediction, and finally, an optimal parameter combination is obtained through grid search of balance parameters to serve as a prediction result of the fusion model.
Further, fig. 8 shows that the offline sales data of a certain retailer constructs a class according to the rule of "style and detail + season + sex", and a historical year actual sales graph of one class, from which the historical periodicity of the sales graph and the sales volume influence caused by holidays can be obviously observed.
Optionally, a feature project is constructed according to input requirements of the model, firstly, sales data in 2021 year is predicted according to the sales data in 2018-2020, and data are divided into a training set of curves before 2021 month and a testing set of red curves after 2021 month in fig. 8 by taking '2020-12-31' as date nodes, wherein the training set is before the date, and the testing set is after the date. Then, respectively inputting the training sets into the Prophet model and the LSTM model, wherein the specific implementation mode is as follows:
optionally, since the actual sales data are distributed between 0 and 300, in order to make the data more amenable to gaussian distribution when training the Prophet model, log1p function is needed to perform logarithmic transformation on the original data, and the output result is restored by the expm1 function, and the specific operations are as follows:
log1p:=ln(x+1) (1)
expm1:=exp(x)-1 (2)
optionally, because the LSTM model includes a sigmoid function and a tanh function, it is necessary to normalize the original data by using a minmaxscale function, and perform data reduction by using an inverse _ transform function when predicting output, and the specific operations are as follows:
Figure BDA0003473785600000161
x(t)=x′(t)(xmax-xmin)+xmin (4)
where x (t) is sales data for a certain day and x' (t) is converted data.
Optionally, after the original data is converted, the original data needs to be input into a Prophet model and an LSTM model respectively for training, the Prophet model is a time series prediction model and is adapted to different seasonal trends and holiday distributions, and the model can be decomposed into three parts: trend term, season term and holiday term, the expression is as follows:
Figure BDA0003473785600000162
wherein g (t) is a trend term, s (t) is a season term, h (t) is a holiday term, epsilontIs an error term.
Optionally, the trend term may adjust the smoothness of the model and change the fitting trend of the model according to the change point of the data, and the invention adopts a logistic saturated growth model, and the basic formula is as follows:
Figure BDA0003473785600000163
where C is the model's capacity, k is the growth rate, and m is the offset.
Optionally, the seasonal term represents periodic regular changes, and in order to fit the periodic changes of the sales data such as year, month, week, day, etc., Prophet adopts a seasonal model based on fourier series:
Figure BDA0003473785600000164
in some embodiments, the trend of the fitted curve is adjusted by adjusting the total number of cycles N, the fixed number of cycles P, and the number of 2N cycles. According to the embodiment of the invention, according to the characteristic visualization analysis of fig. 8, the periodic characteristics, namely, yearly _ search availability, weekly _ search availability, and day _ search availability, are all set to True states, and the search availability _ prior _ scale parameter space range is set between (1, 15) and the interval is set to 0.5.
Optionally, the holiday term establishes an independent model according to a predetermined holiday event, and estimates according to the following formula:
Figure BDA0003473785600000165
where L is the set of holidays, i is the second holiday, kiFor corresponding holiday-influencing factors, DiIs the time t contained in the window period. In addition to the legal holidays in 2018-2021, the holidays with the retail industry field, such as 618, 11 and 12, are additionally arranged, and the influence factors of teacher festivals are also additionally arranged. Modeling of the holiday model is completed through the setting of the holiday and the influence factors, and the spatial range of the holodays _ prior _ scale parameter is set to be between (1, 15) and the interval is 0.5.
Optionally, in addition to the above hyper-parameter setting, the Prophet still needs to set change points (change points), which are generally obtained according to automatic detection or manual operation input, so as to change the change trend, where the number of the change points (n _ change points) is generally set to 25, and the range of change point _ range is set to (0.1, 1.5), the interval is 0.1, the parameter setting range of change point _ prior _ scale is set to (0.01, 0.1), and the interval is 0.05.
Further, setting a range according to the parameters of the detailed steps, then carrying out gridding parameter search training, comparing the following Mean Square Error (MSE) and the following mean square error (RMSE) between the prediction result of each group of parameters and the actual sales result, taking the parameter combination of the MSE and the RMSE minimum value as the parameters of the final Prophet model, wherein the fitting curve is shown in FIG. 9, the black point is normalized daily sales data, and the gray curve is the curve fitted by the Prophet algorithm.
Figure BDA0003473785600000171
Figure BDA0003473785600000172
Alternatively, LSTM is a special Recurrent Neural Network (RNN) that consists of a collection of cells with features that are used to memorize data sequences, the cells in the collection being used to capture and store data streams, suitable for processing and predicting significant events with very long intervals and delays in time series. Additionally, the cells in the set constitute an internal interconnection of the previous module with the current module, thereby communicating information from a plurality of past time instants to the current module.
Further, as shown in fig. 10, a forgetting gate, an input gate and an output gate are used in each unit of the LSTM, and respectively process, filter or add data in the unit for the next unit, wherein the input h ist-1Is the state of the last hidden layer, xtFor the input value at the present moment, htBeing the hidden layer state at the current moment, Ct-1In the state of a hidden layer at the last moment, CtThe cell state at the current time.
Optionally, forget gate for input xtAnd ht-1After passing through the Sigmoid activation function, a number between 0 and 1 is output, and the number is the data quantity which should pass through each unit, wherein 1 represents that the value is completely reserved; and 0 means "ignore this value completely".
Figure BDA0003473785600000173
Optionally, the input gate decides which data needs to be stored in the data unit after passing through the Sigmoid layer and the Tanh layer. The initial Sigmoid layer, called the "input gate layer", decides which values need to be modified, and then a vector of new candidate values that can be added to the state is generated by the Tanh layer.
Figure BDA0003473785600000174
Optionally, the output gate determines the content output by each unit, and the output gate outputs a data value according to the state of the data unit after the data is filtered and the data is newly added.
In some embodiments, in terms of super parameter selection, 50-130 hidden layer nodes are used, the interval is 10, the moving window is 7-28, the interval is 7 to serve as a predicted observation period of future sales, optimal super parameter searching is independently carried out on each category in a grid searching mode, after 100-500 epochs are trained, the optimal LSTM prediction model generation is completed according to the parameter combination obtained by the minimum value of MSE and RMSE, as shown in FIG. 11, by comparing the prediction result of the LSTM algorithm with the actual value.
Further, after the optimal Prophet model and LSTM model training are completed, fusion prediction needs to be carried out on the Prophet model and the LSTM model, so that the defects caused by a single model are avoided, and the fusion prediction is carried out according to the following modes:
Figure BDA0003473785600000181
wherein t is equal to [1, n ]],ω1t2t∈[0,1]Namely, the parameter group of n weeks is taken,
Figure BDA0003473785600000182
in order to fuse the predicted values,
Figure BDA0003473785600000183
predicted value of Prophet, ω1tThe weight parameter of the Prophet predicted value at the time t,
Figure BDA0003473785600000184
as a predictor of LSTM, ω2tIs the weight parameter of the LSTM predicted value at the time t.
Optionally, in order to determine ω1tAnd ω2tThe invention adopts a voting method and a weight method, when the prediction results deviate from the true values on one side, the voting method is adopted to select the result with smaller deviation, when the prediction results are on two sides of the true values, the weight method is adopted to obtain larger weight from smaller deviation, and the specific calculation mode is as follows:
Figure BDA0003473785600000185
Figure BDA0003473785600000186
wherein epsilonPAnd εLThe prediction errors for Prophet and LSTM, respectively, are calculated as follows:
Figure BDA0003473785600000187
Figure BDA0003473785600000188
in some embodiments, referring to fig. 12, according to a technical solution implemented by a sales prediction method based on a fusion model in the embodiments disclosed in the present invention, a prediction result has a better prediction result than a single model, so that the under-fitting problem caused by the single model can be avoided, and the prediction accuracy is effectively improved.
In addition, the embodiment of the present disclosure further provides a sales prediction system based on a fusion model, which can implement the sales prediction method based on the fusion model, and the system includes:
the acquisition module is used for acquiring historical sales data in a preset period;
the preprocessing module is used for preprocessing the historical sales data to generate target training data and target test data, wherein the target training data at least comprises one of the following data: the first training data and the second training data, and the target test data at least comprises one of the following data: first test data and second test data;
the first training module is used for inputting first training data into a preset initial time sequence prediction model for first training and outputting a first prediction result;
the first determining module is used for determining a first target parameter according to the first prediction result and the first test data, and determining a target time sequence prediction model according to the first target parameter;
the second training module is used for inputting second training data into a preset initial long-short term memory network for second training and outputting a second prediction result;
the second determining module is used for determining a second target parameter according to a second prediction result and second test data and determining a target long-short term memory network according to the second target parameter;
and the prediction module is used for constructing a fusion model function according to the first target parameter and the second target parameter and determining a target prediction sales result according to the fusion model function.
According to the sales prediction system based on the fusion model, by realizing the sales prediction method based on the fusion model, through the acquisition module, the preprocessing module, the first training module, the first determination module, the second training module, the second determination module and the prediction module, the fusion model can be constructed by processing historical sales data, and then the target prediction sales result can be determined according to the fusion model, so that the prediction accuracy is improved.
In addition, the embodiment of the present disclosure further provides a sales prediction apparatus based on a fusion model, where the apparatus includes:
at least one memory;
at least one processor;
at least one program;
the programs are stored in a memory, and a processor executes the at least one program to implement:
the first aspect of the embodiments of the present disclosure provides a sales prediction method based on a fusion model.
In addition, the embodiment of the present disclosure further provides a storage medium storing executable instructions, where the executable instructions can be executed by a computer, so as to enable the computer to execute the sales prediction method based on the fusion model according to the first aspect of the embodiment of the present disclosure.
The memory, as a non-transitory storage medium, may be used to store non-transitory software programs as well as non-transitory computer-executable programs. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The embodiments described in the embodiments of the present disclosure are for more clearly illustrating the technical solutions of the embodiments of the present disclosure, and do not constitute a limitation to the technical solutions provided in the embodiments of the present disclosure, and it is obvious to those skilled in the art that the technical solutions provided in the embodiments of the present disclosure are also applicable to similar technical problems with the evolution of technology and the emergence of new application scenarios.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes multiple instructions for causing a computer device (which may be a personal computer, a server, or a network device) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing programs, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The preferred embodiments of the present disclosure have been described above with reference to the accompanying drawings, and therefore do not limit the scope of the claims of the embodiments of the present disclosure. Any modifications, equivalents and improvements within the scope and spirit of the embodiments of the present disclosure should be considered within the scope of the claims of the embodiments of the present disclosure by those skilled in the art.

Claims (10)

1. The sales prediction method based on the fusion model is characterized by comprising the following steps:
acquiring historical sales data of a preset period;
preprocessing the historical sales data to generate target training data and target test data, wherein the target training data at least comprises one of the following data: the target test data comprises at least one of the following: first test data and second test data;
inputting the first training data into a preset initial time sequence prediction model for first training, and outputting a first prediction result;
determining a first target parameter according to the first prediction result and the first test data, and determining a target time sequence prediction model according to the first target parameter;
inputting the second training data into a preset initial long-short term memory network for second training, and outputting a second prediction result;
determining a second target parameter according to the second prediction result and the second test data, and determining a target long-term and short-term memory network according to the second target parameter;
and constructing a fusion model function according to the first target parameter and the second target parameter, and determining a target predicted sales result according to the fusion model function.
2. The fusion model-based sales prediction method of claim 1, wherein the predetermined operation function includes at least one of: the method comprises the following steps of preprocessing the historical sales data to generate target training data and target test data according to a logarithmic function and a normalized feature function, wherein the method comprises the following steps:
cleaning the historical sales data according to a preset cleaning rule to obtain target sales data;
performing aggregation processing on the target sales data to obtain sales time dimensional data and sales volume information dimensional data corresponding to the sales time dimensional data;
calculating the sales volume information dimensional data according to the logarithmic function and the normalized characteristic function to respectively obtain corresponding logarithmic data and normalization data;
and classifying the logarithmic data and the normalization data according to a preset time division rule to generate the target training data and the target test data.
3. The fusion model-based sales prediction method of claim 2, wherein the historical sales data includes at least one of: the method comprises the following steps of cleaning historical sales data according to preset cleaning rules to obtain target sales data, wherein the method comprises the following steps:
merging the historical sales data in different historical periods according to a preset data analysis library code to obtain first merged information;
based on the first combination information, carrying out first combination processing on the commodity sales data and the loading information data to obtain first combination data;
performing first cleaning processing on the first combined data according to the cleaning rule to obtain first cleaning data;
performing second combination processing on the first cleaning data and the commodity attribute data to obtain second combination data;
and carrying out second cleaning treatment on the second combined data according to the cleaning rule to obtain the target sales data.
4. The sales forecasting method based on the fusion model as claimed in claim 3, wherein the inputting the first training data into a preset initial time series forecasting model for first training and outputting a first forecasting result comprises:
setting holiday node data influencing sales volume and influence factor data corresponding to the holiday node data;
combining the influence factor data and the parameter value data of the initial time series prediction model into parameter space combination data;
combining the parameter space combination data and the first training data to obtain first parameter data;
and inputting the first parameter data into the initial time series prediction model for the first training, and outputting the first prediction result.
5. The fusion model-based sales prediction method of claim 4, wherein determining a first target parameter according to the first prediction result and the first test data, and determining a target time series prediction model according to the first target parameter comprises:
defining a preset evaluation function as a prediction evaluation index, wherein the evaluation function at least comprises one of the following: a mean square error function and a root mean square error function;
inputting the first prediction result and the first test data into the mean square error function and the root mean square error function respectively to obtain a corresponding first mean square error function value and a corresponding first root mean square error function value respectively;
and determining the first target parameter according to the first mean square error function value and the first mean square error function value, wherein the first target parameter is used for determining the target time series prediction model.
6. The fusion model-based sales prediction method of claim 5, wherein the inputting the second training data into a preset initial long-short term memory network for second training and outputting a second prediction result comprises:
combining the parameter space combination data and the second training data to obtain second parameter data;
and inputting the second parameter data into the initial long-short term memory network for second training, and outputting a second prediction result.
7. The fusion model-based sales prediction method according to any one of claims 1 to 6, wherein the determining a target predicted sales result according to the fusion model function comprises:
determining a target parameter group for obtaining the target function value according to the target function value of the fusion model function and the historical sales value corresponding to the same period;
and inputting the target parameter group into the fusion model function for calculation processing to obtain the target prediction sale result.
8. A sales prediction system based on a fusion model, comprising:
the acquisition module is used for acquiring historical sales data in a preset period;
the preprocessing module is used for preprocessing the historical sales data to generate target training data and target test data, wherein the target training data at least comprises one of the following data: the target test data comprises at least one of the following: first test data and second test data;
the first training module is used for inputting the first training data into a preset initial time sequence prediction model for first training and outputting a first prediction result;
the first determining module is used for determining a first target parameter according to the first prediction result and the first test data, and determining a target time series prediction model according to the first target parameter;
the second training module is used for inputting the second training data into a preset initial long-short term memory network for second training and outputting a second prediction result;
the second determining module is used for determining a second target parameter according to the second prediction result and the second test data, and determining a target long-term and short-term memory network according to the second target parameter;
and the prediction module is used for constructing a fusion model function according to the first target parameter and the second target parameter and determining a target prediction sale result according to the fusion model function.
9. Sales prediction apparatus based on a fusion model, characterized by comprising:
at least one memory;
at least one processor;
at least one program;
the programs are stored in a memory, and a processor executes the at least one program to implement:
the fusion model-based sales prediction method of any of claims 1 to 7.
10. A storage medium having stored thereon executable instructions executable by a computer to cause the computer to perform:
the fusion model-based sales prediction method of any of claims 1 to 7.
CN202210049250.9A 2022-01-17 2022-01-17 Sales prediction method, system, device and storage medium based on fusion model Pending CN114549046A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210049250.9A CN114549046A (en) 2022-01-17 2022-01-17 Sales prediction method, system, device and storage medium based on fusion model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210049250.9A CN114549046A (en) 2022-01-17 2022-01-17 Sales prediction method, system, device and storage medium based on fusion model

Publications (1)

Publication Number Publication Date
CN114549046A true CN114549046A (en) 2022-05-27

Family

ID=81672191

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210049250.9A Pending CN114549046A (en) 2022-01-17 2022-01-17 Sales prediction method, system, device and storage medium based on fusion model

Country Status (1)

Country Link
CN (1) CN114549046A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115423369A (en) * 2022-10-10 2022-12-02 广东便捷神科技股份有限公司 Article management system and method based on block chain
CN115439206A (en) * 2022-11-08 2022-12-06 税友信息技术有限公司 Declaration data prediction method, device, equipment and medium
CN116151861A (en) * 2023-04-21 2023-05-23 杭州比智科技有限公司 Sales volume prediction model constructed based on intermittent time sequence samples and construction method
CN116245563A (en) * 2023-05-11 2023-06-09 中国石油大学(华东) Commodity sales fusion prediction model constructed based on AdaBoost algorithm
CN116777507A (en) * 2023-06-23 2023-09-19 青岛中沃兴牧食品科技有限公司 Method for predicting sales of various pork in pork monopoly website based on LSTM model
CN117076861A (en) * 2023-08-18 2023-11-17 深圳市深国际湾区投资发展有限公司 Data fusion-based related data processing system, method and medium
CN117370330A (en) * 2023-12-07 2024-01-09 浙江有数数智科技有限公司 Prophet-SVM model-based data monitoring and early warning method of big data acquisition system
CN117994009A (en) * 2024-04-07 2024-05-07 快充网科技深圳有限公司 Digital product removes and fills a supplement system of selecting
CN118134023A (en) * 2024-02-06 2024-06-04 水电水利规划设计总院有限公司 Wind-solar output quantitative prediction method and prediction device for electric power system
CN118154237A (en) * 2024-03-15 2024-06-07 广州探域科技有限公司 Sales prediction method, system, equipment and medium based on TCN architecture

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115423369A (en) * 2022-10-10 2022-12-02 广东便捷神科技股份有限公司 Article management system and method based on block chain
CN115423369B (en) * 2022-10-10 2024-08-13 广东便捷神科技股份有限公司 Article management system and method based on blockchain
CN115439206A (en) * 2022-11-08 2022-12-06 税友信息技术有限公司 Declaration data prediction method, device, equipment and medium
CN116151861A (en) * 2023-04-21 2023-05-23 杭州比智科技有限公司 Sales volume prediction model constructed based on intermittent time sequence samples and construction method
CN116245563A (en) * 2023-05-11 2023-06-09 中国石油大学(华东) Commodity sales fusion prediction model constructed based on AdaBoost algorithm
CN116245563B (en) * 2023-05-11 2023-10-27 中国石油大学(华东) Commodity sales fusion prediction model constructed based on AdaBoost algorithm
CN116777507B (en) * 2023-06-23 2024-05-28 青岛中沃兴牧食品科技有限公司 Method for predicting sales of various pork in pork monopoly website based on LSTM model
CN116777507A (en) * 2023-06-23 2023-09-19 青岛中沃兴牧食品科技有限公司 Method for predicting sales of various pork in pork monopoly website based on LSTM model
CN117076861A (en) * 2023-08-18 2023-11-17 深圳市深国际湾区投资发展有限公司 Data fusion-based related data processing system, method and medium
CN117370330A (en) * 2023-12-07 2024-01-09 浙江有数数智科技有限公司 Prophet-SVM model-based data monitoring and early warning method of big data acquisition system
CN118134023A (en) * 2024-02-06 2024-06-04 水电水利规划设计总院有限公司 Wind-solar output quantitative prediction method and prediction device for electric power system
CN118134023B (en) * 2024-02-06 2024-09-03 水电水利规划设计总院有限公司 Wind-solar output quantitative prediction method and prediction device for electric power system
CN118154237A (en) * 2024-03-15 2024-06-07 广州探域科技有限公司 Sales prediction method, system, equipment and medium based on TCN architecture
CN117994009A (en) * 2024-04-07 2024-05-07 快充网科技深圳有限公司 Digital product removes and fills a supplement system of selecting
CN117994009B (en) * 2024-04-07 2024-06-28 快充网科技深圳有限公司 Digital product removes and fills a supplement system of selecting

Similar Documents

Publication Publication Date Title
CN114549046A (en) Sales prediction method, system, device and storage medium based on fusion model
CN111563706A (en) Multivariable logistics freight volume prediction method based on LSTM network
WO2019001120A1 (en) Method and system for processing dynamic pricing data of commodity
CN113553540A (en) Commodity sales prediction method
US20150221040A1 (en) Residual risk analysis system, method and computer program product therefor
CN111127142A (en) Article recommendation method based on generalized neural attention
CN111695719A (en) User value prediction method and system
CN111582538A (en) Community value prediction method and system based on graph neural network
CN109767032A (en) A kind of business finance operation digital management optimization system based on data analysis
CN114219169A (en) Script banner supply chain sales and inventory prediction algorithm model and application system
CN113761388B (en) Recommendation method and device, electronic equipment and storage medium
CN116188061B (en) Commodity sales predicting method and device, electronic equipment and storage medium
CN112613953A (en) Commodity selection method, system and computer readable storage medium
CN113158024A (en) Causal reasoning method for correcting popularity deviation of recommendation system
CN118365431B (en) Big data-based commodity recommendation method and system for electronic commerce platform
Zhang Prediction of Purchase Volume of Cross‐Border e‐Commerce Platform Based on BP Neural Network
CN117196695B (en) Target product sales data prediction method and device
CN115841345B (en) Cross-border big data intelligent analysis method, system and storage medium
CN116167646A (en) Evaluation method, device, equipment and storage medium based on transaction algorithm
CN115393098A (en) Financing product information recommendation method and device
CN115187312A (en) Customer loss prediction method and system based on deep learning
US11004156B2 (en) Method and system for predicting and indexing probability of financial stress
CN113762415A (en) Neural network-based intelligent matching method and system for automobile financial products
Sarvi Predicting product sales in retail store chain
Yu et al. Car trading cycle prediction based on random forest algorithm

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication