imsl.data_mining.frequent_itemsets¶
- frequent_itemsets(max_num_products, x, max_set_size=5, min_pct_support=0.1)¶
Compute the frequent itemsets in a transaction set using Apriori.
Parameters: max_num_products : int
The maximum number of unique items or products that may be present in the transactions.
x : (n, 2) array_like
An array containing the transaction data. The first column of x contains the transaction IDs, and the second column contains the item IDs. Each row represents a transaction ID and item ID pair. The algorithm assumes that an individual transaction is complete within a single data set. That is, there is no matching of transaction IDs between different data sets.
max_set_size : int, optional
The maximum size of an itemset. Only frequent itemsets with max_set_size or fewer items are considered in the analysis.
min_pct_support : float, optional
The minimum percentage of transactions in which an item or itemset must be present to be considered frequent. min_pct_support must be in the interval [0,1].
Returns: FrequentItemSets
An object of type FrequentItemSets containing the frequent itemsets.
See also
- FrequentItemSets
- contains a full description of the Apriori algorithm.