Teradata Package for Python Function Reference - list_models - 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.00
Published
November 2021
Language
English (United States)
Last Update
2021-11-19
lifecycle
previous
Product Category
Teradata Vantage
teradataml.catalog.model_cataloging.list_models = list_models(name=None, algorithm_name=None, engine=None, accessible=True, public=False)
DESCRIPTION:
    Function to list models accessible to the user and optionally only models created by the user.
 
PARAMETERS:
    name:
        Optional Argument.
        Specifies the search string for model name. When this argument is used,
        all models matching the name are listed.
        Types: str
 
    algorithm_name:
        Optional Argument.
        Specifies the search string for the analytic function name. When this argument is used,
        all models matching the algorithm_name are listed.
        Types: str
 
    engine:
        Optional Argument.
        Specifies the model generating engine as a filter.
        Types: str
        Permitted Values: ['ML Engine', 'Advanced SQL Engine']
 
    accessible:
        Optional Argument.
        Specifies whether to list all models that the user has access to, or only the models that the user created.
        When True, all models to which the user has access are listed.
        When False, all models created by the user are listed.
        Types: bool
        Default Value: True
 
    public:
        Optional Argument.
        Specifies whether to filter only those models that have public access.
        Types: bool
        Default Value: False
 
RETURNS:
    None.
 
RAISES:
    TeradataMlException, TypeError, ValueError
 
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")
 
    # The examples use home sales data to create a
    # classification tree that predicts home style, which can be input
    # to the DecisionForestPredict.
    formula = "homestyle ~ driveway + recroom + fullbase + gashw + airco + prefarea + price + lotsize + bedrooms + bathrms + stories + garagepl"
    rft_model = DecisionForest(data=housing_train,
                               formula = formula,
                               tree_type="classification",
                               ntree=50,
                               tree_size=100,
                               nodesize=1,
                               variance=0.0,
                               max_depth=12,
                               maxnum_categorical=20,
                               mtry=3,
                               mtry_seed=100,
                               seed=100
                               )
 
    # Let's save this generated model.
    save_model(model=rft_model, name="decision_forest_model", description="Decision Forest test")
 
    # Let's view the saved models accessible to the user
    # Example 1 - List all models saved and accessible to the current user.
    list_models()
 
    # Example 2 - List models accessible to the user with name = 'decision_forest_model'
    list_models(name = "decision_forest_model")
 
    # Example 3 - List all models accessible to the user with algorithm name 'DecisionForest'
    list_models(algorithm_name = "DecisionForest")
 
    # Example 4 - List all models accessible to user with algorithm name 'DecisionForest' and model name
    # containing string 'forest'.
    list_models(name = "forest", algorithm_name = "DecisionForest")
 
    # Example 5 - List all models accessible to user with algorithm name 'DecisionForest' and model generated using
    # 'ML Engine'.
    list_models(name = "forest", algorithm_name = "DecisionForest", engine = "ML Engine")
 
    # Example 6 - List all models created by the user with algorithm name 'DecisionForest' and model generated using
    # 'ML Engine' and access not set to Public.
    list_models(name = "forest", algorithm_name = "DecisionForest", engine = "ML Engine",
                accessible = False, public = False)