2.1.0
User Documentation for Apache MADlib
assoc_rules.sql_in File Reference

The assoc_rules function computes association rules for a given set of data. The data is assumed to have two dimensions; items (between which we are trying to discover associations), and a transaction id. This tranaction id groups the items by event and could also be a user id, date, etc. depending on the context of the data. This function assumes the data is stored in two columns with one transaction id and one item per row. More...

Functions

set< text[]> gen_rules_from_cfp (text, int, int, int)
 
assoc_rules_results assoc_rules (float8 support, float8 confidence, text tid_col, text item_col, text input_table, text output_schema, boolean verbose, integer max_itemset_size, integer max_lhs_size, integer max_rhs_size)
 
assoc_rules_results assoc_rules (float8 support, float8 confidence, text tid_col, text item_col, text input_table, text output_schema, boolean verbose, integer max_itemset_size, integer max_lhs_size)
 
assoc_rules_results assoc_rules (float8 support, float8 confidence, text tid_col, text item_col, text input_table, text output_schema, boolean verbose, integer max_itemset_size)
 
assoc_rules_results assoc_rules (float8 support, float8 confidence, text tid_col, text item_col, text input_table, text output_schema)
 The short form of the above function with vobose removed. More...
 
assoc_rules_results assoc_rules (float8 support, float8 confidence, text tid_col, text item_col, text input_table, text output_schema, boolean verbose)
 
text assoc_rules (text message)
 
text assoc_rules ()
 

Detailed Description

Date
June 2011
August 2012
See also
For a brief introduction to the association rules implementation, see the module description Apriori Algorithm.

Function Documentation

◆ assoc_rules() [1/7]

assoc_rules_results assoc_rules ( float8  support,
float8  confidence,
text  tid_col,
text  item_col,
text  input_table,
text  output_schema,
boolean  verbose,
integer  max_itemset_size,
integer  max_lhs_size,
integer  max_rhs_size 
)
Parameters
supportminimum level of support needed for each itemset to be included in result
confidenceminimum level of confidence needed for each rule to be included in result
tid_colname of the column storing the transaction ids
item_colname of the column storing the products
input_tablename of the table where the data is stored
output_schemaname of the schema where the final results will be stored
verbosedetermining if output contains comments
Returns
The schema and table name containing association rules, and total number of rules found.

This function computes the association rules between products in a data set. It reads the name of the table, the column names of the product and ids, and computes ssociation rules using the Apriori algorithm, and subject to the support and confidence constraints as input by the user. This version of association rules has verbose functionality. When verbose is true, output of function includes iteration steps and comments on Apriori algorithm steps.

◆ assoc_rules() [2/7]

assoc_rules_results assoc_rules ( float8  support,
float8  confidence,
text  tid_col,
text  item_col,
text  input_table,
text  output_schema,
boolean  verbose,
integer  max_itemset_size,
integer  max_lhs_size 
)

◆ assoc_rules() [3/7]

assoc_rules_results assoc_rules ( float8  support,
float8  confidence,
text  tid_col,
text  item_col,
text  input_table,
text  output_schema,
boolean  verbose,
integer  max_itemset_size 
)

◆ assoc_rules() [4/7]

assoc_rules_results assoc_rules ( float8  support,
float8  confidence,
text  tid_col,
text  item_col,
text  input_table,
text  output_schema 
)

◆ assoc_rules() [5/7]

assoc_rules_results assoc_rules ( float8  support,
float8  confidence,
text  tid_col,
text  item_col,
text  input_table,
text  output_schema,
boolean  verbose 
)

◆ assoc_rules() [6/7]

text assoc_rules ( text  message)

◆ assoc_rules() [7/7]

text assoc_rules ( )

◆ gen_rules_from_cfp()

set<text[]> gen_rules_from_cfp ( text  ,
int  ,
int  ,
int   
)