PathAnalyzer Example | Teradata Vantage - PathAnalyzer Example - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
9.02
9.01
2.0
1.3
Published
February 2022
Language
English (United States)
Last Update
2022-02-10
dita:mapPath
rnn1580259159235.ditamap
dita:ditavalPath
ybt1582220416951.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantageā„¢

Input

SQL Call

SELECT * FROM PathAnalyzer(
  ON clickstream1 AS InputTable
  OUT TABLE OutputTable(path_output)
  USING
  SeqColumn('path')
  CountColumn('cnt')
  HashCode('false')
  Delimiter(',')
) AS dt ;

Output

 message                                                                                
 -------------------------------------------------------------------------------------- 
Query executed successfully.
 Output is stored in the table specified in OutputTable argument.

SELECT * FROM path_output ORDER BY node;
 node              parent          children                  subpath_cnt depth partitioned       
 ----------------- --------------- ------------------------- ----------- ----- ----------------- 
 ^                                 [(^,a),(^,c),(^,h),(^,p)]          34     0 ^                
 ^,a               ^               [(^,a,h),(^,a,p)]                  11     1 ^,a              
 ^,a,h             ^,a             [(^,a,h,c),(^,a,h,p)]               5     2 ^,a,h            
 ^,a,h,c           ^,a,h           [(^,a,h,c,$)]                       3     3 ^,a,h,c          
 ^,a,h,p           ^,a,h           [(^,a,h,p,$)]                       2     3 ^,a,h,p          
 ^,a,p             ^,a             [(^,a,p,s)]                         6     2 ^,a,p            
 ^,a,p,s           ^,a,p           [(^,a,p,s,o)]                       6     3 ^,a,p,s          
 ^,c               ^               [(^,c,s)]                           1     1 ^,c              
 ^,c,s             ^,c             [(^,c,s,o)]                         1     2 ^,c,s            
 ^,c,s,o           ^,c,s           [(^,c,s,o,e)]                       1     3 ^,c,s,o          
 ^,c,s,o,e         ^,c,s,o         [(^,c,s,o,e,$)]                     1     4 ^,c,s,o,e        
 ^,h               ^               [(^,h,a),(^,h,c),(^,h,e)]          20     1 ^,h              
 ^,h,a             ^,h             [(^,h,a,c),(^,h,a,p)]               6     2 ^,h,a            
 ^,h,a,c           ^,h,a           [(^,h,a,c,p)]                       4     3 ^,h,a,c          
 ^,h,a,c,p         ^,h,a,c         [(^,h,a,c,p,i)]                     4     4 ^,h,a,c,p        
 ^,h,a,c,p,i       ^,h,a,c,p       [(^,h,a,c,p,i,s)]                   4     5 ^,h,a,c,p,i      
 ^,h,a,c,p,i,s     ^,h,a,c,p,i     [(^,h,a,c,p,i,s,o)]                 4     6 ^,h,a,c,p,i,s    
 ^,h,a,c,p,i,s,o   ^,h,a,c,p,i,s   [(^,h,a,c,p,i,s,o,e)]               4     7 ^,h,a,c,p,i,s,o  
 ^,h,a,c,p,i,s,o,e ^,h,a,c,p,i,s,o [(^,h,a,c,p,i,s,o,e,$)]             4     8 ^,h,a,c,p,i,s,o,e
 ^,h,a,p           ^,h,a           [(^,h,a,p,i)]                       2     3 ^,h,a,p          
 ^,h,a,p,i         ^,h,a,p         [(^,h,a,p,i,s)]                     2     4 ^,h,a,p,i        
 ^,h,a,p,i,s       ^,h,a,p,i       [(^,h,a,p,i,s,o)]                   2     5 ^,h,a,p,i,s      
 ^,h,a,p,i,s,o     ^,h,a,p,i,s     [(^,h,a,p,i,s,o,$)]                 2     6 ^,h,a,p,i,s,o    
 ^,h,c             ^,h             [(^,h,c,h),(^,h,c,p)]              12     2 ^,h,c            
 ^,h,c,h           ^,h,c           [(^,h,c,h,p)]                       7     3 ^,h,c,h          
 ^,h,c,h,p         ^,h,c,h         [(^,h,c,h,p,$)]                     7     4 ^,h,c,h,p        
 ^,h,c,p           ^,h,c           [(^,h,c,p,e)]                       5     3 ^,h,c,p          
 ^,h,c,p,e         ^,h,c,p         [(^,h,c,p,e,$)]                     5     4 ^,h,c,p,e        
 ^,h,e             ^,h             [(^,h,e,$)]                         2     2 ^,h,e            
 ^,p               ^               [(^,p,c)]                           2     1 ^,p              
 ^,p,c             ^,p             [(^,p,c,p)]                         2     2 ^,p,c            
 ^,p,c,p           ^,p,c           [(^,p,c,p,s)]                       2     3 ^,p,c,p          
 ^,p,c,p,s         ^,p,c,p         [(^,p,c,p,s,o)]                     2     4 ^,p,c,p,s        
 ^,p,c,p,s,o       ^,p,c,p,s       [(^,p,c,p,s,o,e)]                   2     5 ^,p,c,p,s,o      
 ^,p,c,p,s,o,e     ^,p,c,p,s,o     [(^,p,c,p,s,o,e,$)]                 2     6 ^,p,c,p,s,o,e

The output table is the same as the PathStart Example output.

Download a zip file of all examples and a SQL script file that creates their input tables.