1.0 - 8.00 - FrequentPaths Example 1: ItemColumn - 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

The input table has web clickstream data from a set of users with multiple sessions or sequences.

InputTable: bank_web_clicks1
session_id page datestamp
0 ACCOUNT SUMMARY 2004-03-17 16:35:00
0 FAQ 2004-03-17 16:38:00
0 ACCOUNT HISTORY 2004-03-17 16:42:00
0 FUNDS TRANSFER 2004-03-17 16:45:00
0 ONLINE STATEMENT ENROLLMENT 2004-03-17 16:49:00
0 PROFILE UPDATE 2004-03-17 16:50:00
0 ACCOUNT SUMMARY 2004-03-17 16:51:00
0 CUSTOMER SUPPORT 2004-03-17 16:53:00
0 VIEW DEPOSIT DETAILS 2004-03-17 16:57:00
1 ACCOUNT SUMMARY 2004-03-18 01:16:00
1 ACCOUNT SUMMARY 2004-03-18 01:18:00
1 FAQ 2004-03-18 01:20:00
1 ACCOUNT SUMMARY 2004-03-18 01:21:00
1 FUNDS TRANSFER 2004-03-18 01:24:00
1 ACCOUNT HISTORY 2004-03-18 01:25:00
1 VIEW DEPOSIT DETAILS 2004-03-18 01:27:00
1 ACCOUNT SUMMARY 2004-03-18 01:27:00
1 ACCOUNT HISTORY 2004-03-18 01:28:00
2 ACCOUNT SUMMARY 2004-03-18 09:22:00
2 ACCOUNT SUMMARY 2004-03-18 09:23:00
2 ACCOUNT SUMMARY 2004-03-18 09:25:00
2 ACCOUNT HISTORY 2004-03-18 09:27:00
2 FUNDS TRANSFER 2004-03-18 09:31:00
2 ACCOUNT SUMMARY 2004-03-18 09:31:00
2 FAQ 2004-03-18 09:33:00
2 FAQ 2004-03-18 09:36:00
3 ACCOUNT SUMMARY 2004-03-18 22:41:00
3 ACCOUNT HISTORY 2004-03-18 22:45:00
3 ACCOUNT SUMMARY 2004-03-18 22:47:00
3 ACCOUNT HISTORY 2004-03-18 22:49:00
3 FAQ 2004-03-18 22:50:00
3 ACCOUNT SUMMARY 2004-03-18 22:53:00
3 ACCOUNT SUMMARY 2004-03-18 22:55:00
4 ACCOUNT SUMMARY 2004-03-19 08:33:00
4 FAQ 2004-03-19 08:36:00
4 VIEW DEPOSIT DETAILS 2004-03-19 08:38:00
4 FAQ 2004-03-19 08:41:00
5 ACCOUNT SUMMARY 2004-03-19 10:06:00
5 FUNDS TRANSFER 2004-03-19 10:09:00
5 VIEW DEPOSIT DETAILS 2004-03-19 10:11:00
5 VIEW DEPOSIT DETAILS 2004-03-19 10:13:00
5 ACCOUNT HISTORY 2004-03-19 10:14:00

SQL Call

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

Output

message
Finished. Totally 69 patterns were found.

This query returns the following table:

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