DecisionForestPerSegment Example | Teradata Vantage - DecisionForestPerSegment Example: Omit AttributeTable or ParameterTable - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
9.02
9.01
2.0
1.3
Published
February 2022
Language
English (United States)
Last Update
2022-02-10
dita:mapPath
rnn1580259159235.ditamap
dita:ditavalPath
ybt1582220416951.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantageā„¢

Input

housing_train
sn price lotsize bedrooms bathrms stories driveway recroom fullbase gashw airco garagepl prefarea homestyle
76 36000 3180 3 1 1 no no no no no 0 no classic
40 54500 3150 2 2 1 no no yes no no 0 no eclectic
19 45000 3450 1 1 1 yes no no no no 0 no bungalow
55 38000 3630 3 3 2 no yes no no no 0 no eclectic
99 35000 3500 2 1 1 yes no no no no 0 no eclectic

SQL Call

CREATE MULTISET TABLE df_ps_1 AS (
  SELECT * FROM DecisionForestPerSegment (
    ON housing_train AS InputTable PARTITION BY airco
    USING
    ResponseColumn ('homestyle')
    NumericInputs ('price','lotsize','bedrooms','bathrms','stories','garagepl')
    CategoricalInputs ('driveway','recroom','fullbase','gashw','prefarea')
    TreeType ('classification')
    MaxDepth (6)
  ) AS dt
) WITH DATA;

Output

df_ps_1
airco tree_num tree
no 1 Snippet:{"responseCounts_":{"classic":91,"bungal
yes 1 Snippet:{"responseCounts_":{"classic":91,"bungal
no 3 Snippet:{"responseCounts_":{"classic":71,"bungal
yes 3 Snippet:{"responseCounts_":{"classic":12,"bungal

Download a zip file of all examples and a SQL script file that creates their input tables.