TD_SimpleImputeFit Example | SimpleImputeFit | Teradata Vantage - Example: How to Use TD_SimpleImputeFit - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

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.

TD_SimpleImputeFit InputTable: simpleimputefit_input

passenger pclass   gender  fare     survived 
 --------- ------  ------  -------  -------- 
         1      3  male    725.320         0
         2      1  female  712.250         1
         3   null  female     null         1
         4      1  null    531.780         1
         5      3  male    805.210         0

TD_SimpleImputeFit SQL Call

CREATE TABLE fit_table AS (
  SELECT * FROM TD_SimpleImputeFit (
    ON simpleimputefit_input AS InputTable
    USING
    ColsForLiterals ('Pclass')
    Literals ('2')
    ColsForStats ('Gender','Fare')
    Stats ('mode','median')
  ) AS dt
) WITH DATA;

TD_SimpleImputeFit Output

TD_INDEX_SIMFIT  TD_TARGETCOLUMN_SIMFIT  TD_NUM_COLVAL_SIMFIT  TD_STR_COLVAL_SIMFIT   TD_ISNUMERIC_SIMFIT 
---------------  ----------------------  --------------------  --------------------   -------------------
              1   pclass                               2.000                  null                     1
              2   gender                                null                  male                     0
              3   fare                               718.785                  null                     1