The fism action applies the FP-growth algorithm to identify frequent item sets within a transaction data table. It calculates the frequency (support) of item combinations, which is a fundamental step in association rule mining (e.g., market basket analysis). It allows filtering by support count or percentage and defining the size range of item sets to discover.
| Parameter | Description |
|---|---|
| idVariable | Specifies the variable that groups the target variable into baskets or transactions (e.g., Transaction ID). |
| tgtVariable | Specifies the target variable containing the items to be analyzed (e.g., Product Name). |
| table | Specifies the input data table containing the transactions. |
| suppct | Specifies the minimum level of support as a percentage of the total number of baskets. Item sets occurring less frequently than this are ignored. |
| supmin | Specifies the minimum level of support as an absolute count. Overrides suppct if specified. |
| nFis_Range | Specifies the range (lower and upper bounds) for the number of items in a frequent item set. |
| out | Specifies the output table to contain the discovered frequent item sets, their transaction counts, and support. |
| outFreq | Specifies the output table to contain the unique frequent items along with their counts. |
| items | Specifies the number of items in a rule. Default is 2 when output tables are specified, otherwise 1. |
Creates a dataset 'transactions' representing customer purchases, where 'TransID' identifies the basket and 'Item' identifies the product.
| 1 | DATA casuser.transactions; LENGTH Item $10; INPUT TransID Item $; DATALINES; |
| 2 | 1 Apple |
| 3 | 1 Banana |
| 4 | 1 Milk |
| 5 | 2 Apple |
| 6 | 2 Banana |
| 7 | 3 Apple |
| 8 | 3 Milk |
| 9 | 3 Bread |
| 10 | 4 Banana |
| 11 | 4 Milk |
| 12 | ; RUN; |
| 13 | |
| 14 | PROC CASUTIL; load DATA=casuser.transactions casout="transactions" outcaslib="casuser" replace; RUN; |
Identifies frequent item sets with a minimum support of 50%.
| 1 | |
| 2 | PROC CAS; |
| 3 | ruleMining.fism / TABLE={name="transactions", caslib="casuser"} idVariable="TransID" tgtVariable="Item" suppct=50; |
| 4 | |
| 5 | RUN; |
| 6 |
Mines for item sets containing between 2 and 3 items, with a minimum support count of 2, and saves the results to CAS tables.
| 1 | |
| 2 | PROC CAS; |
| 3 | ruleMining.fism / TABLE={name="transactions", caslib="casuser"} idVariable="TransID" tgtVariable="Item" supmin=2 nFis_Range={lower=2, upper=3} out={name="fism_sets", caslib="casuser", replace=true} outFreq={name="fism_freq", caslib="casuser", replace=true}; |
| 4 | |
| 5 | RUN; |
| 6 | |
| 7 | PROC CAS; |
| 8 | TABLE.fetch / TABLE={name="fism_sets", caslib="casuser"}; |
| 9 | |
| 10 | RUN; |
| 11 |