DecisionForest Example | Teradata Vantage - DecisionForest Example: TreeType ('classification'), OutOfBag ('true') - 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ā„¢

Like DecisionForest Example: TreeType ('classification'), OutOfBag ('false'), this example uses home sales data to create a classification tree that predicts home style, which can be input to the DecisionForestPredict_MLE Example: Omit Responses. However, this example outputs the out-of-bag error.

SQL Call

SELECT * FROM DecisionForest (
  ON housing_train AS InputTable
  OUT TABLE OutputTable (rft_model_oob)
  OUT TABLE OutputMessageTable (housing_monitor_table)
  USING
  ResponseColumn ('homestyle')
  NumericInputs ('price','lotsize','bedrooms','bathrms','stories','garagepl')
  CategoricalInputs
   ('driveway','recroom','fullbase','gashw','airco','prefarea')
  TreeType ('classification')
  MinNodeSize ('2')
  MaxDepth ('12') 
  NumTrees ('50')
  Mtry ('3')
  OutOfBag ('true')
  IDColumn ('sn')
) AS dt;

Output

 message                                          
 ------------------------------------------------ 
 Computing 50 classification trees.              
 Each worker is computing 25 trees.              
 Each tree will contain approximately 246 points.
 Poisson sampling parameter: 1.00                
 OOB estimate of error rate: 3.462321792260693%  
 Decision forest created.

The model table, rft_model_oob, looks the same as it does in DecisionForest Example: TreeType ('classification'), OutOfBag ('false').

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