1.0 - 8.00 - FrequentPaths Example 3: GroupByColumns - Teradata Vantage

Teradata® Vantage Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.0
8.00
Release Date
May 2019
Content Type
Programming Reference
Publication ID
B700-4003-098K
Language
English (United States)

Input

InputTable: bank_web_clicks2
customer_id session_id page datestamp
529 0 ACCOUNT SUMMARY 2004-03-17 16:35:00
529 0 FAQ 2004-03-17 16:38:00
529 0 ACCOUNT HISTORY 2004-03-17 16:42:00
529 0 FUNDS TRANSFER 2004-03-17 16:45:00
529 0 ONLINE STATEMENT ENROLLMENT 2004-03-17 16:49:00
529 0 PROFILE UPDATE 2004-03-17 16:50:00
529 0 ACCOUNT SUMMARY 2004-03-17 16:51:00
529 0 CUSTOMER SUPPORT 2004-03-17 16:53:00
529 0 VIEW DEPOSIT DETAILS 2004-03-17 16:57:00
529 1 ACCOUNT SUMMARY 2004-03-18 01:16:00
529 1 ACCOUNT SUMMARY 2004-03-18 01:18:00
529 1 FAQ 2004-03-18 01:20:00
529 1 ACCOUNT SUMMARY 2004-03-18 01:21:00
529 1 FUNDS TRANSFER 2004-03-18 01:24:00
529 1 ACCOUNT HISTORY 2004-03-18 01:25:00
529 1 VIEW DEPOSIT DETAILS 2004-03-18 01:27:00
529 1 ACCOUNT SUMMARY 2004-03-18 01:27:00
529 1 ACCOUNT HISTORY 2004-03-18 01:28:00
... ... ... ...

SQL Call

SELECT * FROM FrequentPaths (
  ON bank_web_clicks2 AS InputTable
  OUT TABLE OutputTable (output3)
  USING
  PartitionColumns ('session_id')
  GroupByColumns ('customer_id')
  TimeColumn ('datestamp')
  ItemColumn ('page')
  MinSupport (2)
) AS dt;

Output

message
Finished. Totally 213 patterns were found.

This query returns the following table:

SELECT * FROM output3 ORDER BY 4, 3 DESC, 2 DESC, 1;
                                              pattern                             | support | length | customer_id 
---------------------------------------------------------------------------------------------------+------
 ACCOUNT SUMMARY;ACCOUNT SUMMARY;ACCOUNT SUMMARY;ACCOUNT HISTORY;ACCOUNT SUMMARY  |       2 |      5 | 529
 ACCOUNT SUMMARY;ACCOUNT SUMMARY;FAQ;ACCOUNT SUMMARY;ACCOUNT SUMMARY              |       2 |      5 | 529
 ACCOUNT SUMMARY;ACCOUNT SUMMARY;ACCOUNT HISTORY;ACCOUNT SUMMARY                  |       3 |      4 | 529
 ACCOUNT SUMMARY;ACCOUNT SUMMARY;ACCOUNT SUMMARY;ACCOUNT SUMMARY                  |       3 |      4 | 529
 ACCOUNT SUMMARY;ACCOUNT HISTORY;ACCOUNT SUMMARY;ACCOUNT HISTORY                  |       2 |      4 | 529
 ACCOUNT SUMMARY;ACCOUNT HISTORY;ACCOUNT SUMMARY;FAQ                              |       2 |      4 | 529
 ACCOUNT SUMMARY;ACCOUNT SUMMARY;ACCOUNT HISTORY;FAQ                              |       2 |      4 | 529
 ACCOUNT SUMMARY;ACCOUNT SUMMARY;ACCOUNT SUMMARY;ACCOUNT HISTORY                  |       2 |      4 | 529
 ACCOUNT SUMMARY;ACCOUNT SUMMARY;ACCOUNT SUMMARY;FUNDS TRANSFER                   |       2 |      4 | 529
 ACCOUNT SUMMARY;ACCOUNT SUMMARY;FAQ;ACCOUNT SUMMARY                              |       2 |      4 | 529
 ACCOUNT SUMMARY;FAQ;ACCOUNT HISTORY;ACCOUNT SUMMARY                              |       2 |      4 | 529
 ACCOUNT SUMMARY;FAQ;ACCOUNT HISTORY;VIEW DEPOSIT DETAILS                         |       2 |      4 | 529
 ACCOUNT SUMMARY;FAQ;ACCOUNT SUMMARY;ACCOUNT SUMMARY                              |       2 |      4 | 529
 ACCOUNT SUMMARY;FAQ;ACCOUNT SUMMARY;VIEW DEPOSIT DETAILS                         |       2 |      4 | 529
 ACCOUNT SUMMARY;FAQ;FUNDS TRANSFER;ACCOUNT SUMMARY                               |       2 |      4 | 529
  …										     …		…    …

(Row order can vary.)