Teradata Python Package Function Reference - PathGenerator - 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

 
teradataml.analytics.mle.PathGenerator = class PathGenerator(builtins.object)
     Methods defined here:
__init__(self, data=None, seq_column=None, delimiter=',', data_sequence_column=None, data_order_column=None)
DESCRIPTION:
    The PathGenerator function takes a set of paths and outputs the 
    sequence and all possible sub-sequences, which can be input to the
    function PathSummarizer.
 
 
PARAMETERS:
    data:
        Required Argument.
        The name of the teradataml DataFrame containing the input data.
 
    data_order_column:
        Optional Argument.
        Specifies Order By columns for data.
        Values to this argument can be provided as list, if multiple columns
        are used for ordering.
        Types: str OR list of Strings (str)
 
    seq_column:
        Required Argument.
        Specifies the name of the input teradataml DataFrame column that
        contains the paths.
        Types: str
 
    delimiter:
        Optional Argument.
        Specifies the single-character delimiter that separates symbols in
        the path string.
        Note: Do not use any of the following characters as delimiter
              (they cause the function to fail):
                  Asterisk (*), Plus (+), Left parenthesis ((), Right parenthesis ()),
                  Single quotation mark ('), Escaped single quotation mark (\'),
                  Backslash (\)
        Default Value: ","
        Types: str
 
    data_sequence_column:
        Optional Argument.
        Specifies the list of column(s) that uniquely identifies each row of
        the input argument "data". The argument is used to ensure
        deterministic results for functions which produce results that vary
        from run to run.
        Types: str OR list of Strings (str)
 
RETURNS:
    Instance of PathGenerator.
    Output teradataml DataFrames can be accessed using attribute
    references, such as PathGeneratorObj.<attribute_name>.
    Output teradataml DataFrame attribute name is:
        result
 
 
RAISES:
    TeradataMlException
 
 
EXAMPLES:
    # Load example data.
    load_example_data("pathgenerator", "clickstream1")
 
    # Create teradataml DataFrame objects.
    # The table contains clickstream data, where the "path" column
    # contains symbols for the pages that the customer clicked.
    clickstream1 = DataFrame.from_table("clickstream1")
 
    # Example - Generate path sequences and count for the given clickstream data.
    PathGeneratorOut = PathGenerator(data = clickstream1,
                                      seq_column = "path"
                                      )
 
    # Print the results.
    print(PathGeneratorOut)
__repr__(self)
Returns the string representation for a PathGenerator class instance.