Teradata R Package Function Reference | 17.00 - 17.00 - PageRank - Teradata R Package

Teradata® R Package Function Reference

prodname
Teradata R Package
vrm_release
17.00
created_date
September 2020
category
Programming Reference
featnum
B700-4007-090K

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 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 a 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 a vector, if multiple columns are used for ordering.
Types: character OR vector of Strings (character)

edges.data

Required Argument.
Specifies the input tbl_teradata 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 a 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 a 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.data".
Types: character OR vector of Strings (character)

weights

Optional Argument.
Specifies the column in "edges.data" 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: character

damping

Optional Argument.
Specifies the value to use in the PageRank formula. This argument 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 be a positive integer value.
Default Value: 1000
Types: integer

eps

Optional Argument.
Specifies the convergence criteria value.
Default Value: 0.001
Types: numeric

accumulate

Optional Argument.
Specifies the names of columns in "vertices.data" to copy to the "result" output tbl_teradata.
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 object of class "tbl_teradata".
Named list member can be referenced directly with the "$" operator using the name: result.

Examples

    # Get the current context/connection.
    con <- td_get_context()$connection
    
    # Load example data.
    loadExampleData("pagerank_example", "callers", "calls")
    
    # Create object(s) of class "tbl_teradata".
    callers <- tbl(con, "callers")
    calls <- tbl(con, "calls")
    
    # Example 1 - Find pagerank for each vertex.
    td_page_rank_mle_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"),
                                             weights = "calls",
                                             accumulate = c("callerid","callername")
                                             )