Professional Documents
Culture Documents
Design of Machine Learning Framework For
Design of Machine Learning Framework For
Design of Machine Learning Framework For
5
Communications on Applied Electronics (CAE) – ISSN : 2394-4714
Foundation of Computer Science FCS, New York, USA
Volume 7– No. 37, July 2021 – www.caeaccess.org
store’s owners to make an important business decision that will support. All subsets of a frequent itemsets are also frequent
make them competitive and maximize their profit margin. This itemsets, while subsets of infrequent itemsets are infrequent
work presents an Association Rule Mining framework for item-sets. ARM is defined as follow:
mining previous transactions of consumers’ buying patterns
for the optimal prediction of products placed on the shelves, P = P1, P2…, P (1)
physical shelf arrangement, and identification of products that
needs promotion. Be a set of n binary attributes called products.
6
Communications on Applied Electronics (CAE) – ISSN : 2394-4714
Foundation of Computer Science FCS, New York, USA
Volume 7– No. 37, July 2021 – www.caeaccess.org
3.1 Sales Record Dataset the sales record represent a transaction, and each column
Availability and quality of data is the bedrock of any represent a product (an item). The present of an item in every
successful database modeling projects; availability involves transaction is represented with 1’s while 0’s implies an
the existence of a relevant and suitable quantity of data; while absence of a product in the trasaction
the quality of data involves the fitness of data for the purpose Table 1: Horizontal Representation of Transaction Record
for which it is intended for. High quality data are free of Transaction ID Transaction Details
redundancy, defects and possess desired features fit for the T1 {Bread, Egg}
modeling purpose. Grocery stores generate and store a large T2 {Milk, Bread, Egg}
amounts of data on a daily basis; extraction of sensitive T3 {Bread, Butter, Egg}
information implicitly contained in data will provide a lot of
T4 {Bread, Butter}
direct benefits to the store’s owners. To obtain desirable
T5 {Milk, Bread, Butter, Egg}
results of great benefits to the store, the data must be large
enough to represent all the possible patterns of events in the
store; a transaction data of 6 to 24 months is recommended Table 2; Sampled Preprocessed Five Transactions
in order to provide good and effective decision that will Transaction ID Milk Bread Butter Egg
benefit the grocery store [23]. Sales record contains many 1 0 1 0 1
items such as transaction ID, customer’s name, customer’s ID, 2 1 1 0 1
Product(s) bought, quantity bought, data and time of sales, 3 0 1 1 1
unit price, product(s) code, Receipt number, product 4 0 1 1 0
description. 5 1 1 1 1
7
Communications on Applied Electronics (CAE) – ISSN : 2394-4714
Foundation of Computer Science FCS, New York, USA
Volume 7– No. 37, July 2021 – www.caeaccess.org
is called frequent itemset. In a transaction dataset with n 3, it represents transactions with same items together,
distinct items (products), there will be 2n-1 possible itemsets. horizontal format can be easily converted to vertical format,
The five transactions represented in Table 1 have four distinct the vertical format is more effective than horizontal format, it
items; {Milk, Bread, Butter, and Egg} with possible itemsets scan the dataset once to compute the support for each
= 24-1 = 15 itemsets. The fifteen itemsets from Table 1 with itemsets, it is faster than horizontal format in computing the
their support are ;{ Bread}: 1.0, it appeared in all the five support, but it also required more computer memory space to
transactions in the dataset, it support is 5/5 = 1.0, {Egg}: 0.8, store the transactions ID. FIM algorithms employs Breadth-
{Milk}: 0.4, {Butter}: 0.6. {Milk and Bread}:0.4, {Milk and first and Depth-First search to mine frequent itemsets,
Butter}:0.2, {Milk and Egg}:0.4, {Butter and Egg}:0.4, Breadth-First search (BFS) explore all available nodes and
{Bread and Egg}:0.8, {Bread and Butter}:0.6, {Milk, Bread select the shortest path between the starting node and other
and Butter}: 0.2, {Milk, Bread and Egg}:0.4, {Bread, Butter nodes, its memory consumption is higher than the Depth-First
and Egg}:0.4, {Milk, Butter and Egg}:0.2, {Milk, Bread, Search (DFS). in Breadth-first Search, the algorithm first
Butter and Egg}: 0.2. evaluate single itemsets {Bread}, {Milk},{Butter}, {Egg},
then itemsets with two itemsets such as{{Milk and Bread},
Given a user-defined minimum support of 0.5, itemsets that {Milk and Butter}, {Milk and Egg}, {Butter and Egg},
have it support equals or greater than 0.5 will be filtered as the {Bread and Egg}, {Bread and Butter}, follows by three
frequent itemsets; from Table 1, the itemsets that meet the elements, {Milk, Bread and Butter}, {Milk, Bread and Egg},
minimum support threshold (0.5) set by the user are: {Bread, Butter and Egg}, {Milk, Butter and Egg}and so on
{Bread}:1.0, {Egg}: 0.8, {Butter}: 0.6. {Bread and Egg}:0.8, until all the number of items has been generated. On the other
{Bread and Butter}:0.6. Considering all conceivable itemsets, hand, depth-first search explore itemsets starting with single
the mining of frequent itemsets is huge, naive, time- itemset and then recursively append items to the existing
consuming, expensive in terms of computer resources itemset to create another itemset, in the following order;
employed and not efficient particularly when the number of {Milk}, {Milk, Bread}, {Milk, Bread, Egg}, {Milk, Bread,
items under consideration are many. Efficient way to mine Butter}, {Milk, Bread, Butter, Egg}, {Milk, Butter}, {Milk,
frequent itemsets is via the design of algorithms that Butter, Egg}, {Milk, Egg}, {Bread}, {Bread, Egg}, {Bread,
circumvent exploring the search space of all conceivable Butter}, {Bread, Butter, Egg}, {Butter},{Butter,
itemsets and analyses each itemset in the search space as Milk},{Butter, Egg}, {Egg}. Table 4 depletes the features of
efficient as possible. some FIM algorithms.
The first algorithm used to mine frequent itemsets and Table 3: Vertical Representation of Transections in Table
association rules was Artificial Immune System (AIS) 1
algorithm proposed by [25], improvement on AIS renamed as
Apriori [24], other algorithms proposed for FIM include , Itemsets Transaction ID
Frequent pattern (FP) Growth algorithm [26], Equivalence Milk T2,T5.
Class Transformation (ECLATt) [27], Hyper-links Mine [28],
Linear time Closed Mining (LCM) [29] and SET-oriented Bread T1, T2, T3, T4, T5.
Mining (SETM) [30]. Apriori algorithm has been a
Butter T3, T4, T5.
predominantly implemented algorithm for mining frequent
itemsets, but it is not efficient in its high overhead and Egg T1, T2, T3, T5.
consumption of the computer resources, an improvement to
overcome it inefficiency was proposed in vertical Milk and Bread T2, T5.
representation of its dataset, AprioriTID [31] improve the Milk and Butter T5.
efficiency of Apriori by avoiding multiple scan of the dataset
during it valuation process. All these algorithms employ Milk and Egg T2, T5.
different strategies and data structures to discover frequent
itemsets efficiently. According to [32], FIM algorithms differs Bread and Butter T3, T4, T5.
in the following areas; Bread and Egg T1, T2, T3, T5.
1) Mode of dataset representation, and how to compute Butter and Egg T3, T5.
minimum support
Milk, Bread and Butter T5.
2) Search Space techniques, such as Depth-first or
Breadth-first search and how it determine the next Milk, Bread and Egg T2, T5.
itemsets to explore in the search universe
Bread, Butter and Egg T3, T5.
The two dataset representation formats used in FIM Milk, Butter and Egg T5.
algorithms are Horizontal and vertical data format, horizontal
format is presented in Table 1, it represents each transactions Milk, Bread, Butter and Egg T5.
by its transaction ID, the vertical format is depleted in Table
8
Communications on Applied Electronics (CAE) – ISSN : 2394-4714
Foundation of Computer Science FCS, New York, USA
Volume 7– No. 37, July 2021 – www.caeaccess.org
3.4 Association Rules Generations customers that bought Bread also bought Eggs. In rule 2, all
Association Rules (AR) generation in ARM involves two the customers that bought Egg also bought Bread. 60% of
stages, in the first stage, frequent itemsets were generated, customers that bought bread in rule 3 also bought Butter,
while the second stage has to do with creation of all possible while all the customers that bought butter in rule 4, also
rules from each of identified frequent itemsets that satisfied bought Bread. Rules that satisfied the minimum support and
the minimum confidence threshold. AR are conditional confidence threshold are strong rules. Often, an AR with high
probability that indicate the likelihood of a customers to buy a confidence implies a strong rule, this can be misleading and
certain product provided if he or she had bought another deceptive when the antecedent and/or the consequent have a
product in the same purchase. AR is of the form {X Y} has high support. Whenever the consequent of any AR is very
two part; the antecedent and the consequent, X is the frequent, its confidence will high. High confidence may be
antecedent (if) and Y (then is the consequent. Antecedent are misleading at times, and does not always implies strong rules.
items found within the data while consequent are items found Lift ratio is a better metric to measure the strength of AR, it is
in combination with the antecedent. AR are created from the ratio of confidence of a rule to the expected confidence a
binary partitioning of each itemsets, the following binary rules rule. The expected confidence of a rule is probability of
will be generated from {Bread, Egg, Milk} frequent buying the consequent of the AR without any knowledge
itemset;{Bread Egg}, {Bread Milk}, {Bread Egg, about antecedent. The lift ratio of AR is given in
Milk}, {Egg Bread}, {Egg Milk}, {Egg Bread, Milk}, equation 7.
{Milk Egg}, {Milk Bread}, {Milk Bread, Egg},
{Bread, Egg Milk}, {Bread, Milk Egg}, {Egg, Milk
Bread},etc. The total number of possible binary rules R,
generated from an itemset with d no of items is given in
A Lift value greater than one (1) implies positive association
equation 6
(correlation) between the antecedent and consequent of the
R = 3d − 2 d+1 + 1 (6) AR, it implies that if a customer buy products in the
antecedent there is great chances that products in the
AR generate a lot of rules, most these rules are not relevant consequent will also be bought also. A lift value less than one
and important, to prune the rules and obtain important rules, (1) implies negative association between the antecedent and
confidence of the each rule are computed using equation 5 consequent of the AR, lift value of one (1) indicates no
based on the user defined minimum confidence threshold association between the antecedent and consequent of the AR.
filter. AR that does not meet the minimum confidence Applying Equation 7 to Table 1 gives the following lift values
threshold will be discarded. Note that the confidence of the for the Rules 1, 2, 3 and 4.
rule {Bread Egg} may not be same with the confidence of
rule {Egg Bread}. Rule 1: {Bread Egg}, support: 0.8, confidence: 0.8, lift:
1.0
From Table 1, the itemsets that meet the minimum support
threshold (0.5) set by the user are: {Bread}:1.0, {Egg}: 0.8, Rule 2: {Egg Bread}, support: 0.8, confidence: 1.0, lift:
{Butter}: 0.6. {Bread and Egg}:0.8, {Bread and Butter}:0.6. 1.25
Given a user defined confidence of 60% (0.6). The number of
Rule 3: {Bread Butter}, support: 0.6, confidence: 0.6,
AR with their support and confidence values are listed below;
lift: 1.0
Rule 1: {Bread Egg}, support: 0.8, confidence: 0.8
Rule 4: {Butter Bread}, support: 0.6, confidence: 1.0,
Rule 2: {Egg Bread}, support: 0.8, confidence: 1.0 lift: 1.25
Rule 3: {Bread Butter}, support: 0.6, confidence: 0.6 The values of the lift of the rules above shows that there is no
association between the rules {Bread Egg} and {Bread
Rule 4: {Butter Bread}, support: 0.6, confidence: 1.0 Butter}, while there is a positive correlation between the
` antecedent and the consequent of rules {Egg Bread} and
{Butter Bread}, with 25% more chances of buying the
The rules are interpreted as follows, in rule 1, 80% of antecedent and the consequent products together. Considering
9
Communications on Applied Electronics (CAE) – ISSN : 2394-4714
Foundation of Computer Science FCS, New York, USA
Volume 7– No. 37, July 2021 – www.caeaccess.org
the confidence of an AR alone will limit the competency of under Merchandising Rules. A Master’s Dissertation
making good business decision, The Lift discloses how much submitted University of Porto.
better an AR is at predicting products to be placed together on
the shelve rather than assuming, confidence assumes, Lift is a [8] Olasehinde O. O. (2020). A Stacked Ensemble Intrusion
measure that assist store managers to determine the products to Detection Approach for Security of Information System,
be placed together on shelve. International Journal for Information Security Research
(IJISR), 10(1).
4. CONCLUSION [9] Olasehinde, O.O., Williams, K.O. and Ajinaja, M.O.
The vast amount of transaction dataset being generated by (2018): Application of Association Rule Learning in
grocery store remain useless unless the latent knowledge and Customer Relationship Management. Proceedings of the
patterns hidden in it is unlock and discovered. Discovered 14th iSTEAMS International Multidisciplinary
latent pattern or knowledge from transactional dataset will help Conference, AlHikmah University, Ilorin, Nigeria, 14:
grocery store’s owners to make important business decision 29-36
that will make them competitive and maximized their profit
margin. The well-known and most used support-confidence [10] Sherdiwala B., Khanna O. (2015). Association Rule
framework for Association Rule Mining has some drawbacks Mining: An Overview”, International Multidisciplinary
when employ to generate strong rules, this weakness has led Research Journal (RHIMRJ).
to it poor predictive performances. This framework predict [11] Serban G., Czibula I. G. and Campan A. (2016). A
customers buying behavior based on the assumption of the Programming Interface For Medical diagnosis
confidence value, which limits it competent at making good Prediction”,StudiaUniversitatis, "Babes-Bolyai",
business decision. This work presents a better Association Informatica, LI(1), pages 21-30, 2006.
Rule Mining framework for mining data of previous
transactions of consumers’ buying patterns for the optimal [12] Gupta N., Mangal N, Tiwari K. and Mitra P. (200).
prediction of products placement on the shelves, physical shelf Mining Quantitative Association Rules in Protein
arrangement and identification of products that needs Sequences”, In Proceedings of Australasian Conference
promotion. The proposed framework leverage on the ability on Knowledge Discovery and Data Mining –AUSDM,
of lift metric at improving the predictive performance of 273-281, 2000
association rule mining. The Lift discloses how much better [13] Raorane A.A., Kulkarni R.V. and Jitkar B.D. (2012).
an AR is at predicting products to be placed together on the Association Rule – Extracting Knowledge Using Market
shelve rather than assuming, confidence assumes. Lift is a Basket Analysis, Research Journal of Recent Sciences,
measure that assist store managers to determine the products to 1(2): 19-27.
be placed together on shelve. The proposed framework will
assist retailers and grocery store’s owners on products [14] Liu, H., Su, B., & Zhang, B. (2007). The Application of
placement on the shelves, physical shelf arrangement and Association Rules in Retail Marketing Mix. 2007 IEEE
identification of products that needs promotion International Conference on Automation and Logistics,
2514-2517.
5. REFERENCES
[15] Suchacka, G., Chodak, G. (2017) Using association rules
[1] Hoyer, W.D & Walgren, C.J.C. (1988). Consumer
Decision Making Across Product Categories: The to assess purchase probability in online stores. Inf Syst E-
Influence of Task Environment. John Wiley & Sons Inc., Bus Manage 15, 751–780.
5(1) 45-69 https://doi.org/10.1007/s10257-016-0329-4
[2] Hübner, A. H. and Kuhn, H. (2012). Retail category [16] March N., Reutterer T. (2008) Building an
management: State-of-the-art review of quantitative Association Rules Framework for Target Marketing.
research and software applications in assortment and In: Preisach C., Burkhardt H., Schmidt-Thieme L.,
shelf space management. Omega, 40(2):199–209 Decker R. (eds) Data Analysis, Machine Learning and
Applications. Studies in Classification, Data Analysis,
[3] Dreze, X., Hoch, S. J., & Purk, M. E. (1994). Shelf and Knowledge Organization. Springer, Berlin,
management and space elasticity. Journal of Retailing, Heidelberg. https://doi.org/10.1007/978-3-540-78246-
70, 301–326. 9_52
[4] Fancher, L. A. (1991). Computerized space management: [17] Phani, P., and Murlidher, M. (2013). A Study on Market
A strategic weapon. Discount Merchandiser, 31(3), 64- Basket Analysis Using a Data Mining Algorithm.
65. International Journal of Emerging Technology and
Advanced Engineering, 3(6): 361- 363. Retrieved from
[5] Hwang, H., Choi, B., & Lee, M. J. (2005). A model for www.ijetea.com
shelf space allocation and inventory control considering
location and inventory level effects on demand. [18] Zaki M.J. (2000). Scalable Algorithms for Association
International Journal of Production Economics, 97(2), Mining. IEEE Transaction on Knowledge and Data
185-195. Engineering, 12(3): 372-390.
[6] Hübner, A. H. and Schaal, K. (2017). An integrated [19] P. Yazgan, A.O. Kusakci. (2016). A Literature Survey on
assortment and shelf-space optimization model with Association Rule Mining Algorithms, Southeast Europe
demand substitution and space-elasticity effects. Journal of Soft Computing 5(1), Doi;
European Journal of Operational Research, 261(1):302– 10.21533/scjour(nal.v5i1.102
316.
[20] Vidhate, D. (2014). To improve Association Rule Mining
[7] Luís F. M. S. (2018). Optimizing Shelf Space Allocation using New Technique: Multilevel Relationship
10
Communications on Applied Electronics (CAE) – ISSN : 2394-4714
Foundation of Computer Science FCS, New York, USA
Volume 7– No. 37, July 2021 – www.caeaccess.org
Algorithm towards Cooperative Learning 241–246. [27] Zaki, M. J. (2000). Scalable algorithms for association
mining. IEEE Transactions on Knowledge and Data
[21] Cuzzocrea A., Leung C.K., MacKinnon R.K. (2015). Engineering. 12 (3), 371- 390. doi:10.1109/69.846291
Approximation to expected support of frequent itemsets
in mining probabilistic sets of uncertain data, Procedia [28] Pei J., Han, J., Lu H., Nishio S, Tang S, Yang D. (2001)
Comput. Sci. 613–622. H-mine: Hyper-structure mining of frequent patterns in
large databases. In: Proc. 2001 IEEE Intern. Conf. Data
[22] Naresh P. and Suguna R. (2019). "Association Rule Mining, 441–448.
Mining Algorithms on Large and Small Datasets: A
Comparative Study," 2019 International Conference on [29] T. Uno, M. Kiyomi, and H. Arimura,(2004) “Lcm ver. 2:
Intelligent Computing and Control Systems (ICCS), Efficient mining algorithms for frequent/closed/maximal
2019, pp. 587-592, doi: itemsets,” in Fimi, vol. 126, Proc. ICDM’04 Workshop
10.1109/ICCS45141.2019.9065836. on Frequent Itemset Mining Implementations, CEUR,
2004.
[23] Al-hagery, M.A. (2015). Knowledge Discovery in the
Data Sets of Hepatitis Disease for Diagnosis and [30] Houtsma M. and Swami A. (1995) Set-oriented mining
Prediction to Support and Ser ve Community. Int. J. of association rules”. Elsevier journal Data & Knowledge
Comput. Electron. Res. 4, 118–125. Engineering 245-262 Technical Report RJ 9567
[24] Agrawal, R., Srikant, R. (1994) Fast algorithms for [31] Gosain, A., & Bhugra, M. (2013). A comprehensive
mining association rules. In: Proc. 20th int. conf. very survey of association rules on quantitative data in data
large data bases, VLDB 1994, Santiago de Chile, Chile, mining. 2013 IEEE CONFERENCE ON INFORMATION
(487–499). AND COMMUNICATION TECHNOLOGIES, 1003-
1008. DOI: https://doi. org/10.1109/cict.2013.6558244.
[25] Aggarwal, C. C. Data mining: the textbook. Heidelberg:
Springer; 2015. [32] Fournier-Viger, P., Lin, C., Vo, B., Truong, T.C., Zhang,
J., & Le, H. (2017). A survey of itemset mining. Wiley
[26] Han, J, Pei, J, Ying, Y, Mao, R. Mining frequent patterns Interdisciplinary Reviews: Data Mining and Knowledge
without candidate generation: a frequent-pattern tree Discovery, 7(4) https://doi.org/10.1002/widm.1207
approach. Data Min. Knowl. Discov., 2004, 8(1):53–87.
11