# A Sensor Data-Driven Decision Support System for Liquefied Petroleum Gas Suppliers
## 7 Case Study
### Short-Term Prediction Example  
The exemplary short-term prediction presented below was performed on 19 tanks. A data set spanning between 849 and 1274 days of measurements was collected for each tank. The values recorded for the tank consisted of a gas level measured daily and an outside temperature collected hourly from a weather server. Daily LPG consumption was calculated on the basis of the gas level in a tank. The task was to predict gas consumption for each tank in a seven day horizon. Gas consumption in this task was calculated in cubic meters. Prediction was performed for each day separately, which required the creation of separate models predicting gas consumption on Days 1, 2,..., 7. Additionally, an assumption was made that a model should be applied as quickly as possible, and it can be re-trained after a selected period of time. In order to create a prediction model, the data sets collected from different tanks were analyzed, and two groups of customers were identified. The first group, which can be named temperature dependent, can be represented by the customer whose consumption is characterized in Figure 6a, while the second group, which can be named temperature independent, can be represented by the customer whose consumption is characterized in Figure 6b. The characteristics of both types of customers using the Pearson correlation and determination coefficients are presented in Table 2. Due to the clear difference between customers, the use of a temperature-only model (like the linear regression or regression  
Figure 8: An exemplary fragment of the operator’s application window containing decisions about sending a tanker to the customer. tree mentioned in the previous section) is not recommended. Therefore, the more general approach was introduced and based on one of the leading models, which was the gradient boosting model, and its implementation is included in the gradient boosting machines (gbm) R package [40; 41]. The size of the generated gradient boosting model was limited to 100 decision trees. The other parameters of the method were set to default values. The model required training data of at least 50 days of measurements and was re-trained each month. Therefore, if the first two months failed to provide enough data to generate the first model, then it was generated only after three months. Moreover, this approach meant that every month, a new, re-trained model was applied and evaluated on another portion of data. In order to make the model general and applicable regardless of the temperature-based customer type, the following attributes describing each day and combining the information on both the outside temperature and the consumption in recent days were derived:  
* mean temperature value within a day,
* median temperature value within a day,
* range of temperature values within a day,
* maximal temperature value within a day,
* minimal temperature value within a day,
* change in the temperature maximal, minimal, and mean value between the current day and one to ten days back,
* mean gas consumption within 3, 5, and 7 recent days,
* change in gas consumption within 3 and 5 days and 3 and 7 days,
* change in gas consumption between the current day and one to ten days back. Due to the fact that the created model used outside temperature to derive several attributes, it is referred to as temperature based. Other approaches used in the experiments can be treated as baseline solutions that are typically available for the LPG suppliers and support the daily management of gas supplies to customers. These methods provide the reference level for the temperature-based approach. Therefore, comparing them with the predictive model would allow justifying the suitability of using solutions based on machine learning. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Tank** & **Temperature Dependency** & **PCC** & **R\({}^{2}\)** \\ \hline  
\hline \hline \end{tabular}
\end{table}