The original link:tecdat.cn/?p=1130
Original source:Tuo End number according to the tribe public number
Now in the era of DT (data technology), data is becoming more and more important, and its core application “prediction” has become an important force in the Internet industry and industrial transformation. For the retail industry, forecasting is almost the ultimate problem of business intelligence (BI) research. From a pure machine learning perspective, it is easy to make accurate forecasting, but it is difficult to improve the profits of the business. Predictive accuracy is a key pain point.
Video: machine learning boosts accurate sales forecasting part1
Business challenges
Tie right, divide product roughly into: basic and fashion. For the basic style, there is no big change every year, the impact of international popularity is not big, so you can carry out a long plan of production. For fashion, the decision-making power to determine the trend is not in a certain region, and buyers in one region are not mature enough to accurately predict the international fashion trend. Therefore, it is necessary to make predictions based on various factors in different regions. Accordingly, in the composition of new goods, the sales forecast strategy is: basic models are planned to be produced, and fashion models are adjusted accordingly.
The solution
Mission/Objective
According to the marketing requirements of clothing retail business, a variety of data source analysis is used to achieve accurate sales forecasting.
Data Source Preparation
Sand in, sand out, gold in, gold out. No data or low data quality will affect the prediction effect of the model. Before establishing a reasonable model, data should be collected to collect additional information (such as weather, location, holiday information, etc.) in addition to existing sales data, and then preprocessed on the basis of collected data.
You have the data, but there are some features that the algorithm can’t deal with directly, and there’s some data that the algorithm can’t take advantage of directly.
Characteristics of the transformation
Transform the features that cannot be processed into clean features that can be easily processed by the algorithm as follows:
Date of sale. As far as the time attribute itself is concerned, it has no significance for the model. The date needs to be converted into year, month, day and week pseudo-variables.
Product features. From the product information sheet, you can get the style, color, texture and whether this product is limited edition. But there are no such variables. This requires us to extract the above features of the product from the product name.
These are only partial features.
structure
The above explains how to extract relevant features. We have roughly the following training samples (only some features are listed).
Divide training set and test set
Considering that the final model will predict the sales in a certain period of time in the future, the training set and test set are divided by time in order to achieve a more realistic test model effect. The specific approach is as follows: Assume that we have sales data from February 1, 2014 to June 17, 2017. Sales data from February 1, 2014 to March 19, 2016 were used as training, and data from March 20, 2016 to June 17, 2017 were used as testing.
modeling
ARIMA is generally used in the areas of stock and e-commerce sales
ARIMA model is to transform non-stationary time series into stationary time series, and then perform autoregression (AR) and self-translation (MA) on the result variables.
Random forests
To establish a forest in a random way, the forest is composed of many decision trees, and there is no correlation between each decision tree of the random forest. After the forest is obtained, when a new input sample enters, each decision tree in the forest is asked to make a judgment respectively to see which category this sample should belong to (for the classification algorithm), and then see which category is selected the most, and predict this sample to be that category.
Support vector regression (SVR)
SVR is essentially similar to SVM, with a margin, but the margin of SVM separates the two types, while the margin of SVR refers to whether the data in it will be helpful for regression.
Model optimization
1. Optimization before going online: feature extraction, sample sampling and parameter adjustment.
2. In the post-launch iterations, improve the model based on actual A/B testing and suggestions from business people
As can be seen from the figure above, in this case, the prediction error of support vector machine and random forest algorithm model is the minimum. Three methods are used to predict the sales volume of a commodity, and the visualized graph is as follows:
It can be seen that the trend of predicted sales has been basically consistent with the real sales trend, but in the longer forecast period, there is a big difference between the predicted values.
The evaluation effect should not only be based on sales volume, but also should be considered comprehensively by referring to such factors as business docking, prediction accuracy, model interpretability and overall ability of industrial chain. Our experience is that the forecast results are only used as a reference weight value, and expert opinions are required to calculate according to a certain weight.
Looking forward to
In addition to some of the methods listed above, we are already trying more complex sales prediction models, such as HMM, deep learning (Long Short-Term Memory network, convolutional neural network (CNN)), etc. At the same time, the interpretability, practicability and expansibility of the model should be considered to avoid “black box” prediction. We are also trying to adopt hybrid machine learning models, such as GLM + SVR, ARIMA + NNET, etc.
Sales forecasting is almost the ultimate problem in business intelligence research. Even if the prediction accuracy of the test set can be improved through the machine learning algorithm model, for the prediction of the future data set, the enterprise itself needs to be considered in addition to the machine learning model in order to achieve accurate prediction and maximize the profits of the enterprise. For example, how to add enterprise factors into machine learning model is a difficulty and direction of future pre-sales forecasting, such as the overall supply chain capability of an enterprise. So there is still some way to go before we can solve the ultimate problem of sales forecasting.
Related articles:
Time series (ARIMA, exponential smoothing) analysis is performed using R language
Use LSTM and PyTorch in PythonThe time seriesTo predict
R k – Shape languageThe time seriesClustering method for stock pricesThe time seriesclustering
The generalized additive model GAM is usedThe time seriesAnalysis of the
R languageThe time seriesAnd ARIMA models predict tractor sales in manufacturing cases
GAM (generalized additive model) is used for power load time in R language
R language from economyThe time seriesUsing HP filters, wavelet filters and experience..
COPULA and financeThe time seriescase
Time series prediction with Prophet in Python
R language estimates time-varying VAR modelsThe time seriesThe empirical study analyzes the case
Python uses the long and short term memory model LSTMThe time seriesForecast analysis
Jenkins), SARIMA and ARIMAX models were used for predictionThe time seriesdata
K- Medoids clustering modeling for power load time series data using R language.
Time series prediction of R language multivariate Copula GARCH model