SeriesSplitter Example 2 : Using SeriesSplitter with Interpolator - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
8.00
1.0
Published
May 2019
Language
English (United States)
Last Update
2019-11-22
dita:mapPath
blj1506016597986.ditamap
dita:ditavalPath
blj1506016597986.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantage™
There are two ways to use the SeriesSplitter function with the time series manipulation function Interpolator:
  • Call SeriesSplitter as in SeriesSplitter Example 1: Partition Splitter to create company1_stock_split and then call Interpolator:
    SELECT * FROM Interpolator (
      ON company1_stock1_split AS InputTable
      PARTITION BY id ORDER BY "period"
      USING
      TimeColumn ('period')
      TimeInterval (86400)
      InterpolationType ('linear')
      ValueColumns ('stockprice')
      Accumulate ('id')
      DuplicateRowsCount (2)
    ) AS dt;
  • Combine the calls to SeriesSplitter and Interpolator:
    SELECT * FROM Interpolator (
      ON (SELECT * FROM SeriesSplitter (
        ON company1_stock1 AS InputTable
        OUT TABLE OutputTable (company1_stock1_split)
        USING
        PartitionByColumns ('id')
        OrderByColumns ('period')
        SplitCount (50)
        Accumulate ('stockprice')
        ReturnStatsTable ('false')
        ) AS dt1
      ) AS input_table PARTITION BY id ORDER BY period
      USING
      TimeColumn ('period')
      TimeInterval (86400)
      InterpolationType ('linear')
      ValueColumns ('stockprice')
      Accumulate ('id')
      DuplicateRowsCount (2)
    ) AS dt2;

The first choice performs better than the second choice.