1.1 - 8.10 - DecisionForestPredict_MLE Example: Responses and OutputProb - Teradata Vantage

Teradata Vantage™ - Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.1
8.10
Release Date
October 2019
Content Type
Programming Reference
Publication ID
B700-4003-079K
Language
English (United States)

In this example, Responses is 'true'; therefore, OutputProb is required.

Input

This example uses these input tables:

SQL Call

CREATE multiset TABLE rf_housing_predict_2 AS (
  SELECT * FROM DecisionForestPredict_MLE (
    ON housing_test PARTITION BY ANY 
    ON rft_model AS Model DIMENSION
    USING
    NumericInputs ('price ','lotsize ','bedrooms ','bathrms ','stories ','garagepl')
    CategoricalInputs ('driveway ','recroom ','fullbase ','gashw ','airco ','prefarea')
    IdColumn ('sn')
    Accumulate ('homestyle')
    OutputProb ('t')
    Responses ('classic','eclectic','bungalow')
  ) AS dt
) WITH data;

Output

SELECT * FROM rf_housing_predict_2 ORDER BY sn;
 homestyle sn  prediction prob_classic prob_eclectic prob_bungalow 
 --------- --- ---------- ------------ ------------- ------------- 
 classic    13 classic            0.98          0.02           0.0
 classic    16 classic            0.72          0.28           0.0
 classic    25 classic            0.94          0.06           0.0
 eclectic   38 eclectic            0.0          0.96          0.04
 eclectic   53 eclectic           0.02           0.9          0.08
 bungalow  104 bungalow           0.02          0.48           0.5
 classic   111 classic            0.92          0.08           0.0
 eclectic  117 eclectic           0.02          0.94          0.04
 classic   132 classic            0.98          0.02           0.0
 classic   140 classic            0.98          0.02           0.0
 classic   142 classic            0.94          0.06           0.0
 eclectic  157 eclectic            0.0           1.0           0.0
 eclectic  161 eclectic           0.06          0.92          0.02
 bungalow  162 bungalow            0.0          0.42          0.58
 eclectic  176 eclectic           0.04          0.94          0.02
 eclectic  177 eclectic           0.04          0.94          0.02
 classic   195 classic            0.94          0.06           0.0
 classic   198 classic            0.94          0.04          0.02
 eclectic  224 eclectic           0.02          0.94          0.04
 classic   234 classic             1.0           0.0           0.0
 classic   237 classic            0.82          0.18           0.0
 classic   239 classic             0.9           0.1           0.0
 classic   249 classic            0.94          0.06           0.0
 classic   251 classic            0.78          0.22           0.0
 eclectic  254 eclectic           0.02           0.9          0.08
 eclectic  255 eclectic           0.04          0.94          0.02
 classic   260 classic            0.88          0.12           0.0
 eclectic  274 eclectic            0.0           1.0           0.0
 classic   294 classic            0.96          0.04           0.0
 eclectic  301 eclectic            0.0           1.0           0.0
 eclectic  306 eclectic           0.06           0.9          0.04
 eclectic  317 eclectic            0.0          0.98          0.02
 bungalow  329 bungalow            0.0          0.06          0.94
 bungalow  339 bungalow            0.0           0.3           0.7
 eclectic  340 eclectic           0.04          0.96           0.0
 eclectic  353 eclectic            0.0           1.0           0.0
 eclectic  355 eclectic           0.02          0.94          0.04
 eclectic  364 eclectic           0.02          0.88           0.1
 bungalow  367 bungalow           0.02          0.08           0.9
 bungalow  377 bungalow            0.0          0.32          0.68
 eclectic  401 eclectic            0.0          0.96          0.04
 eclectic  403 eclectic            0.0          0.94          0.06
 eclectic  408 eclectic            0.0          0.98          0.02
 eclectic  411 eclectic            0.0           0.9           0.1
 eclectic  440 eclectic            0.0          0.98          0.02
 eclectic  441 eclectic           0.02          0.98           0.0
 eclectic  443 eclectic           0.06          0.94           0.0
 classic   459 classic            0.88          0.12           0.0
 classic   463 classic            0.94          0.06           0.0
 eclectic  469 eclectic           0.22          0.78           0.0
 eclectic  472 eclectic            0.1           0.9           0.0
 bungalow  527 bungalow            0.0          0.34          0.66
 bungalow  530 bungalow            0.0           0.4           0.6
 eclectic  540 eclectic           0.06           0.9          0.04