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

Teradata® R Package Function Reference

Product
Teradata R Package
Release Number
16.20
Published
February 2020
Language
English (United States)
Last Update
2020-02-28
dita:id
B700-4007
lifecycle
previous
Product Category
Teradata Vantage

Description

The PageRank function computes the PageRank values for a directed graph, weighted or unweighted.

Usage

  td_page_rank_mle (
      vertices.data = NULL,
      edges.data = NULL,
      target.key = NULL,
      weights = NULL,
      damping = 0.85,
      niter = 1000,
      eps = 0.001,
      accumulate = NULL,
      vertices.data.sequence.column = NULL,
      edges.data.sequence.column = NULL,
      vertices.data.partition.column = NULL,
      edges.data.partition.column = NULL,
      vertices.data.order.column = NULL,
      edges.data.order.column = NULL
  )

Arguments

vertices.data

Required Argument.
Specifies the input tbl_teradata object containing 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 vector, if multiple columns are used for partition.
Types: character OR vector of Strings (character)

vertices.data.order.column

Optional Argument.
Specifies Order By columns for vertices.data.
Values to this argument can be provided as vector, if multiple columns are used for ordering.
Types: character OR vector of Strings (character)

edges.data

Required Argument.
Specifies the input tbl_teradata object containing 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 vector, if multiple columns are used for partition.
Types: character OR vector of Strings (character)

edges.data.order.column

Optional Argument.
Specifies Order By columns for edges.data.
Values to this argument can be provided as vector, if multiple columns are used for ordering.
Types: character OR vector of Strings (character)

target.key

Required Argument.
Specifies the target key columns in the edges table.
Types: character OR vector of Strings (character)

weights

Optional Argument.
Specifies the column in the edges input tbl that contains the edge weight. This argument must be a positive value. By default, all edges have the same weight (that is, the graph is unweighted).
Types: character

damping

Optional Argument.
Specifies the value to use in the PageRank formula. The damping must be a numeric value between 0 and 1.
Default Value: 0.85
Types: numeric

niter

Optional Argument.
Specifies the maximum number of iterations for which the algorithm runs before the function completes. This argument must be a positive numeric value.
Default Value: 1000
Types: numeric

eps

Optional Argument.
Specifies the convergence criteria value. This argument must be a numeric value.
Default Value: 0.001

accumulate

Optional Argument.
Specifies the vertices input tbl columns to copy to the output table.
Types: character OR vector of Strings (character)

vertices.data.sequence.column

Optional Argument.
Specifies the vector 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: character OR vector of Strings (character)

edges.data.sequence.column

Optional Argument.
Specifies the vector 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: character OR vector of Strings (character)

Value

Function returns an object of class "td_page_rank_mle" which is a named list containing Teradata tbl object. Named list member can be referenced directly with the "$" operator using name: result.

Examples

    # Get the current context/connection
    con <- td_get_context()$connection
    
    # Load example data.
    loadExampleData("pagerank_example", "callers", "calls")
    
    # Create remote tibble objects.
    #Vertices Table
    callers <- tbl(con, "callers")
    
    #Edges Table
    calls <- tbl(con, "calls")
    
    # Example 1 - Fine pagerank for each vertex. 
    td_page_rank_out <- td_page_rank_mle(vertices.data = callers,
                                     vertices.data.partition.column = c("callerid"),
                                     edges.data = calls,
                                     edges.data.partition.column = c("callerfrom"),
                                     target.key = c("callerto"),
                                     accumulate = c("callerid","callername")
                                     )