Graph Operations

class ddf_library.functions.graph.PageRank(damping_factor=0.85, max_iters=100)

Bases: ddf_library.bases.ddf_model.ModelDDF

PageRank is one of the methods Google uses to determine a page’s relevance or importance. The idea that Page Rank brought up was that, the importance of any web page can be judged by looking at the pages that link to it.

PageRank can be utilized in others domains. For example, may also be used as a methodology to measure the apparent impact of a community.

Example:
>>> pr = PageRank(damping_factor=0.85)
>>> ddf2 = pr.transform(ddf1, inlink_col='col1', outlink_col='col2')
Parameters:
  • damping_factor – Default damping factor is 0.85;
  • max_iters – Maximum number of iterations (default is 100).
transform(data, outlink_col, inlink_col)

Generates the PageRank’s result.

Parameters:
  • data – DDF
  • outlink_col – Out-link vertex;
  • inlink_col – In-link vertex;
Returns:

DDF with Vertex and Rank columns