Implementation of Apriori Algorithm For Analysis o
Implementation of Apriori Algorithm For Analysis o
1,7
Teknik Informatika, STMIK Pelita Nusantara Medan, Sumatera Utara, Indonesia
2,6
Doctoral Program, Faculty of Computer Science and Information Technology,
Universitas Sumatera Utara, Medan-Indonesia
3
Program Doctoral Vocational Technology Education, Postgraduate Engineering
Faculty Padang State University Padang West Sumatera -Indonesia
4
Manajemen Informatika, AMIK Logika, Sumatera Utara, Indonesia
5
Manajemen Informatika, AMIK Labuhan Batu, Sumatera Utara, indonesia
Abstract. Consumer purchasing patterns are a form of purchases made by consumers, whether
someone or a lot of people to get the desired item by making a purchase transaction. One
characteristic of the purchase pattern is the existence of acquiring something through
exchanging money. This study aims to create an application that is used in determining
consumer purchasing patterns by applying a priori algorithms and using Visual Basic 2010 as a
tool for determining consumer purchase patterns. This application uses a priori algorithm
calculation method where the sample consumer purchase data will be sorted and calculated by
providing the value of the minium support and configuration parameters and based on the
results of confidence the largest number of conclusions such as: can be used as information for
determining sales, the application of a priori algorithms can provide information pattern
combination item set from consumer purchase data that is with support above 15% and
confidence above 50% on item set.
1. Introducing
Cafe Bojack Coffee Shop is a business entity that is engaged in selling light dishes for the general
public. where is this cafe one of hundreds of cafes in Medan City. Although the cafe is very crowded,
but often experience problems such as not the availability of the consumer order menu even though the
order is in demand. Basically, the Cafe owner of the Bojack Coffe Shop has not analyzed the data
specifically for example to combine items which will cause problems so that they do not know how
the relationship between items with other items. Data mining is the process of finding interesting
patterns or information in selected data using certain techniques or methods. The techniques, methods,
or algorithms in data mining vary greatly. The selection of the right method or algorithm depends very
much on the objectives and the Knowledge Discovery in Database (KDD) process in its entirety. Data
mining techniques to find associative rules or relationships between items are called association rule
mining. one of the algorithms used to find association rules is a priori algorithm. The Apriori
Algorithm, helps in forming possible combination item candidates, then tests whether the combination
meets the minimum support parameters and minimum confidence which is the threshold value given
by the user.
Content from this work may be used under the terms of the Creative Commons Attribution 3.0 licence. Any further distribution
of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
Published under licence by IOP Publishing Ltd 1
The International Conference on Computer Science and Applied Mathematic IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 1255 (2019) 012057 doi:10.1088/1742-6596/1255/1/012057
2. Research Methodology
Minimal Support: a value determined by the researcher to cut the combination of set items into fewer
[2]. Minimal Confidence is a value that is also determined by the researcher to cut the combination of
each k-item set (the result of minimal support trimming) to form association rules [2].
The basic methodology of association analysis is divided into two stages:
Support
Support from an association rule is the presentation of the combination of items in the database,
where if have item A and item B then the support is the proportion of transactions in the
database containing A and B. [7].
The support value of an item is obtained by the formula[6].
( ℎ )
( )=
While the support value of 2 items is obtained from the following formula:
( , )= ( ∩ )
∑
( , )=
∑
Confidence
Confidence of association rule is a measure of the accuracy of a rule, which is the presentation
of a transaction in a database containing A and containing B [7].
∑
= ( | )=
∑
2
The International Conference on Computer Science and Applied Mathematic IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 1255 (2019) 012057 doi:10.1088/1742-6596/1255/1/012057
For example in this study the analyst wants a rule that has more than 15% support and more than 50%
confidence.
Step 1. Look for K1 (1-itemset candidate) as follows.
Table 2. Candidate 1-itemset (K1)
Item Candidate
Aqua 1/20 * 100% = 5%
Avocado 2/20 * 100% = 10%
3
The International Conference on Computer Science and Applied Mathematic IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 1255 (2019) 012057 doi:10.1088/1742-6596/1255/1/012057
Item Candidate
Brown Chocolate 1/20 * 100% = 5%
Coca-Cola 1/20 * 100% = 5%
Chicken Nugget 1/20 * 100% = 5%
Cappuccino 11/20 * 100% = 55%
Dark Chocolate 7/20 * 100% = 35%
French Fries 3/20 * 100% = 15%
Kuku Bima 2/20 * 100% = 10%
Coffee Mix 1/20 * 100% = 5%
Lemon Tea 3/20 * 100% = 15%
Fried noodles 7/20 * 100% = 35%
Noodle soup 9/20 * 100% = 45%
Milo 5/20 * 100% = 30%
Martabak Noodles 2/20 * 100% = 10%
Eyes of Cattle Eggs 1/20 * 100% = 5%
Fried rice 14/20 * 100% = 70%
Rice 4/20 * 100% = 20%
Nutri Sari 4/20 * 100% = 20%
Oranges 1/20 * 100% = 5%
Grilled banana 4/20 * 100% = 20%
Fried bananas 1/20 * 100% = 5%
Sprite 2/20 * 100% = 10%
Milk 3/20 * 100% = 15%
Dutch eggplant 2/20 * 100% = 10%
Sweet tea 9/20 * 100% = 45%
Milk tea 2/20 * 100% = 10%
Teh Tarik 7/20 * 100% = 35%
The combination of itemset in f1 can be used as a 2-itemset broker. itemset-itemset from f1 that can be
used are itemset-itemset which have similarities in the first k-1 item.
The 2-itemset candidate that can be formed from f1 is as follows.
Table 3. Candidate 2-itemset (K2)
No Item 1 Item 2 Candidate
1 Fried rice Cappuccino 7/20 * 100% = 35%
2 Fried rice Noodle soup 4/20 * 100% = 20%
3 Fried rice Sweet tea 6/20 * 100% = 30%
4 Fried rice Dark Chocolate 5/20 * 100% = 25%
5 Fried rice Teh Tarik 4/20 * 100% = 20%
6 Fried rice Fried noodles 5/20 * 100% = 25%
7 Fried rice Milo 3/20 * 100% = 15%
8 Fried rice White rice 1/20 * 100% = 5%
9 Fried rice Nutri Sari 3/20 * 100% = 15%
10 Fried rice Grilled banana 2/20 * 100% = 10%
11 Fried rice milk 3/20 * 100% = 15%
12 Nasi Goreng Lemon Tea 3/20 * 100% = 15%
13 Fried rice French Fries 3/20 * 100% = 15%
14 Cappucino Noodle soup 6/20 * 100% = 30%
15 Cappucino Sweet tea 3/20 * 100% = 15%
16 Cappucino Dark Chocolate 5/20 * 100% = 25%
17 Cappucino Teh tarik 3/20 * 100% = 15%
18 Cappucino Fried noodles 3/20 * 100% = 15%
19 Cappucino Milo 4/20 * 100% = 20%
20 Cappucino rice 2/20 * 100% = 10%
21 Cappucino Nutri Sari 4/20 * 100% = 20%
22 Cappucino Grilled banana 2/20 * 100% = 10%
4
The International Conference on Computer Science and Applied Mathematic IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 1255 (2019) 012057 doi:10.1088/1742-6596/1255/1/012057
5
The International Conference on Computer Science and Applied Mathematic IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 1255 (2019) 012057 doi:10.1088/1742-6596/1255/1/012057
c. System Design
6
The International Conference on Computer Science and Applied Mathematic IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 1255 (2019) 012057 doi:10.1088/1742-6596/1255/1/012057
4. Conclusions
Based on the discussion and implementation, several conclusions can be obtained:
1. Analysis of consumer purchasing patterns using a priori algorithm in this application, can
provide association rules by giving the drink value suport and drink confidence as a reference.
2. From the results of testing by entering a different value of support and drinking confidence, that
is, if the minimum support is 15% and the confidence level is 50%, a rule of 87 rules will be
generated.
3. The benefits of the test results for the cafe include:
a. Fried Rice Stocks and Capuucino stock can be provided with many of the same stock.
b. Cappuccino stock and stock of Kuah Noodle can be provided with many of the same stock.
c. The tea stock pull and stock of fried noodles can be provided with many of the same stock
d. The cafe can make a jumbo package food menu for more interesting
References
[1] Achmad Nur Cahyon, "Implementation of Data Mining of Apriori Algorithms on Motorcycle
Spare Parts Sales in Ahas Putra Motor", 2016
[2] Al-maolegi, Mohammed, and Bassam Arkok. A N I MPROVED A PRIORI A LGORITHM
7
The International Conference on Computer Science and Applied Mathematic IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 1255 (2019) 012057 doi:10.1088/1742-6596/1255/1/012057