Teradata In-Database Analytic Functions typically operate in pairs for data transformations. The first function fits the data and generates the required parameters. The second function uses those parameters to transform the input data. The TD_ColumnTransformer function takes the fit tables as input and transforms the input table columns in a single operation.
-- Use a consolidated transform function
CREATE TABLE td_analytics_functions_demo.feature_enriched_accounts_consolidated AS (
SELECT * FROM TD_ColumnTransformer(
ON td_analytics_functions_demo.joined_table AS InputTable
ON td_analytics_functions_demo.one_hot_encoding_joined_table_input AS OneHotEncodingFitTable DIMENSION
ON td_analytics_functions_demo.scale_fit_joined_table_input AS ScaleFitTable DIMENSION
) AS dt
) WITH DATA;
After we perform the transformation, we can see that the categorical columns are one-hot encoded and the numeric values are scaled, as shown in the images below. For example, tot_income is in the range [0, 1], and gender is one-hot encoded into gender_0, gender_1, and gender_other.