All Inclusive Example for Variable Transformation

In-Database Analytic Functions User Guide

brand
Software
prodname
Teradata Warehouse Miner
vrm_release
5.4.2
category
User Guide
featnum
B035-2306-106K

The following is an example combining all of the transformation types in one request (separated by semi-colons), with multiple variations of most transformation types (enclosed in braces {}).

call twm.td_analyze('vartran','database=twm_source;tablename=twm_customer;keycolumns=cust_id;

retain=columns(cust_id);

bincode=

{binstyle(bins,3),columns(income/inc1)}
{binstyle(bins,4),columns(income/inc2)}
{binstyle(bins,5),columns(income/inc3)};

derive=

{formula(''x/10''),arguments(age),outputname(age1)}
{formula(x*10),arguments(age),outputname(age2)}
{formula(x+10),arguments(age),outputname(age3)};

designcode=

{designstyle(dummycode),designvalues(M,F),columns(gender)}
{designstyle(dummycode),designvalues(1,2,3,4),columns(marital_status)};

nullreplacement=

{nullstyle(literal,0),columns(street_nbr)}
{nullstyle(mean),columns(street_nbr/street_nbr2)};

recode=

{recodevalues(1/S,2/M,3/S,4/S),recodeother(SAME),columns(marital_status/mar1)}
{recodevalues(1/B,2/A,3/B,4/B),recodeother(NULL),columns(marital_status/mar2)};

rescale=

{rescalebounds(lowerbound/0,upperbound/100),columns(age/age4)}
{rescalebounds(lowerbound/0),columns(age/age5)}
{rescalebounds(upperbound/100),columns(age/age6)};

sigmoid=

{sigmoidstyle(logit),columns(nbr_children/nbr1)}
{sigmoidstyle(modifiedlogit),columns(nbr_children/nbr2)}
{sigmoidstyle(tanh),columns(nbr_children/nbr3)};

zscore=columns(years_with_bank);

');