Makine öğrenmesi yardımıyla zincir restoran gıda  satışlarının tahmin edilmesi ve hava durumunun etkisinin incelenmesi
Forecasting food sales on chain restaurant and investigating weather effect on sales by using machine learning methods
Yazar: SEZGİ ŞENER
Danışman: DOÇ. DR. BAŞAR ÖZTAYŞİ
İstanbul Teknik Üniversitesi / Fen Bilimleri Enstitüsü / Endüstri Mühendisliği Ana Bilim Dalı / Mühendislik Yönetimi Bilim Dalı
Derece: Yüksek Lisans, 2019
Konu: Endüstri ve Endüstri Mühendisliği = Industrial and Industrial Engineering

Özet:
Tüm işletmelerin gelecekteki sektörel konumlarını koruyabilmek ve geliştirmek için bir plan çerçevesinde uygun çözümler üretmeleri gerekir. Geleceğe dair plan yapmak için de gelecekteki olayları öngörebilmeleri gerekir. Bunun için de çeşitli veri ve teknikler kullanarak hem planlama yapar hem de olası problemlere karşı önceden önlem alınabilir. Bu amaçlarla kullanılan yöntemlerden bir tanesi de talep tahminidir. 
Bu çalısmada; gıda sektöründe Zaman Serisi analiz yöntemleri, Lineer Regresyon, Derin Öğrenme yöntemleriyle tahmin modelleri kurulup bu modeller yardımıyla Türkiyenin önde gelen simit mağazası zincirlerinden birinin simitsatışlarıyla hava durumunun ilişkisi incelenmiştir. Ayrıca modeller yardımıyla satış tahminleri yapılmıştır.
Çalışmada 2014 yılı Eylül ayından 2016 Haziran ayı arasında şube başı simit satışlarından, il içi sıcaklık, nem, basınç, yağış gibi hava durumu göstergelerinden ve Dolar/TL paritesinden, tatil günleri, ramazan gibi kategorik değişkenlerden yararlanılmıştır.  Belirtilen makine öğrenmesi yöntemleri önce tek değişkenli sonrasında çok değişkenli olarak uygulanmış ve hata testleri yapılmıştır. Oluşturulan modellerin tahmin tutarlılığı ve genellenebilirliği incelenmiştir. Çalışma 6 bölümden oluşmaktadır. Birinci ve ikinci bölümde; zincir mağazaların sektörel bilgisi ve talep tahmini ile ilgili bilgiler verilmiştir. Üçüncü bölümdeliteratürde yapılan çalışmalar incelenmiştir. Dördüncü bölümde makine öğrenmesi metotlarının en yaygın kullanılanları kısaca anlatılmış ve çağdaş metotlardan zaman serisi yöntemleri ve derin sinir ağları ayrıntılı olarak anlatılmıştır. Beşinci bölümde; öncelikle tek değişkenli tahmin yöntemiyle tek adım ve çok adımlı tahmin yapılmış ve yöntemler karşılaştırılmıştır. Sonrasında çok değişkenli yöntemle belirtilen hava durumu, önemli günler, mevsimsel değişkenler, lokasyon bilgileri kullanılarak lineer yöntemlerle önce değişkenlerin etkileri incelenmiş sonra da otoregresif modeller ve derin öğrenme modellerin tahmin tutarlılıkları karşılaştırılmıştır. Bunların yanı sıra modellerin nasıl eğitildiği, nasıl test edildiği ve tahmin süreci hakkında detaylı bilgiler sunulmuştur. Altıncı bölümde ise çıkan sonuçlar yorumlanmış, sonraki araştırmalar için öneriler sunulmuştur.

Abstract:
All businesses in need of decision-making must anticipate future events in order to maintain and improve their current status in the future and produce appropriate solutions within a good plan. The objective of prediction is to anticipate the future situations that may be encountered by businesses and to take precautions by using various data and techniques. This purpose is also envisaged in demand forecasting.
Sales forecasting is an important part of stock planning for wholesale and retail trade. It is a complex task because of the many factors affecting demand. The complexity of business dynamics often forces decision-makers to make decisions based on subjective mental models that reflect their experience. However, research shows that companies achieve better performance when applying data-based decision-making methods. In fact, companies in the top three of their sectors use data-based decision-making to become 5% more efficient and 6% more profitable than their competitors (Bohanec, Robnik-Šikonja 2017), (Wong, W. K., & Guo, Z. X., 2010). This encourages the business community to use data-driven decision models that enable more comprehensive and intelligent decision-making.
Timely and accurate sales forecasting in the food industry plays a key role in the profitability of operations. Retail food stocks consist of a wide range of perishable foods with short shelf life and different storage conditions, which complicates food sales forecasting. (Doganis et al., 2006).
Analyzing sales data in stores helps improve store management, product management, and supply chain management, thereby reducing restaurant operating costs and improving food quality. At the institutional level, the creation of relevant information in restaurants greatly simplifies the strategic planning of companies. Thus, corporate governance can evaluate the impact of promotional activities on sales and brand recognition, evaluate business trends, analyze price elasticity, and measure brand loyalty. Therefore, accurate and timely sales forecasts enable us to conduct studies from many different perspectives and are critical in this respect (Lasek and Saunders, 2016).
Historically, restaurant managers use either recent history data or simple logical methods to estimate customer numbers or sales volume. These techniques consist of an intuitive prediction, often based on the experience of the manager. However, restaurant sales forecasts, time, weather conditions, economic factors, random cases and so on. It is a complex task because it is influenced by many factors that can be classified as. In this case, old techniques may give incorrect results. (Lasek and Saunders, 2016)
The aim of this study is to compare the estimation of simit sales, which is one of the most consumed daily snacks in Turkey, the accuracy of the learning methods and determine the model that provides the highest accuracy and the factors affecting the buying behavior of one of the leading simit chain stores in Turkey in the food sector by using Time Series Analysis methods,.
Between January 2014 and July 2016, the study benefited from the sales of simit per branch, weather conditions such as temperature, humidity, pressure, precipitation and district population values in the province. It is observed that reliablity and consistency of the model predictions by the post-implementation error tests. The study consists of six main parts. In the first and second chapter, sectoral information and demand forecasting of chain stores are given.
Demand forecasting plays an important role in the activities of each organization in which customer or consumer demand exists, particularly in the services, manufacturing, and sectors as part of the actual supply chain. Demand forecasting; is the process of calculating the future demand for a product or service with an acceptable margin of error.
In the literature, there is a wide range of demand forecasting studies conducted in different sectors on a general and store basis. (Donkor et al., 2012), (Witt, 1995), (Suganthive Samuel, 2012), (Fildes and Kumar, 2002), (Nenni and Pirolo, 2013)
Analyzing store sales data helps improve store-based operations management, product management, supply chain management, and thus reduces restaurant operating costs; improves the quality of service and foods. At the corporate level, extracting relevant information in restaurants greatly simplifies the company's strategic planning. Thus, corporate governance can evaluate the impact of promotional activities on sales and brand recognition and business trends. Price elasticity analysis. It also measures brand loyalty. For this reason, accurate and timely sales forecasts enable us to carry out studies from many different perspectives and are critical in this respect. (Lasek, Cercone and Saunders, 2016)
The methods used in the literature for Demand Forecasting can be grouped under three main headings. The first is time series methods  and the second is deep learning methods and other machine learning methods. Time series methods generally focus on modeling patterns within a single data set. They are mostly used in the prediction of linear models. Machine learning methods estimate demand data using supervised and unsupervised learning methods of different factors. They can predict both linear and nonlinear relationships. Deep learning learning methods can be predicted by simple neural network logic for both time series and multivariate models. The results of time series methods can be interpreted more easily. Machine learning and deep learning methods are also called black box models because they are difficult to interpret. (Bohanec et al., 2017)
In literature studies on sales and demand estimation, many factors affecting customer demand are examined. These factors have been classified as internal and external factors in some studies. (Obliobaitė et al. 2012), (Ramanathan and Muyldermans, 2010). Accordingly, the variables used in the literature can be grouped as internal and external factors. Weather effects as external factors (humidity, precipitation, snowfall, storm), Holidays, Great events, Macroeconomic effects, Competition, Social media data; internal effects are classified according to the main headings such as calendar effect (days of the week, days of the month, months of the year, weeks of the year), historical data (lag), product characteristics, promotion, store characteristics.
In the third chapter, previous studies about sales forecasting and forcasting methods are described. In the fourth chapter, machine learning, time series methods and deep neural networks methods are explained in detail from contemporary methods. In the fifth chapter; one-step and multi-step estimations were made and the methods were compared with the one-variable estimation method. Afterwards, the effects of variables were examined by linear methods using the weather conditions, important days, seasonal variables, location information and then the predictive consistency of the autoregressive models and deep learning models. In the sixth chapter, the results are interpreted and proposals for future research are presented. 
When determining the data set, firstly the needs of the company were taken into consideration. The company wants sales and orders to be estimated. We have order data from the wholesale center. Store order data is available, but store sales data is not available. When analyzed, stores can calculate their daily orders based on the daily increased products because they buy frozen food. Therefore, the variability in daily orders does not clearly reflect sales expectations. It is considered appropriate to use weekly sales values in order to make less difference in daily orders and sales numbers. As a result, the total number of orders per week was taken as a reference and it was decided to make a weekly estimate.
Both univariate and multivariate analyzes will be performed to compare the performance of the methods according to different needs. First, time series methods will be applied to a univariate data set. Secondly, a multi-parameter time series estimate will be made. In addition, the effect of other variables/factırs on the estimation variable will be examined.
For the multivariate model, the factors affecting demand in the light of literature studies and ideas received from store authorities were classified as in the table below.
These are grouped under four main headings:
• Important days; National Holidays, School Holiday, Ramadan
• Macro Variables; USD / TRY,
• Seasonal Variables; Week, Month, Year
• Store Traffic; Province
In brief, results show, classical methods can give good results in time series. However, although the LSTM method has been proposed in time series, one-dimensional CNN has also shown good results. In addition, hybrid deep neural network models proved to be effective in multi-step estimation. In the one-step estimation, it was observed that the CNN method was as good as the LSTM method.
In multiple linear analysis, firstly correlation and linear model analysis were used to investigate the effect of variables on sales values. Temperature values do not show the same effect in all provinces. Istanbul has the highest correlation with temperature values and sales figures with -0.6. In the linear model analysis, a descriptive model was created by using the temperature, sunshine time, humidity, snowfall, dollar parity and the sales value 4 weeks ago.
The month of Ramadan , temperature  and sales value 4 weeks ago statistically significant p <0.001, snowfall representing extreme weather conditions was statistically significant p <0.05. After multiple linear analysis, sales estimation was made with multivariate models. According to these estimates, the best result was MLR with 39 RMSE values.
In future studies, if store traffic and store sales information is available, these variables can be envisaged to form richer and explanatory models. The presence of store sales data could have been possible to determine the effect of temperature on store traffic and human behavior. In addition, the effect of promotions on sales could be measured with promotional information. In subsequent studies, the effect of air temperature on other products or, if sufficient data are available, can be examined in terms of the human choice of intake.