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

Teradata® Package for Python Function Reference

Product
Teradata Package for Python
Release Number
17.10
Published
April 2022
Language
English (United States)
Last Update
2022-08-19
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.
get_build_time(self)
Function to return the build time of the algorithm in seconds.
When model object is created using retrieve_model(), then the value returned is 
as saved in the Model Catalog.
get_prediction_type(self)
Function to return the Prediction type of the algorithm.
When model object is created using retrieve_model(), then the value returned is 
as saved in the Model Catalog.
get_target_column(self)
Function to return the Target Column of the algorithm.
When model object is created using retrieve_model(), then the value returned is 
as saved in the Model Catalog.
show_query(self)
Function to return the underlying SQL query.
When model object is created using retrieve_model(), then None is returned.