1.1 - 8.10 - LinRegPredict Example - Teradata Vantage

Teradata Vantage™ - Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.1
8.10
Release Date
October 2019
Content Type
Programming Reference
Publication ID
B700-4003-079K
Language
English (United States)

Input

  • InputTable: housing_data, as in the Linear Regression Example
  • Model: LinRegModel, is the output of the Linear Regression Example, created as follows:
CREATE MULTISET TABLE LinRegModel AS (
  SELECT * FROM LinReg (
    ON LinRegInternal (
      ON housing_data
    ) AS dt1 PARTITION BY 1
  ) AS dt2
) WITH DATA;

SQL Call

SELECT * FROM LinRegPredict ( 
  ON housing_data AS InputTable PARTITION BY ANY
  ON LinRegModel AS Model DIMENSION
  USING
  InputColumns ('housesize','lotsize','bedrooms','granite','upgradedbathroom')
  Accumulate ('housesize','lotsize','bedrooms','granite','upgradedbathroom')
) AS dt ORDER BY 1;

Output

 housesize lotsize bedrooms granite upgradedbathroom predicted_value    
 --------- ------- -------- ------- ---------------- ------------------ 
      2200    9600        4       0                1 200178.65324449894
      2397   14156        4       1                0   187694.857118394
      2983    9365        5       0                1 221896.99717644157
      3198    9669        5       1                1 225173.25034326705
      3247   10061        5       1                1 226336.77540031952
      3529    9191        6       0                0 207205.14288160563
      3536   19994        6       1                1  325768.3674812864
      4032   10150        5       0                1 198619.20669745357

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