TD_OutlierFilterFit Function Example | Teradata Vantage - TD_OutlierFilterFit 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™

InputTable: titanic

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.

passenger pclass fare         survived 
 --------- ------ ------------ -------- 
         1      3  7.250000000        0
         2      1 71.283300000        1
         3      3  7.925000000        1
         4      1 53.100000000        1
         5      3  8.050000000        0

SQL Call

CREATE TABLE outlier_fit AS (
  SELECT * FROM TD_OutlierFilterFit (
    ON titanic AS InputTable
    USING
    TargetColumns ('Fare')
    LowerPercentile (0.1)
    UpperPercentile (0.9)
    OutlierMethod ('Percentile')
    ReplacementValue ('median')
    PercentileMethod ('PercentileCont')
  ) AS dt
) WITH DATA;

Output

TD_OUTLIERMETHOD_OFTFIT TD_IQRMULTIPLIER_OFTFIT TD_REMOVETAIL_OFTFIT TD_REPLACEMENTVALUE_OFTFIT TD_MINTHRESHOLD_OFTFIT TD_MAXTHRESHOLD_OFTFIT TD_ATTRIBUTEVALUE_OFTFIT TD_COUNTVALUE_OFTFIT TD_MEDIANVALUE_OFTFIT TD_LOWERPERCENTILE_OFTFIT TD_UPPERPERCENTILE_OFTFIT 
 ----------------------- ----------------------- -------------------- -------------------------- ---------------------- ---------------------- ------------------------ -------------------- --------------------- ------------------------- ------------------------- 
 PERCENTILE                          1.500000000 BOTH                 MEDIAN                                0.100000000            0.900000000 fare                                        5           8.050000000               7.520000000              64.009980000