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

Teradata® Python Package Function Reference

Product
Teradata Python Package
Release Number
16.20
Published
February 2020
Language
English (United States)
Last Update
2020-07-17
lifecycle
previous
Product Category
Teradata Vantage

 
teradataml.analytics.mle.DecisionForestEvaluator = class DecisionForestEvaluator(builtins.object)
     Methods defined here:
__init__(self, object=None, num_levels=5, object_sequence_column=None, object_order_column=None)
DESCRIPTION:
    The DecisionForestEvaluator analyzes the model generated by the
    DecisionForest and gives weights to the variables in the
    model. This function shows variable/attribute counts in each tree
    level, helping you to understand the importance of different
    variables in the decision-making process.
 
 
PARAMETERS:
    object:
        Required Argument.
        Specifies the teradataml DataFrame containing the model data from
        DecisionForest or instance of 'DecisionForest'.
 
    object_order_column:
        Optional Argument.
        Specifies Order By columns for object.
        Values to this argument can be provided as a list, if multiple
        columns are used for ordering.
        Types: str OR list of Strings (str)
 
    num_levels:
        Optional Argument.
        Specifies number of levels to analyze.
        Default Value: 5
        Types: int
 
    object_sequence_column:
        Optional Argument.
        Specifies the list 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.
        Types: str OR list of Strings (str)
 
RETURNS:
    Instance of DecisionForestEvaluator.
    Output teradataml DataFrames can be accessed using attribute
    references, such as DecisionForestEvaluatorObj.<attribute_name>.
    Output teradataml DataFrame attribute name is:
        result
 
 
RAISES:
    TeradataMlException
 
 
EXAMPLES:
    # Load the data to run the example
    load_example_data("decisionforest", "housing_train")
 
    # Create teradataml DataFrame objects.
    housing_train = DataFrame.from_table("housing_train")
 
    # First train the data, i.e., create a decision forest model
    formula = "homestyle ~ bedrooms + lotsize + gashw + driveway + stories + recroom + price + garagepl + bathrms + fullbase + airco + prefarea"
    decision_forest_out = DecisionForest(data=housing_train,
                                         formula = formula,
                                         tree_type="classification",
                                         nodesize=1,
                                         variance=0.0,
                                         max_depth=12,
                                         maxnum_categorical=20,
                                         mtry = 100,
                                         seed = 100,
                                         ntree=50
                                         )
 
    # Analyze output using DecisionForestEvaluator
    decision_forest_eval = DecisionForestEvaluator(object=decision_forest_out,
                                 num_levels=5
                                 )
 
    # Print the results.
    print(decision_forest_eval.result)
__repr__(self)
Returns the string representation for a DecisionForestEvaluator class instance.