CFilter Example: Filter by Customer Segment - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
8.10
1.1
Published
October 2019
Language
English (United States)
Last Update
2019-12-31
dita:mapPath
ima1540829771750.ditamap
dita:ditavalPath
jsj1481748799576.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantageā„¢

In this example, JoinColumns = 'product'. The function tries to identify segments of customers that often purchase the same products.

Input

SQL Call

SELECT * FROM CFilter (
  ON sales_transaction AS InputTable
  OUT TABLE OutputTable (cfilter_output1)
  USING
  TargetColumns ('customer_segment')
  JoinColumns ('product')
) AS dt;

Output

              message              
-----------------------------------
 Output table created successfully
(1 row)
SELECT * FROM cfilter_output1;
 col1_item1     col1_item2     cntb cnt1 cnt2 score              support            confidence         lift   z_score             
 -------------- -------------- ---- ---- ---- ------------------ ------------------ ------------------ ------ ------------------- 
 corporate      small business   17   17   17                1.0                1.0                1.0    1.0  1.3728129459672886
 home office    small business   16   16   17 0.9411764705882353 0.9411764705882353                1.0    1.0  0.7844645405527365
 consumer       small business   13   13   17 0.7647058823529411 0.7647058823529411                1.0    1.0 -0.9805806756909198
 home office    consumer         13   16   13             0.8125 0.7647058823529411             0.8125 1.0625 -0.9805806756909198
 consumer       corporate        13   13   17 0.7647058823529411 0.7647058823529411                1.0    1.0 -0.9805806756909198
 small business corporate        17   17   17                1.0                1.0                1.0    1.0  1.3728129459672886
 corporate      home office      16   17   16 0.9411764705882353 0.9411764705882353 0.9411764705882353    1.0  0.7844645405527365
 small business home office      16   17   16 0.9411764705882353 0.9411764705882353 0.9411764705882353    1.0  0.7844645405527365
 corporate      consumer         13   17   13 0.7647058823529411 0.7647058823529411 0.7647058823529411    1.0 -0.9805806756909198
 small business consumer         13   17   13 0.7647058823529411 0.7647058823529411 0.7647058823529411    1.0 -0.9805806756909198
 consumer       home office      13   13   16             0.8125 0.7647058823529411                1.0 1.0625 -0.9805806756909198
 home office    corporate        16   16   17 0.9411764705882353 0.9411764705882353                1.0    1.0  0.7844645405527365

Download a zip file of all examples and a SQL script file that creates their input tables from the attachment in the left sidebar.