| |
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.
|