SAX Example: Sliding Window, Bitmap Output | Teradata Vantage - SAX Example: Sliding Window, Bitmap Output - 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 SAX (
  ON finance_data3 PARTITION BY id ORDER BY period
  USING
  TargetColumns ('expenditure', 'income', 'investment')
  TimeColumn ('period')
  OutputType ('bitmap')
  BitmapLevel (1) 
  WindowType ('sliding')
  WindowSize (20)
  Accumulate ('id')
) AS dt;

Output

 id period_start period_end expenditure_bitmap                   income_bitmap                        investment_bitmap                    
 -- ------------ ---------- ------------------------------------ ------------------------------------ ------------------------------------ 
  1 1960q1       1969q4     {"a":0.81,"b":1.0,"c":0.55,"d":0.87} {"a":0.79,"b":1.0,"c":0.54,"d":0.87} {"a":0.72,"b":1.0,"c":0.52,"d":0.9} 
  2 1970q1       1979q4     {"a":1.0,"b":0.98,"c":0.53,"d":0.93} {"a":1.0,"b":0.95,"c":0.52,"d":0.91} {"a":0.83,"b":1.0,"c":0.83,"d":0.79}
  3 1980q1       1982q4     {"a":0.0,"b":0.0,"c":0.0,"d":0.0}    {"a":0.0,"b":0.0,"c":0.0,"d":0.0}    {"a":0.0,"b":0.0,"c":0.0,"d":0.0}

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