Implementation of association rule using apriori algorithm and frequent pattern growth for inventory control

— Inventory control is needed to maintain smooth operations and improve product efficiency. The problem of procurement of goods that are not by needs is a problem that often occurs in various companies. This problem has the potential to affect business processes that hinder increased sales. Based on this, a strategy is needed in managing inventory to increase customer satisfaction. This study aims to find combinations of goods to be analyzed, resulting in an Association Rule that can be used by store owners to manage the inventory of goods. The algorithms used in this study are Apriori and Frequent Pattern Growth (FP-Growth). Apriori algorithm methods and FP-Growth are two techniques used in data mining to find combinations of goods resulting in the Association Rule. This research begins with literature study and data acquisition as the first step in data pre-processing. Next, data analysis is performed to identify patterns and relationships between items in the dataset. At the evaluation stage, the lift ratio method is used to determine the validity of association rules. This is an important step to ensure that the rules found have relevance and are being analyzed so that they can be used for better decision-making. The results of the implementation of a priori and FP-Growth algorithms for 2-item analysis show that they both produce the same number of association rules, i. e. 16 rules. There is a similarity in the rules with the highest lift ratio, which is 14. In addition, some other rules with a lift ratio of 5 are also found in both algorithms. Next, the calculation of the 3-item set lift value, both show the same lift ratio value. This indicates that they are effective in extracting association rules from the same dataset, for both 2-itemset and 3-itemset.


I. INTRODUCTION
Data is very important in today's era and can support decisions on various aspects.Making decisions based on facts from data in the field is a smart move and can improve the quality of decisions.One example is in the sales process, especially in retail stores that provide various products [1], [2].Every day, retail stores make many sales transactions, so the sales data generated is also very much.However, the data should not only be used as a record without added value but must be used for business purposes.Transaction data storage will continue to grow over time, so data must be optimized to improve efficiency [3], [4].
Goods control is an important aspect that needs to be managed properly so that a business can run smoothly and efficiently.The development of informa-tion technology has begun to be utilized by competition between rulers, so developers need to find the right strategy to meet needs and ensure customer satisfaction.One of the strategic innovations in business is to look for connections or linkages between different sets of products so that they can be packaged and sold simultaneously [5]- [7].This innovation provides a solution to sales and inventory problems because product mismatches increase sales.However, finding relationships between goods is a difficult process due to large product problems, especially when merchants have thousands of products [8]- [11].
For inventory management, data mining algorithms can be used to find patterns in inventory data, one of which is by applying the association rule technique and the method that can be applied in this study is market basket analysis [12]- [14].Market basket analysis is ISSN: 2085-3688; e-ISSN: 2460-0997 Implementation of association rule using apriori algorithm and frequent pattern growth for inventory control one method in data mining [15], [16].Data mining is a complex data analysis process that involves statistical, mathematical, and artificial intelligence techniques to explore and discover hidden patterns in large data sets [17]- [19].The goal of data mining is to get valuable and useful information from data to make business decisions.Data mining can be applied to different types of data such as customer data, inventory data, transaction data, marketing data, and other data [20]- [22].
The data mining process includes several steps such as data preprocessing, selection of appropriate data mining methods, method execution, evaluation of results, and interpretation of results.Some commonly used data mining techniques include classification, regression, clustering, association, and ranking models.Each of these techniques has a different purpose and can be applied to different types of data [23], [24].In business, data mining can help optimize inventory management, improve product efficiency, improve customer experience, and make more accurate business decisions [25], [26].Data mining can also help identify hidden trends and patterns in data, allowing companies to respond more effectively to changing market or customer needs [27]- [32].
Two data mining algorithms that are often used in inventory analysis are the apriori algorithm and FP-Growth.Both of these algorithms can be used in the context of inventory control to find patterns of association and high frequency between inventory items [33]- [35].Apriori algorithm is an algorithm in data mining that is used to find patterns that often appear (frequent itemsets) in a collection of transaction data.This algorithm works by dividing the dataset into smaller subsets and then looking for items that often appear in each subset.After that, the found itemsets will be combined to form larger itemsets and then recalculated in frequency.This process is done iteratively until no more frequently occurring itemsets can be found.Apriori algorithms are useful in data analysis and marketing, where we can find frequently emerging consumer buying patterns and create more effective marketing strategies [36].
The FP-Growth algorithm uses a top-down approach to generate a tree data structure called FP-Tree, which represents all transactions in a more concise form.Then, the FP-Growth algorithm will extract frequent itemsets from the FP-Tree using a recursive approach, which is a more efficient alternative to apriori algo-rithms, especially when the dataset is very large and complex.These two algorithms have the same goal of finding patterns in datasets, but apriori and FP-Growth algorithms have different approaches and techniques for extracting relevant information from data.Natural inventory control [37]- [40].
Some previous research has been related to the utilization of association rule algorithms.For example, research conducted by Ardiantoro and Sunarmi [41] (2019) aims to analyze the game patterns of badminton players which is one of the popular sports in Indonesia.In this study, data was collected and processed by dividing the playing field into several play areas.In addition, Apridonal et al. [42] (2019) conducted research to develop an application that can identify sales patterns using the Association Rule method and apriori algorithm.Hu et al. [43] also used frequency pattern growth algorithms in their study to analyze the stability of public transport trips using association rule mining.The next research was conducted by Elisa and Azwanti [44] (2019) who used the association rule method with the FP-Growth algorithm to analyze the frequency of purchasing 3 kg LPG gas.
Based on previous research that has used FP-Growth and apriori algorithms for various purposes, such as analyzing game patterns, travel stability, developing children's toy applications, purchasing fertilizers, transportation trip stability, and purchasing 3 kg LPG gas, the FP-Growth algorithm is more often used because it is considered superior to apriori [45].Therefore, this study will also use the FP-Growth algorithm to find association rules to help store owners manage their product inventory.Although using the same algorithm, the main difference lies in the use of different data, namely clothing sales data from the city of Bengkulu.The purpose of this study is to find combinations of goods so that store owners know the right placement of goods and analyze itemsets to obtain association rules using apriori and FP-Growth algorithms.

II. RESEARCH METHOD
This research stage begins with a literature review and then data acquisition is carried out for processing.Next, analyze by implementing the apriori algorithm and FP-Growth in goods control.The research flow can be seen in Fig. 1.

A. Literature Study
The study of literature is a relatively simple research method, but it is very important in this process of ISSN: 2085-3688; e-ISSN: 2460-0997 Implementation of association rule using apriori algorithm and frequent pattern growth for inventory control inquiry.This method involves collecting data from various literature sources, such as journals, books, papers, theses, theses, and related research articles.Data collection is done by reading, recording, and processing information from these sources.The process of data analysis in literature studies begins with evaluating the most relevant and current scientific work with this research.The selection of literature starts from the latest and passes on to the older ones.Any previous research relevant to this topic will be summarized to evaluate the alignment of the issues raised with the issues studied in this study.An important and relevant part of the research problem is also considered.By referring to the relevant literature, this research can design a system that can be used for inventory control based on the association rule method with apriori algorithm and FP-Growth.

B. Data Acquisition
Data acquisition, the process of collecting data from various sources, holds significant benefits in various contexts.Firstly, data acquisition provides essential information needed for making informed decisions, be it in business, research, or scientific fields.Furthermore, the data gathered can be used for monitoring the performance of systems, devices, or processes, as well as for analysis and pattern discovery that can help identify trends, weaknesses, opportunities, and threats.Data acquisition also plays a crucial role in scientific research, where the obtained data is used to support or refute hypotheses, identify trends, and draw scientific conclusions.In business, data acquired through acquisition can be used to optimize processes, reduce costs, and enhance quality.It also supports better decision-making, reducing uncertainty in the decision-making process.Additionally, data acquisition fuels the development of intelligent systems such as artificial intelligence (AI) and machine learning, which are used for classification, prediction, and pattern recognition.The collected data is also employed for security purposes, detecting anomalies, and developing products that better match customer needs.Data acquisition also has a role in compliance and audit, used to track and verify adherence to applicable regulations and standards.Thus, data acquisition is a key step in optimizing various aspects of life and business.
The clothing data acquisition process begins with the request submission stage which aims to obtain a complete copy of sales data from the cash register system.This data includes all clothing sales transactions recorded in the period from February 1 to March 31, 2023.During that period, this data will include detailed information about each transaction, including details about products sold, number of items recorded, and total transactions.This data will be the basis for a more in-depth analysis, allowing the owner of the figure to understand sales trends, manage inventory, and evaluate sales performance.The following item names in the GalleryNCA store are shown in Table 1.

C. Preprocessing
Before data can be processed with apriori and FP-Growth algorithms, a crucial first step is to preprocess the data.Pre-processing includes two main stages, namely cleaning and data transformation.The cleaning phase includes deleting invalid data, grouping missing values, or handling outlier data to ensure good data quality.In addition, the data transformation stage includes changing the data format, normalization, or encoding categorical data to numerical form so that it can be used by the algorithm.By careful preprocessing, the data will be more readily used by apriori and FP-Growth algorithms, resulting in more accurate and informative analysis results.Thus, preprocessing data becomes an important step in the process of extracting association patterns and analyzing itemsets.

D. Analysis
This study conducts process analysis using data mining methodology by applying apriori and FP-Growth algorithms to determine the frequent itemset that will be used as a basis in formulating the best rules or recommendations in purchasing goods.

1) Stages of implementation of apriori algorithm
The first step in forming association rules is to determine the minimum value of support to get high frequency.The higher the support value, the more often the itemset appears, and this can be useful information Jurnal Infotel, Vol. 15, No. 4, November 2023 https://doi.org/10.20895/infotel.v15i4.980 ISSN: 2085-3688; e-ISSN: 2460-0997 Implementation of association rule using apriori algorithm and frequent pattern growth for inventory control in association analysis, in which case the researcher sets the minimum support value at 0.2 % with (1).
The formula is used to measure the extent to which the itemset or element (A) appears in a dataset transaction.Data that has met the support set of frequently occurring items is merged, and the set of non-conforming items will be eliminated, and the set that meets will be used in iterations.The second step is to search for 2-itemset.The value of the 2-itemset is calculated using (2).
The value containing A and B is the value of the two items of goods in the transaction, dividing the value containing A and B by the total amount of all transactions.The third step 3-itemset support value is obtained using (3).
Confidence is one of the important aspects of association analysis, which is used to measure the extent to which an association or association rule applies.In this context, we will understand how strong the relationship between two itemsets, namely A and B or A, B and C. Confidence, measured in percentages, gives an idea of how often itemset B appears in transactions that also contain itemset A or how often Item C appears in transactions that also contain items A and B, in this study the minimum value of confidence has been set at (0.8 %) To determine the value of confidence, it is obtained using (4).
N umber of T ransactions A and B N umber of T ransactions A × 100% (4)

2) Stages of FP-Growth algorithm implementation
The search for associations using the FP-Growth method is a development of apriori algorithms.In the FP-Growth algorithm, confidence and support values are applied similarly to apriori, but the difference lies in the more efficient approach used by FP-Growth.FP-Growth reduces complexity by involving only one iteration through a dataset of transactions, in contrast to apriori which requires multiple iterations.FP-Growth implements three main stages: • Conditional pattern base generation phase: At this stage, FP-Growth identifies patterns that appear repeatedly in the transaction dataset.
• Conditional FP-Tree development phase: FP-Growth builds a data structure known as a conditional FP-Tree.This structure describes the relationship between itemsets that appear together in a transaction.• Frequent itemset search phase by utilizing TID (Transaction Identity): In this stage, FP-Growth uses the conditional FP-Tree that has been built to efficiently generate frequent itemset.This includes the calculation of support and confidence values.

E. Evaluation
Association analysis is the validity of a rule determined using the lift ratio method.Lift ratio is a common indicator used to determine whether an association rule is considered valid or not.An association rule is considered valid when the lift ratio value in the rule exceeds 1, and the higher the lift ratio value, the stronger the rule.In apriori and FP-Growth algorithms, lift ratio is used to evaluate the strength of the association rule found to calculate lift ratio can use (5).

III. RESULT
This section discusses research data, pre-processing, apriori implementation, and FP-Growth implementation.

A. Research Data
Data collection in this study was carried out through clothing sales transactions recorded in the form of shopping receipts.Every time a customer makes a purchase of clothes in the store, the information recorded in the shopping receipt includes details such as the type of clothes purchased, the number of items, the transaction number.The data used was 140 transactions and 57 items of goods which were sales samples at the GalerryNca store in Bengkulu City.Transaction dataset in tabular form as in Table 2.
Table 2 is a dataset of goods transactions, the name of the goods has been changed to initials.To find out the full name of each item, refer to Table 1.

B. Pre-processing
The data processing process is carried out with the aim of finding patterns of similarity of purchased goods based on daily purchase report data.Sales report data every day at first is just ordinary information then after processing it will be very useful information for future business progress and improvement.Therefore, Jurnal Infotel, Vol. 15 researchers will test the results of using apriori and FP-Growth to determine the relationship between buying patterns.
In the sales data table, the product sold has been processed into a tabular form with binary contents, a value of 1 indicates that the product has been sold, while a value of 0 indicates that the product has not been sold.The data view can be seen in Table 3. From a tabular format it is easier to know how many items were purchased in each transaction to look for highfrequency patterns by creating a 1-itemset.

C. Apriori Implementation 1) High frequency
The stages of finding a high frequency with a predefined minimum support (0.2 %) using ( 1), the number of transaction items (A) divided by the total number of transactions and multiplied (100 %), items that do not meet the minimum support will be removed and items that meet the minimum support can be seen in Table 4.
2) Minimun support 2-itemset Table 4 displays items that have met the minimum support for 1-itemset then a calculation will be carried out with 2-itemset where items are purchased simultaneously in one transaction as many as 2 items (A and B) with the same minimum support provisions (0.2 %).The calculation results using (2) are shown in Table 5.After getting the result of the 2-itemset then proceed to look for a combination of 3-itemset.
3) Minimum Support 3-itemset Results Transaction data with 2-itemset shown in Table 4 that has met the minimum support value will be continued with the calculation of 3-itemset, by calculating transactions of items A, B, and C with (3) display the results of the 3-itemset calculation in Table 6.From the results of the calculation of the minimum Support 3-itemset, then the determination of association rules will be carried out from 2-itemset and 3-itemset data that meet the minimum value of support and minimum confidence.

4) Apriori association rules
The association rule is obtained by calculating using (4) based on the results of the 2-itemset value that satisfies the support and confidence values, the results can be seen in Table 7.
A total of 16 2-itemset association rules are obtained from the minimum support and minimum confidence values that have been determined.Furthermore, the results of the association rule with the 3-itemset are shown in Table 8.Based on the results of the analysis, 24 associations rules 3-itemset were obtained.

D. FP-Growth Implementation 1) Creation of FP-Tree trees
From data that has met the minimum value of high-frequency support.Then the items are sorted by priority as seen from the largest frequency value, sorted according to priority as shown in Table 9. Next, the data that has been sorted by priority will be formed into an FP-Tree tree.It starts from Null and will be followed by an itemset in the transaction until all transactions form a tree as shown in Fig. 2. 2) Generating conditional pattern base At this stage, the FP-Growth algorithm will break down the FP-Tree results in Fig. 2 based on each suffix and produce as mentioned in Table 9, and the item names will be used as code for the next step sorted from small to largest.

3) Generating conditional FP-Tree
To find the conditional FP-Tree, the step is to sum the number of existing supports, and the larger number of supports will replace them with the conditional FP-Tree.The support count is the number of occurrences of an itemset in all transactions in the dataset.Itemsets with a larger number of supports are considered more important because they appear more frequently in the Jurnal Infotel, Vol. 15

4) Frequent itemset stages
The next step is to form a Frequent Itemset by combining sets and subsets of the Conditional FP-Tree with items.The results of the frequent itemset stage can be seen in Table 12, which is a collection of frequently occurring items that meet the minimum support value of Conditional FP-Tree.The result of frequent items will be found as the minimum value of support using the set of 2 items and the set of 3 items.To find the support value for a set of 2 items using (2), and for a set of 3 items using (3), the results of finding the support value for the 2-Itemset are shown in Table 13.
After a combination of 2-itemset.Furthermore, the combined analysis results of the 2-itemset will proceed to find the relationship with the 3-itemset set before calculating the association rules to be used in decision making by retail owners or related parties, then the results of the 3-itemset calculation are shown in Table 14.The FP-Growth method can be used in determining the choice of product item pairs.The algorithm focuses on providing a choice of product item pairs based on the results of sales transactions, generating association rules.

5) FP-Growth association rules
From the results of itemsets that often appear, the association rules will be formed using (4) so as to produce trust values that can be used in decision making by store owners, the results of association rules with 2-itemsets are shown in Table 15.After calculation, 24 association rules were found for the 3-itemset of the dataset used.Furthermore, as an evaluation of the two algorithms, a lift ratio calculation will be carried out to determine the extent to which the rules are relevant to the existing data.The lift ratio is a useful metric to measure the extent to which an association is stronger than what is expected.Thus, an evaluation with a lift ratio will help determine whether the association rules found are really meaningful and can be used in further decision-making.

IV. DISCUSSION
The calculations that have been carried out using apriori and FP-Growth algorithms aim to identify the rules of significant associations.Furthermore, for the evaluation of the association rules that have been found, the calculation of the lift ratio value will be carried out using (5).The use of lift ratio as an evaluation metric in association analysis is based on fundamental scientific considerations, namely, to measure the accuracy and significance of relationships between items in association rules.The results of calculating the lift ratio for the 2-itemset are shown in Table 17.
Results from apriori and FP-Growth algorithms for 2-itemsets show differences and similarities in the association rules found.Both algorithms produce the same number of association rules, which is 16 rules.There is a similarity in the rule with the highest lift ratio, where both find the rule "If you buy BF, then buy BKN" with a lift ratio of 14.In addition, some other rules with a lift ratio of 5 are also found in both algorithms, such as "If Buying STX then buying LK" and "If Buying RI then buying LK".However, differences also exist between the two.In the apriori algorithm, there is only one rule with the highest lift ratio, while in the FP-Growth algorithm there are two rules with the highest lift ratio.However, in the apriori algorithm, the lowest lift ratio is 3, while in the FP-Growth algorithm, there are two rules that get the lowest lift with a value of 2. Furthermore, the calculation of lift values for the 3-itemset hasip is shown in Table 18.
Both algorithms get the same lift ratio value, this shows that both are equally effective in extracting association rules from the same dataset.In this case, the analysis does show that the results of both algorithms are fully consistent, and there is no difference in the rule-associations generated by apriori and FP-Growth.

V. CONCLUSION
Based on the research that has been carried out, it can be concluded by applying a priori algorithm and FP-Growth has succeeded in finding a combination of 2-itemset and 3-itemsets.The results of the 2-itemset analysis found 16 association rules.Meanwhile, 3itemsets get 24 association rules.This can be able to help store owners place goods according to the criteria of the item.

Table 1 .
The Name of the Item in the GalleryNCA Store

Table 10 .
Conditional Pattern Base

Table 11 .
The result of the Conditional FP-Tree is determined by the calculation of items that meet the minimum support requirements in the conditional pattern base.