ruleMining

fism

Description

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.

Settings
ParameterDescription
idVariableSpecifies the variable that groups the target variable into baskets or transactions (e.g., Transaction ID).
tgtVariableSpecifies the target variable containing the items to be analyzed (e.g., Product Name).
tableSpecifies the input data table containing the transactions.
suppctSpecifies the minimum level of support as a percentage of the total number of baskets. Item sets occurring less frequently than this are ignored.
supminSpecifies the minimum level of support as an absolute count. Overrides suppct if specified.
nFis_RangeSpecifies the range (lower and upper bounds) for the number of items in a frequent item set.
outSpecifies the output table to contain the discovered frequent item sets, their transaction counts, and support.
outFreqSpecifies the output table to contain the unique frequent items along with their counts.
itemsSpecifies the number of items in a rule. Default is 2 when output tables are specified, otherwise 1.
Data Preparation View data prep sheet
Creation of Market Basket Data

Creates a dataset 'transactions' representing customer purchases, where 'TransID' identifies the basket and 'Item' identifies the product.

Copied!
1DATA casuser.transactions; LENGTH Item $10; INPUT TransID Item $; DATALINES;
21 Apple
31 Banana
41 Milk
52 Apple
62 Banana
73 Apple
83 Milk
93 Bread
104 Banana
114 Milk
12; RUN;
13 
14PROC CASUTIL; load DATA=casuser.transactions casout="transactions" outcaslib="casuser" replace; RUN;

Examples

Identifies frequent item sets with a minimum support of 50%.

SAS® / CAS Code Code awaiting community validation
Copied!
1 
2PROC CAS;
3ruleMining.fism / TABLE={name="transactions", caslib="casuser"} idVariable="TransID" tgtVariable="Item" suppct=50;
4 
5RUN;
6 
Result :
The action returns a result object listing the frequent item sets found (e.g., {Apple, Banana}) and their support, printed to the log.

Mines for item sets containing between 2 and 3 items, with a minimum support count of 2, and saves the results to CAS tables.

SAS® / CAS Code Code awaiting community validation
Copied!
1 
2PROC CAS;
3ruleMining.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 
5RUN;
6 
7PROC CAS;
8TABLE.fetch / TABLE={name="fism_sets", caslib="casuser"};
9 
10RUN;
11 
Result :
Two output tables are created: 'fism_sets' containing the combinations (e.g., Apple & Banana, Apple & Milk) and 'fism_freq' containing individual item counts. The fetch action displays the contents of 'fism_sets'.

FAQ

What is the primary purpose of the fism action?
Which parameter is mandatory to group the target variable into baskets?
How does the `items` parameter function?
How can I restrict the size of the frequent item sets detected?
What data is stored in the table specified by the `out` parameter?
What is the difference between the `out` and `outFreq` parameters?
How do `supmin` and `suppct` differ in defining support?
What is the role of the `tgtVariable` parameter?