TD_FunctionFit Function Example | Teradata Vantage - TD_FunctionFit Example - Teradata® Database

Database Analytic Functions

Product
Teradata® Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-28
dita:mapPath
Teradata_Vantage™___Advanced_SQL_Engine_Analytic_Functions.withLogo_upload_July2021/wnd1589838592459.ditamap
dita:ditavalPath
Teradata_Vantage™___Advanced_SQL_Engine_Analytic_Functions.withLogo_upload_July2021/ayr1485454803741.ditaval
dita:id
B035-1206
lifecycle
previous
Product Category
Teradata Vantage™

Input

Every complete example in this document is available in a zip file that you can download. The zip file includes a SQL script file that creates the input tables for the examples. If you are reading this document on https://docs.teradata.com/, you can download the zip file from the attachment in the left sidebar.

InputTable: function_input_table
passenger survived pclass name                                                sex    age sibsp parch ticket           fare         cabin embarked 
 --------- -------- ------ --------------------------------------------------- ------ --- ----- ----- ---------------- ------------ ----- -------- 
         1        0      3 Braund; Mr. Owen Harris                             male    22     1     0 A/5 21171         7.250000000       S       
         2        1      1 Cumings; Mrs. John Bradley (Florence Briggs Thayer) female  38     1     0 PC 17599         71.283300000 C85   C       
         3        1      3 Heikkinen; Miss. Laina                              female  26     0     0 STON/O2. 3101282  7.925000000       S       
         4        1      1 Futrelle; Mrs. Jacques Heath (Lily May Peel)        female  35     1     0 113803           53.100000000 C123  S       
         5        0      3 Allen; Mr. William Henry                            male    35     0     0 373450            8.050000000       S       

SQL Call

CREATE TABLE fit_out AS (
  SELECT * FROM TD_FunctionFit (
    ON function_input_table AS InputTable
    ON transformations AS TransformationTable DIMENSION
  ) AS dt
) WITH DATA;

Output

TargetColumn Transformation Parameters      Defaultvalue 
 ------------ -------------- --------------- ------------ 
 age          LOG            {"base":2}       0.000000000
 fare         POW            {"exponent": 2} 10.000000000