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

Teradata® Python Package Function Reference

Product
Teradata Python Package
Release Number
16.20
Published
February 2020
Language
English (United States)
Last Update
2020-07-17
lifecycle
previous
Product Category
Teradata Vantage

Teradata Vantage™ is our flagship analytic platform offering, which evolved from our industry-leading Teradata Database. Until references in content are updated to reflect this change, the term Teradata Database is synonymous with Teradata Vantage.

Teradata Advanced SQL Engine (was NewSQL) is a core of Teradata Vantage, based on our best-in-class Teradata Database processing capability. Advanced SQL refers to the ability to run advanced analytic functions beyond that of standard SQL.

This document provides detailed description and complete usage information for all the functions in the Teradata® Python Package, teradataml.

teradataml Function Categories

Categories of teradataml package functions:

  • <name>: Analytic functions available to use as class. Executing each analytical function means, generating instance of the analytic function class.
  • DataFrame.<name>: Create a teradataml DataFrame for the underlying Teradata table.
  • <name>_context: API functions that manage the connection and certain internal data structures called context.
  • <TDMLDF>.<name>: teradataml DataFrame methods available for data manipulation, preparation and exploration.

Notes:

  • name is part of a function name that indicates the specific task of the function.
  • TDMLDF is teradataml DataFrame object.

teradataml Analytic Function Default Execution Locations

The teradataml analytics package includes two subpackages:

  • teradataml.analytics.mle
  • teradataml.analytics.sqle

All teradataml analytic functions are in either of these two subpackages.

For Vantage 1.0 the following nine teradataml analytic functions were executed by default in the Advanced SQL Engine:

  • Attribution
  • DecisionForestPredict
  • DecisionTreePredict
  • GLMPredict
  • NaiveBayesPredict
  • NaiveBayesTextClassifierPredict
  • NPath
  • Sessionize
  • SVMSparsePredict

For Vantage 1.1 or later versions, six new functions are added to the list. The following 15 teradataml analytic functions are executed by default in the Advanced SQL Engine:

  • Antiselect
  • Attribution
  • DecisionForestPredict
  • DecisionTreePredict
  • GLMPredict
  • MovingAverage
  • NaiveBayesPredict
  • NaiveBayesTextClassifierPredict
  • NGramSplitter
  • NPath
  • Pack
  • Sessionize
  • StringSimilarity
  • SVMSparsePredict
  • Unpack

All other teradataml analytic functions are executed by default in the Teradata Machine Learning Engine.

Notes:

  • Teradata recommends importing an analytic function in one of the following ways:

    • Preferred: Import from the teradataml package.
    • To choose the engine where the analytic function is used: Import from the subpackage.
  • The teradataml package includes a module (load_example_data) with datasets for the examples in analytic functions. To execute these examples, you need the following:

    • To have a connection to Teradata Vantage
    • Import the load_example_data module to load the data, using the command:
      from teradataml.data.load_example_data import load_example_data