| |
Methods defined here:
- __init__(self, object=None, count_column=None, delimiter=',', seq_column=None, partition_names=None, hash=False, prefix_column=None, object_sequence_column=None, object_partition_column=None, object_order_column=None)
- DESCRIPTION:
The PathSummarizer function takes output of the function
PathGenerator and returns, for each prefix in the input table, the
parent and children and number of times each of its sub-sequences was
traveled. This output can be input to the function PathStart.
PARAMETERS:
object:
Required Argument.
The name of the teradataml DataFrame containing the input data.
object_partition_column:
Required Argument.
Specifies Partition By columns for object.
Values to this argument can be provided as list, if multiple columns
are used for partition.
Types: str OR list of Strings (str)
object_order_column:
Optional Argument.
Specifies Order By columns for object.
Values to this argument can be provided as list, if multiple columns
are used for ordering.
Types: str OR list of Strings (str)
count_column:
Optional Argument.
Specifies the name of the input teradataml DataFrame column that
contains the number of times a path was traveled.
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
seq_column:
Required Argument.
Specifies the name of the input teradataml DataFrame column that
contains the paths.
Types: str
partition_names:
Required Argument.
Lists the names of the columns that the object_partition_column
specifies. The function uses these names for output teradataml
DataFrame columns. This argument and the object_partition_column
must specify the same names in the same order.
Types: str OR list of strs
hash:
Optional Argument.
Specifies whether to include the hash code of the node in the output
teradataml DataFrame.
Default Value: False
Types: bool
prefix_column:
Required Argument.
Specifies the name of the input teradataml DataFrame column that contains
the node prefixes.
Types: str
object_sequence_column:
Optional Argument.
Specifies the list of column(s) that uniquely identifies each row of
the input argument "object". 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 PathSummarizer.
Output teradataml DataFrames can be accessed using attribute
references, such as PathSummarizerObj.<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 1 - PathSummarizer uses the output of PathGenerator.
PathGeneratorOut = PathGenerator(data = clickstream1,
seq_column = "path"
)
PathSummarizerOut1 = PathSummarizer(object = PathGeneratorOut,
object_partition_column = ['prefix'],
seq_column = 'sequence',
partition_names = 'prefix',
prefix_column = 'prefix'
)
# Print the results
print(PathSummarizerOut1)
# Example 2 - Alternatively, persist and use the output table of PathGenerator.
copy_to_sql(PathGeneratorOut.result, "generated_path_table")
generated_path_table = DataFrame.from_table("generated_path_table")
PathSummarizerOut2 = PathSummarizer(object = generated_path_table,
object_partition_column = ['prefix'],
seq_column = 'sequence',
partition_names = 'prefix',
prefix_column = 'prefix'
)
# Print the results
print(PathSummarizerOut2)
- __repr__(self)
- Returns the string representation for a PathSummarizer class instance.
- get_build_time(self)
- Function to return the build time of the algorithm in seconds.
When model object is created using retrieve_model(), then the value returned is
as saved in the Model Catalog.
- get_prediction_type(self)
- Function to return the Prediction type of the algorithm.
When model object is created using retrieve_model(), then the value returned is
as saved in the Model Catalog.
- get_target_column(self)
- Function to return the Target Column of the algorithm.
When model object is created using retrieve_model(), then the value returned is
as saved in the Model Catalog.
- show_query(self)
- Function to return the underlying SQL query.
When model object is created using retrieve_model(), then None is returned.
|