Graph analytics - pagerank run on one machine.

User 926 | 11/14/2014, 12:48:06 PM

Hi, I am new to graphlab. How can I use pagerank toolkit to list up the top 10 nodes by giving a tsv file?

Comments

User 6 | 11/14/2014, 2:56:26 PM

Here is the code for Graphlab Create:

import graphlab as gl data = gl.SFrame.readcsv('yourdata.tsv', delimiter='\t') g = gl.SGraph() g = g.addedges(data, srcfield='guid', dstfield='domain') g = g.addedges(data, srcfield='domain', dstfield='guid') pr = gl.pagerank.create(g) pr.get('pagerank').topk(k=10)

Note that guid and domain are assumed to be your column header names in the tsv file which signify the relation you like to run pagerank on.