## 3 Materials and Methods
Logistic regression tries to find the optimal decision boundary that best separates the classes. Logistic regression is not good when the training data size is small relative to the number of features. Logistic regression is able to handle categorical and continuous input variables. A key difference from linear regression is that the output value is a binary value (0 or 1) rather than a numeric value. The reader might refer to the study by [PERSON] and [PERSON] [33] for more information about logistics regression. The forecasting process in this paper is dynamic. This means that the forecasting process is completed every week. The accuracy of the forecasted results is measured using the real available data in the next week. The accuracy from one week to another can be different. Logistic regression is a probabilistic classifier that makes use of supervised machine learning, so it trains the model by providing it with pairs of input-output examples from which it can learn. Training a logistic regression model means learning a mapping between the input variables and the expected output. Training the logistic regression model and using it for predictions is very simple, fast, and needs low computational requirements. Figure 1: Methodology of the study. A certain order achieves the satisfied order value (\(SO_{i}\)) of 1 if it is satisfied in the next week and 0 otherwise:  
\[SO_{i}=\left\{ \begin{array}{rl}1,&if\;\;\textit{the order $i$ is satisfied in the next week}\\ 0,&\textit{otherwise}\end{array} \right.\]  
Percent of satisfied demand in the delivery week \(d\) (\(PSD_{d}\)) can be found using the following equation:  
\[PSD_{d}=\frac{\sum_{i=1}^{\text{DNW}_{d}}SO_{i}}{DNW_{d}}\times 100\% \tag{1}\]  
The next equation shows the moving average method to find \(SDNW_{d}\) in step 4 when \(n=3\):  
\[SDNW_{d}=PSD_{d}\times DNW_{d}=\frac{(PSD_{d-1}+PSD_{d-2}+PSD_{d-3})}{3} \times DNW_{d} \tag{2}\]  
where \(d\) is the index for delivery week. The last type of forecasting depends mainly on two variables:  
1. Index for locating the order among the other orders (\(ILO\)). It is an indication of the position of a certain order compared to other orders and the expected number of satisfied orders in the next week. This index is found from the following equation: \[ILO_{i}=\frac{(SDNW_{d}-i)}{SDNW_{d}}\] (3) where \(i\) is the order position, and it means the row number when data are arranged from the oldest to the newest orders. \(ILO_{i}\) starts with a value that is very close to 1 for the oldest not satisfied order and then starts to decrease until it is 0 for the order, which has a position equal to \(SDNW_{d}\), and after that, recent orders have negative \(ILO_{i}\) values. 2. The order preparation time so far for order \(i\) (\(OPTSF_{i}\)), which is the difference between the current delivery date (\(CDD_{i}\)) and the order date (\(OD_{i}\)). So, the equation will be as follows: \[OPTSF_{i}=CDD_{i}-OD_{i}\] (4)  
The previous two measures are updated every delivery, where the new available data is added to the original data. Forecasting will depend mainly on these two values plus the \(SDNW_{d}\) value found in Equation (2). The expected satisfied order (\(ESO_{i}\)) is written in the same way as \(SO_{i}\), and it is found using the logistic regression model. This can be written as follows:  
\[ESO_{i}=\left\{ \begin{array}{rl}1,&if\;\textit{the order is expected to be satisfied in the next week}\\ 0,&\textit{otherwise}\end{array} \right.\]  
The variable \(A_{i}\) is used to check if the expected and real values are the same:  
\[A_{i}=\left\{ \begin{array}{rl}1,&if\;SO_{i}=ESO_{i}\\ 0,&\textit{otherwise}\end{array}