Content uploaded by Ahmet Selman Bozkir
Author content
All content in this area was uploaded by Ahmet Selman Bozkir on Oct 05, 2015
Content may be subject to copyright.
ADEM: An Online Decision Tree Based Menu Demand Prediction
Tool for Food Courts
Ahmet Selman Bozkir , Ebru Akcapinar Sezer
Hacettepe University Computer Engineering Department, Ankara Turkey
Abstract. The uncertainty of consumption demand in institutional food courts can cause loses of resources,
work power and prestige. In this study, to overcome this problem, decision tree, a predictive data mining
method was utilized. Thus, decision tree models sourced from an original 44 monthly dataset were generated
and a tool named ADEM was designed and developed to make online prediction against the best model. To
determine the best model, 10 fold cross validation technique was applied. As a result, decision tree models
reaching up 80.78 accuracy levels (VAF value) were obtained and a user friendly, platform independent and
reusable decision tree based decision support tool is presented for managers and nutritionists.
Keywords: Decision trees, food demand prediction, data mining, demand prediction.
1. Introduction
The definition of “catering” is defined as the act of supplying food and related services in means of
preparing, providing, delivering and serving; or preparing [1]. Several catering factories and institutions
serve menus to customers which vary in each day. As the demand for the food is certain in many cases, in
some institutions like universities, hospitals, etc. the demand for the menus may vary for different kinds of
reasons. Therefore, this process has uncertainties in economics point of view. As stated in [1], if the actual
demand cannot be foreseen correctly this either causes prestige loss (if demand is much than supply) or
waste of resources and work power (if demand is less than supply). At this point, demand forecasting
concept arises. As stated in [2] demand forecasting helps companies in several apparent areas, such as
production, scheduling and customer service. Furthermore, Mike Hennel in [2] states that, being able to
rebalance or reclassify inventory as a result of improved forecast accuracy can produce significant
improvements in customer service without an increase in overall inventory value. Moreover as Bozkir and
Akcapinar Sezer point out, approaches which forecast the demand for a served menu can present many
benefits to institutions as it would optimize the balance of supply and demand in name of saving resources
and work power [1]. At this point, Sundararajan et al. address the importance of information technology and
services, computer aided tools providing intelligence to make real time decisions [3]. With this motivation,
Sundararajan et al. implemented a decision support system for making operational decisions in food
processing industry which is based on optimization techniques and focuses on determining optimum
production scenario for every week based on the tradeoffs between service levels, inventories, costs and
capacity [3]. As another example, [4] investigated the factors affecting menu demand in universities by
employing decision tree method which is a member of predictive data mining methods family. Moreover, in
[1] three decision tree methods, CHAID (Chi-squared Automated Interaction Detection), CART [5]
(Classification and Regression Trees) and Microsoft Decision Trees [6] are employed to predict menu based
food consumption demand in food courts and their performances are compared.
Demand prediction and employment of intelligence methodologies such as data mining or soft
computing is not a new type of research in demand prediction. If literature is reviewed, several studies
addressing different aspects of demand prediction can be found. For instance, Altunkaynak et al. [7]
employed Tagaki-Sugeno fuzzy logic method aiming prediction of future monthly water consumption
Corresponding author. Tel.: + +90 312 2977500
E-mail address: selman@cs.hacettepe.edu.tr
2013 4th International Conference on Food Engineering and Biotechnology
IPCBEE vol.50 (2013) © (2013) IACSIT Press, Singapore
DOI: 10.7763/IPCBEE. 2013. V50. 3
10
demand for Istanbul. Similarly, Abiyev et al. [1]-[8] investigated the feasibility of neural network based
fuzzy inference systems for electricity consumption prediction by presenting a system for Northern Cyprus.
However if demand prediction literature is reviewed in food and nutrition point of view, a limited
number of the studies can be found according to our best knowledge. For instance, Bhattarcharyya et al. [9]
utilized time series method to forecast daily demand of perishable ingredient for a worldwide fast-food
restaurant by presenting how Box-Jenkins seasonal ARIMA time series models can be used to reveal outliers
in demand [1]. Besides, as stated before Bozkir and Akcapinar Sezer in [1]-[4] investigated the feasibility of
decision tree method in food consumption prediction and achieved successful prediction results. However as
pointed out in [4], the quality and richness of training data becomes very important in this kind of studies.
Data mining, on the other hand, is described as the utilization of intelligent algorithms and methods to
extract hidden relationships, trends, correlations and associations in historical data. Although it involves
several methods such as genetic algorithms, Bayesian networks, decision trees, support vector machine; data
mining techniques are classified into two categories: predictive data mining and descriptive data mining. As
the main aim of descriptive data mining is to reveal hidden nature of data, predicting future cases based on
past examples constitutes the fundamental purpose of predictive mining [1].
In this study, a web based data mining oriented menu prediction tool named as “ADEM” is designed and
implemented. Furthermore, it is equipped and tested with a 44 months period dataset containing records of
food courts in Hacettepe University of Turkey. During the model building step, decision tree method is
employed. As the previous studies [1]and[4] point out, decision tree method is a good candidate for some
reasons:(1) ease of understanding and interpreting, (2) model transparency, (3) rapid model building, (4) on
the fly prediction and as the last one (5) reasonable prediction accuracy. Therefore, Microsoft Decision Trees
[6] algorithm and related framework is employed throughout the study. By this study, it is aimed to present a
decision support tool for food court managers and also nutritionists to forecast future menu demands and
enable them to form daily, weekly or monthly plans by considering the predictions. One another advantage
of proposed system is to not only predicting previously served menus also new combinations and unseen
menu items.
2. Data and Methodology
In this study, to constitute data mining models for prediction, a dataset which contains Hacettepe
University food court daily menu sales covering 44 months is employed. The dataset which covers daily
sales records for students, academics and officers starts from 1.1.2008 and ends at 21.8.2011. The dataset
contains discrete, boolean and continuous valued attributes. The discrete valued attributes listed as follows:
food1, food2, food3, food4 (these are the names of foods presented in the menu). On the other hand; day,
month, calorie, sales count of academics, students and officers constitute the continuous valued attributes.
Besides, by applying a pre-processing on menu items, two extra binary (yes/no) features named
containsDessert and containsMeat were extracted. With the help of these attributes, it was tried to be
revealed whether or not vegetarian menus have any effect on menu sales as well as dessert contained ones.
With a prior investigation, isHolidayDay binary feature was also extracted by checking each day on calendar
to be used as a powerful feature.
Microsoft Decision Tree (MSDT) algorithm which is shipped with Microsoft SQL Server Analysis
Services [10] was employed throughout the study. MSDT is designed for classification and regression tasks
and mainly employs Shannon’s entropy as tree splitting criteria. Tree splitting and growing concept is the
main point affecting generalization capacity of decision trees, thus it must be set precisely. In contrast to
other some well known algorithms such as CART, MSDT does not offer any pruning step in tree induction
stage. Nevertheless, it presents a parameter named “complexity_penalty” for controlling the growth of tree.
MSDT also presents automatic feature selection, automatic binning and cardinality reduction features which
makes it preferable than the other decision trees algorithms. However, the main reasons why we chose
MSDT can be listed as (1) API (Application Programming Interface) support on .NET framework and
ADOMD (ADO with multi dimension) extensions which enable programmers to create their third party
applications talking to Analysis Services data mining engine and (2) dependency networks which visualize
important features .
Prior to the decision tree model building phase, all cases were checked against syntax error and some
foods which are pointing same type were aggregated and named as one common name. Overall dataset
contains 1323 cases and 92 cases belong to March 2011-May 2011 months were kept as validation dataset
and removed from training/test dataset for further validation. Remaining 1231 cases were shuffled and
divided to 10 equal sized %10-%90 test-train partitions for 10 fold cross validation. Features on sales counts
11
were selected as “predict” features while the remaining ones were set as input features. As the first step, most
optimum complexity penalty (CP) value was tried to be determined by applying 10 cross fold validation tests
(each for students, academics and officers) with 0.4, 0.5, 0.7 and 0.85 CP values respectively. Thus, 120
different decision tree models were obtained. In MSDT, the higher CP value causes shorter trees and vice
versa. Each fold was tested against its test data with these four CP values and VAF (Variance Account for)
results were gathered together. In this study, variance account for VAF (Eq. 1) index is used to check the
prediction performance of models.
= 1 var()
var()× 100
Where y and y’ are the observed and predicted values respectively. The highest VAF valued CP is voted as
the best CP for each fold. In Table. 1, it can be seen that “0.5” is the best CP over 10 fold cross validation.
Table. 1: Frequency table of complexity penalty parameter over 10 cross validation.
Complexity Penalty Value
# of times it is winner
0.4
3
0.5
6
0.7
2
0.85
1
On the other hand, 7th fold with CP = 0.5 was detected as the best models to represent our prediction tool.
Due to limited number of pages in this study, the results of VAF values could not be given. However the
VAF values of the 7th fold models (CP=0.5) can be listed as: students = 80.78, officers = 80.58, academics =
64.81. According to dependency network results, it can be deduced that month, is HolidayDay, containsMeat
and containsDessert features highlighted as the first four important variables in all three kind of customers.
3. The details of ADEM
As stated before, the main point of this study is to design and implement of a decision tree based
decision support tool. Following to model processing and determination of the best one, ADEM was
developed at the second stage. Ease to use and platform independence were selected as the main design
considerations. Therefore instead of desktop application model, web-based approach was preferred.
As can be seen on figure 1, ADEM is built as a three tier application. Data mining engine in Microsoft
Analysis Services constitutes the data layer and this layer is responsible of managing data mining models
manipulated by domain experts. On the other hand, ADEM contains two important modules: (1) decision
tree explorer/viewer and (2) online query module. These modules were designed for cross browser
compatibility which enables it to be run on either desktop or mobile devices regardless of the operating
system. ASP.NET [11] framework is mainly employed in ADEM.
In the first module (Fig. 2) decision tree explorer, managers have the ability to check models and
understand the important factors (features) affecting demand prediction. In this module, an expandable tree
viewer employing Walker’s algorithm is used. In the second module, users have the ability to make visual
queries against to mining engine through ADEM. The only need is to specify which type of customers
(academics, students, officers) should be predicted and input the parameters (food1, food2, food3, food4,
month, day, is that day holiday, does this menu contains dessert or meat) Then with just one click, daily
demand prediction results are retrieved and listed as a table on user interface.
The same as all predictive data mining models have, decision trees has also prediction errors. Therefore,
with the actual demand prediction, variance, standard deviation, probability and support values can also be
retrieved for managers to have insight on uncertainty. On the other hand, one another unique advantage of
this tool is to predict the daily demand even for not served menu combinations so far. Thus, managers or
nutritionists will have the ability of making trials on different menu combinations for different purposes.
(1)
12
Fig. 1: System architecture of ADEM
Fig. 2: Decision tree explorer
On the other hand, ADEM is not designed statically. In other words, this tool is capable to be run on
different decision tree models. This means that, with different types of datasets can be modelled on Analysis
Services and then ADEM can load and interact with them through general ADOMD.NET functions.
4. Conclusions
13
In this study, a web based decision support tool named “ADEM” a menu demand prediction for food
courts was designed and developed. On the other hand, an original 44 months period dataset containing sales
numbers of three customer types and menu related information was employed during decision tree model
generation. As the previous studies have shown that, decision tree models are easy to interpret and present
accurate prediction results [1]and[4]. Therefore, instead of black box type of methodologies (e.g. artificial
neural networks or support vector machines) decision trees are employed in prediction models. As success of
models shows that, it has been a good candidate model for these types of tasks. To be further used in ADEM,
the most successful model that has best generalization/prediction capacity is tried to be determined. In order
to achieve this goal, optimum tree depth is searched by testing different complexity penalty parameter.
According to results, 0.5 is determined as the optimum value.
Fig. 3: ADEM query page
In this type of data driven studies, the quality of data is coming to prominence. Therefore, to get better
results it is highly recommended to avoid noisy data. Seasonal fluctuations constitute the noisiest cases.
Therefore, it is highly advised to remove these periods at pre-process stage of whole data mining process.
On the other hand, it is discovered that non vegetarian menu combinations are demanded much more
than vegetarian ones. This finding can vary in different cultural habits. However, since it is one of the most
important features, extraction and employment of this type of pre-processed features highly recommended
for better prediction accuracy.
By this study, consumption prediction of menu combinations which not served yet, also become possible.
Therefore with this achievement, it is believed that managers of institutional food courts gain more power in
short term decision making.
5. References
[1] A. S. Bozkir, and E. Akcapinar Sezer. Predicting food demand in food courts by decision tree approaches.
14
Procedia Computer Science. 2011, 3: pp. 759-763.
[2] M. Hennel, Food Manufacturers Turn to Demand Forecasting to Gain a Competitive Edge, Available online:
http://www.foodmanufacturing.com/articles/2006/03/food-manufacturers-turn-demand-forecasting-gain-
competitive-edge (4.1.2013)
[3] S. Sundararajen, G. Srinivasan, W. O. Staehle, and E. W. Zimmers. Application of a Decision Support System for
Operational Decisions, Computer ind. Engng. 1998, 35 (1), pp. 141-144.
[4] A.S. Bozkir, and E. Sezer, Usage of data mining techniques in discovering the food consumption patterns of
students and employees of university, International Symposium on Engineering and Architectural Sciences of
Balkan, Caucasus and Turkic Republics. 2009, pp. 104-109.
[5] L. Breiman, J.H. Friedman, R.A. Olshen, and C.J. Stone, Classification and Regression Trees, Wadsworth &
Brooks/Cole Advanced Books and Software, Monterey, CA, 1984.
[6] Microsoft Decision Trees Algorithm Technical Reference, Available online: http://msdn.microsoft.com/en-
us/library/cc645868.aspx (5.1.2013)
[7] A. Altunkaynak, M. Özger, and M. Çakmakcı, Water consumption prediction of Istanbul city bu using fuzzy logic
approach, Water Resources Managament, 2005, 19, pp. 641-654.
[8] R. Abiyev, V.H. Abiyev, and C. Ardil, Electricity consumption prediction model using neuro-fuzzy system, World
Academy of Science, Engineering and Technology, 2005, 8, pp. 128-131.
[9] L. L. Bhattarcharyya, S. Sclove, S.L. Chen, and W.J. Lattyak, Data mining on time series: an illustration using
fast-food restraunt franchise data, Computatiaonal Statistics & Data Analysis. 2001, 37, pp. 455-476.
[10] Microsoft SQL Server Analysis Services, Available online: http://www.microsoft.com/sqlserver/en/us/solutions-
technologies/business-intelligence/analysis.aspx (5.1.2013)
[11] Asp.NET, Available online: http://www.asp.net/ (5.1.2013)
15