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

Teradata® Package for Python Function Reference

Product
Teradata Package for Python
Release Number
17.00
Published
November 2021
Language
English (United States)
Last Update
2021-11-19
lifecycle
previous
Product Category
Teradata Vantage

 
teradataml.analytics.mle.PageRank = class PageRank(builtins.object)
     Methods defined here:
__init__(self, vertices_data=None, edges_data=None, target_key=None, weights=None, damping=0.85, niter=1000, eps=0.001, accumulate=None, vertices_data_sequence_column=None, edges_data_sequence_column=None, vertices_data_partition_column=None, edges_data_partition_column=None, vertices_data_order_column=None, edges_data_order_column=None)
DESCRIPTION:
    The PageRank function computes the PageRank values for a directed 
    graph, weighted or unweighted.
 
 
PARAMETERS:
    vertices_data:
        Required Argument.
        The input teradataml DataFrame contains vertices in the graph.
 
    vertices_data_partition_column:
        Required Argument.
        Specifies Partition By columns for vertices_data.
        Values to this argument can be provided as list, if multiple columns
        are used for partition.
        Types: str OR list of Strings (str)
 
    vertices_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)
 
    edges_data:
        Required Argument.
        The input teradataml DataFrame contains edges in the graph.
 
    edges_data_partition_column:
        Required Argument.
        Specifies Partition By columns for edges_data.
        Values to this argument can be provided as list, if multiple columns
        are used for partition.
        Types: str OR list of Strings (str)
 
    edges_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)
 
    target_key:
        Required Argument.
        Specifies the target key columns in the edges_data.
        Types: str OR list of Strings (str)
 
    weights:
        Optional Argument.
        Specifies the column in the edges teradataml DataFrame that contains
        the edge weight, which must be a positive value. By default, all
        edges have the same weight (that is, the graph is unweighted).
        Types: str
 
    damping:
        Optional Argument.
        Specifies the value to use in the PageRank formula. The damping
        must be a float value between 0 and 1.
        Default Value: 0.85
        Types: float
 
    niter:
        Optional Argument.
        Specifies the maximum number of iterations for which the algorithm
        runs before the function completes. The niter must be a
        positive int value.
        Default Value: 1000
        Types: int
 
    eps:
        Optional Argument.
        Specifies the convergence criteria value. The eps must be a
        float value.
        Default Value: 0.001
        Types: float
 
    accumulate:
        Optional Argument.
        Specifies the vertices teradataml DataFrame columns to copy to the
        output table.
        Types: str OR list of Strings (str)
 
    vertices_data_sequence_column:
        Optional Argument.
        Specifies the list of column(s) that uniquely identifies each row of
        the input argument "vertices_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)
 
    edges_data_sequence_column:
        Optional Argument.
        Specifies the list of column(s) that uniquely identifies each row of
        the input argument "edges_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 PageRank.
    Output teradataml DataFrames can be accessed using attribute
    references, such as PageRankObj.<attribute_name>.
    Output teradataml DataFrame attribute name is:
        result
 
 
RAISES:
    TeradataMlException
 
 
EXAMPLES:
    # Load example data.
    load_example_data("pagerank", ["callers", "calls"])
 
    # Create teradataml DataFrame objects.
    # Vertices table
    callers = DataFrame.from_table("callers")
    # Edges table
    calls = DataFrame.from_table("calls")
 
    # Example 1 - Find PageRank for each vertex.
    PageRank_out = PageRank(vertices_data = callers,
                            vertices_data_partition_column = ["callerid"],
                            edges_data = calls,
                            edges_data_partition_column = ["callerfrom"],
                            target_key = ["callerto"],
                            weights = "calls",
                            accumulate = ["callerid","callername"]
                            )
 
    # Print the results.
    print(PageRank_out)
__repr__(self)
Returns the string representation for a PageRank 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.