1.0 - 8.00 - Single-Input Attribution Example 2: Multiple Regular Models, One Optional Model - 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)

This example specifies one distribution model for each type of regular event and one distribution model for optional events.

SQL Call

SELECT * FROM Attribution@coprocessor (
  ON attribution_sample_table
    PARTITION BY user_id
    ORDER BY time_stamp
  USING
  EventColumn ('event')
  ConversionEvents ('SocialNetwork', 'PaidSearch')
  OptionalEvents ('OrganicSearch', 'Direct', 'Referral')
  TimestampColumn ('time_stamp')   WindowSize ('rows:10&seconds:20')
  Model1 ('EVENT_REGULAR', 'Email:0.19:LAST_CLICK:NA',
          'impression:0.81:UNIFORM:NA')
  Model2 ('EVENT_OPTIONAL', 'ALL:1:EXPONENTIAL:0.5,ROW')
) AS dt;

Output

The only difference between this output and the output of Example 1 is the attribution of the optional events.

user_id event time_stamp attribution time_to_conversion
1 impression 2001-09-27 23:00:01 0.09 -19
1 impression 2001-09-27 23:00:03 0.09 -17
1 impression 2001-09-27 23:00:05 0.09 -15
1 impression 2001-09-27 23:00:07 0.09 -13
1 impression 2001-09-27 23:00:09 0.09 -11
1 impression 2001-09-27 23:00:11 0.09 -9
1 impression 2001-09-27 23:00:13 0.09 -7
1 Email 2001-09-27 23:00:15 0.19 -5
1 impression 2001-09-27 23:00:17 0.09 -3
1 impression 2001-09-27 23:00:19 0.09 -1
1 SocialNetwork 2001-09-27 23:00:20    
1 Direct 2001-09-27 23:00:21 0.333333 -2
1 Referral 2001-09-27 23:00:22 0.666667 -1
1 PaidSearch 2001-09-27 23:00:23    
2 impression 2001-09-27 23:00:29 0  
2 impression 2001-09-27 23:00:31 0  
2 impression 2001-09-27 23:00:33 0  
2 impression 2001-09-27 23:00:36 0  
2 impression 2001-09-27 23:00:38 0  
2 impression 2001-09-27 23:00:43 0.2 -16
2 impression 2001-09-27 23:00:47 0.2 -12
2 impression 2001-09-27 23:00:51 0.2 -8
2 impression 2001-09-27 23:00:53 0.2 -6
2 impression 2001-09-27 23:00:55 0.2 -4
2 SocialNetwork 2001-09-27 23:00:59