TD_FunctionFit Example | FunctionFit | Teradata Vantage - TD_FunctionFit Example - Analytics Database

Database Analytic Functions

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-10-04
dita:mapPath
gjn1627595495337.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
jmh1512506877710
Product Category
Teradata Vantageā„¢

TD_FunctionFit 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                                                gender 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       

TD_FunctionFit 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;

TD_FunctionFit Output

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