Implementation of Apriori Algorithm for Analysis of Consumer Purchase Patterns

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.


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.

Data Mining
Data mining or often referred to as knowledge discovery in databases (KDD) is an activity that includes gathering, using historical data to find order, patterns or relationships in large data. This data mining output can be used to help make future decisions. The development of KDD has caused the use of pattern recognition to diminish because it has become a part of data mining [4].

Association Rule
Following are the steps of association rules calculation process [3]. a. The system scans the database to get a 1-itemet candidate (set of items consisting of 1 item) and calculates the support value. Then the support value is compared with the specified minimum support, if the value is greater or equal to the minimum support then the itemset is included in a large itemset. b. Itemset which is not included in large itemsets is not included in the next iteration in pruning. c. In the second iteration the system will use large itemset results in the first iteration (L1) to form the second itemset candidate (L2). In the next iteration, the system will use the results of large itemset in the iteration and then will use large itemset results in the previous iteration (Lk-1) to form the following itemset candidate (Lk). The system will join Lk-1 with Lk-1 to get Lk, as in the previous iteration the system will delete / prune the itemset combination which is not included in the large itemset. d. After the join operation, the new itemset result from the join process is calculated for support. e. The candidate formation process which consists of a join and prune process will continue to be carried out until the candidate itemset set is null, or there are no more candidates to be formed. f. After that, the result of frequent itemset was formed an association rule that met the specified support and confidence values. g. In the formation of association rule, the same value is considered as one value. h. The association rule that is formed must meet the specified minimum value.
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 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].

Apriori Algorithm
Broadly speaking the a priori algorithm works [1]. a. The formation of candidate itemset, candidate k-itemset is formed from a combination of item (k-1) -itemset obtained from the previous iteration. One characteristic of the Apriori algorithm is the presence of candidate k-itemset trimming whose subset containing k-1 items is not included in the high frequency pattern with a length of k-1. b. Calculation of support from each candidate k-itemset. Support from each of our candidate candidates is obtained by scanning the database to calculate the number of transactions that contain all items in the candidate items. This is also a feature of the Apriori algorithm which requires calculation by scanning the entire database as much as the longest item-itemet. c. Set a high frequency pattern. A high frequency pattern that contains k items or itemset is determined from the candidate kitet whose support is greater than the minimum support. d. If no new high frequency pattern is obtained, the whole process is stopped. If not, then k plus one and return to part 1.

Apriori Algorithm Analyst a. High Frequency Pattern Analysis
This stage looks for item combinations that meet the minimum requirements of the support value in the database. 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. 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. After all high frequency patterns have been found, then the association rules that meet the minimum requirements are found for confidence associative rules A → B minimum confidence = 50%. b. Final Association Rules Association rules are sequential based on minimum support and minimum confidence that meet the following:

Implementation System
This page is used to display the results of the data mining process.

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