Teradata Package for Python Function Reference | 17.10 - publish_model - 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
- Product Category
- Teradata Vantage
- teradataml.catalog.model_cataloging.publish_model = publish_model(name, grantee=None, status=None)
- DESCRIPTION:
Function to publish a model.
It can be used to update the access level from PRIVATE to PUBLIC or TEAM.
It can also be used to update the status of the model to one of the expected values.
A model can be published only by the creator of the model.
PARAMETERS:
name:
Required Argument.
Specifies the name of the model to be published.
Types: str
grantee:
Optional Argument. Must be specified when status is not specified.
Specifies a user or role (including PUBLIC) to update the model's access level to.
Types: str
status:
Optional Argument. Must be specified when grantee is not specified.
Specify a string to set the status of the model to.
Types: str
Permitted Values: ['ACTIVE', 'RETIRED', 'CANDIDATE', 'PRODUCTION', 'IN-DEVELOPMENT']
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")
# Example 1 - Update only the access.
publish_model('decision_forest_model', grantee='john')
# Example 2 - Update only the status.
publish_model('decision_forest_model', status='Active')
# Example 3 - Update both the access and status.
publish_model('decision_forest_model', grantee='PUBLIC', status='Production')