Attribution_MLE Example (Single Input): Unused Segment Windows - 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ā„¢

This example uses the single-input Attribution_MLE function.

Input

SQL Call

SELECT * FROM Attribution_MLE (
  ON attribution_sample_table3 PARTITION BY user_id
    ORDER BY time_stamp
  USING
  EventColumn ('event')
  ConversionEvents ('socialnetwork', 'paidsearch')
  TimeColumn ('time_stamp')
  WindowSize ('rows:10&seconds:20')
  
  FirstModel ('SEGMENT_ROWS', '3:0.5:EXPONENTIAL:0.5,ROW',
          '4:0.3:WEIGHTED:0.4,0.3,0.2,0.1', '3:0.2:FIRST_CLICK:NA')
  SecondModel ('SEGMENT_SECONDS', '6:0.5:UNIFORM:NA',
          '8:0.3:LAST_CLICK:NA', '6:0.2:FIRST_CLICK:NA')
) AS dt ORDER BY 1, 3;

Output

 user_id event         time_stamp                 attribution        time_to_conversion 
 ------- ------------- -------------------------- ------------------ ------------------ 
       1 impression    2001-09-27 23:00:07.000000                0.0               NULL
       1 impression    2001-09-27 23:00:09.000000                0.0               NULL
       1 impression    2001-09-27 23:00:11.000000                0.0               NULL
       1 impression    2001-09-27 23:00:13.000000              0.375               -8.0
       1 email         2001-09-27 23:00:15.000000 0.2083333283662796               -6.0
       1 impression    2001-09-27 23:00:17.000000 0.2083333283662796               -4.0
       1 impression    2001-09-27 23:00:19.000000 0.2083333283662796               -2.0
       1 socialnetwork 2001-09-27 23:00:21.000000               NULL               NULL
       1 paidsearch    2001-09-27 23:00:23.000000               NULL               NULL
       2 impression    2001-09-27 23:00:29.000000                0.0               NULL
       2 impression    2001-09-27 23:00:31.000000                0.0               NULL
       2 impression    2001-09-27 23:00:33.000000                0.0               NULL
       2 impression    2001-09-27 23:00:47.000000                0.0               NULL
       2 impression    2001-09-27 23:00:51.000000              0.375               -8.0
       2 impression    2001-09-27 23:00:53.000000             0.3125               -6.0
       2 impression    2001-09-27 23:00:55.000000             0.3125               -4.0
       2 socialnetwork 2001-09-27 23:00:59.000000               NULL               NULL

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