byom_install_location | Teradata Package for Python - byom_install_location - Teradata Package for Python

Teradata® Package for Python User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for Python
Release Number
20.00
Published
March 2024
Language
English (United States)
Last Update
2024-10-10
dita:mapPath
nvi1706202040305.ditamap
dita:ditavalPath
plt1683835213376.ditaval
dita:id
rkb1531260709148
lifecycle
latest
Product Category
Teradata Vantage

The byom_install_location configuration option indicates the name of the database where Bring Your Own Model functions are installed. This option is internally used by BYOM functions like H2OPredict() and PMMLPredict().

Example

  • Import all modules.
    >>> from teradataml import *
  • Set the configuration option byom_install_location to "mldb".
    >>> # Set the teradataml Configuration option 'byom_install_location' to "mldb"
    >>> configure.byom_install_location = "mldb"
  • Load example data.
    >>> load_example_data("byom", "iris_test")
  • Load model files.
    >>> # Load model file into Vantage.
    >>> model_file = os.path.join(os.path.dirname(teradataml.__file__), "data", "models", "iris_mojo_glm_h2o_model")
  • Save the model.
    >>> save_byom("iris_mojo_glm_h2o_model", model_file, "byom_models")
  • Retrieve the saved model and directly pass the output as an input to the H2OPredict function.
    >>> modeldata = retrieve_byom("iris_mojo_glm_h2o_model", table_name="byom_models")
    >>> result = H2OPredict(newdata=iris_test,
                            newdata_partition_column='id',
                            newdata_order_column='id',
                            modeldata=modeldata,
                            modeldata_order_column='model_id',
                            model_output_fields=['label', 'classProbabilities'],
                            accumulate=['id', 'sepal_length', 'petal_length'],
                            overwrite_cached_models='*',
                            enable_options='stageProbabilities',
                            model_type='OpenSource'
                           )
  • Print the results of the H2OPredict function.
    >>> # Print the results.
    >>> print(result.result)