Teradata Package for Python Function Reference - 17.00 - categorical_columns - Teradata Package for Python

Teradata® Package for Python Function Reference

Product
Teradata Package for Python
Release Number
17.00
Release Date
April 2021
Content Type
Programming Reference
Publication ID
B700-4008-070K
Language
English (United States)
teradataml.common.formula.Formula.categorical_columns
DESCRIPTION:
    Property to get the list of all independent categorical columns used in formula.
 
PARAMETERS:
    None.
 
RETURNS:
    List of categorical columns used in formula.
    If no categorical column is used in formula, property will return None.
 
RAISES:
    None.
 
EXAMPLES:
    # Load the data to run the example
    load_example_data("decisionforest", ["housing_train"])
 
    # Create teradataml DataFrame.
    housing_train = DataFrame.from_table("housing_train")
 
    # Example 1 -
    decision_forest_out1 = DecisionForest(formula = "homestyle ~ bedrooms + lotsize + gashw + driveway + stories + recroom + price + garagepl + bathrms + fullbase + airco + prefarea",
                                          data = housing_train,
                                          tree_type = "classification",
                                          ntree = 50,
                                          nodesize = 1,
                                          variance = 0.0,
                                          max_depth = 12,
                                          mtry = 3,
                                          mtry_seed = 100,
                                          seed = 100)
 
    # Print categorical columns used in formula.
    decision_forest_out1.formula.categorical_columns