Teradata R Package Function Reference - DecisionForestEvaluator - Teradata R Package - Look here for syntax, methods and examples for the functions included in the Teradata R Package.

Teradata® R Package Function Reference

Product
Teradata R Package
Release Number
16.20
Published
February 2020
Language
English (United States)
Last Update
2020-02-28
dita:id
B700-4007
lifecycle
previous
Product Category
Teradata Vantage

Description

The Forest Analyze function analyzes the model generated by the Forest Drive function and assigns weights to the model variables. The variable/attribute counts in each tree level help you understand the importance of different variables in the decision-making process.

Usage

  td_decision_forest_evaluator_mle (
    object = NULL,
      num.levels = 5,
      object.sequence.column = NULL
  )

Arguments

object

Required Argument.
Specifies the tbl_teradata containing the model data from td_decision_forest_mle or object of class td_decision_forest_mle.

num.levels

Optional Argument.
Specifies number of levels to analyze.
Default Value: 5

object.sequence.column

Optional Argument.
Specifies the vector of column(s) that uniquely identifies each row of the input argument "object". The argument is used to ensure deterministic results for functions which produce results that vary from run to run.

Value

Function returns an object of class "td_decision_forest_evaluator_mle" which is a named list containing Teradata tbl object.
Named list member can be referenced directly with the "$" operator using name: result

Examples

    # Get the current context/connection
    con <- td_get_context()$connection
    
    # Load the data to run the example
    loadExampleData("decisionforest_example","housing_train")
    
    # Create remote tibble objects.
    housing_train <- tbl(con, "housing_train")
    
    # First train the data, i.e., create a decision forest model
    td_decision_forest_out <- td_decision_forest_mle(data=housing_train,
                                      formula = (homestyle ~ bedrooms + lotsize + gashw + driveway +
                                          stories + recroom + price + garagepl + bathrms + fullbase + airco +
                                          prefarea),
                                      tree.type="classification",
                                      nodesize=1,
                                      variance=0,
                                      max.depth=12,
                                      maxnum.categorical=20,
                                      mtry = 100,
                                      seed = 100,
                                      ntree=50
                                      )
    
    # Analyze generated output.
    decision_forest_evaluator_out <- td_decision_forest_evaluator_mle(object=td_decision_forest_out,
                                         num.levels=5
                                         )