コード例 #1
0
 def get_random_walks_restart_for_large_bipartite_graph(self, matrix, hits_dict, percentage, maxT, minT):
     G = graph.load_edgelist_from_matrix(matrix, undirected=True)
     print("number of nodes: {}".format(len(G.nodes())))
     print("walking...")
     walks = graph.build_deepwalk_corpus_random(G, hits_dict, percentage=percentage, maxT = maxT, minT = minT, alpha=0)
     print("walking...ok")
     return G, walks
コード例 #2
0
 def get_random_walks_restart(self, datafile, hits_dict, percentage, maxT, minT):
     if datafile is None:
         datafile = os.path.join(self.model_path,"rating_train.dat")
     G = graph.load_edgelist(datafile, undirected=True)
     print("number of nodes: {}".format(len(G.nodes())))
     print("walking...")
     walks = graph.build_deepwalk_corpus_random(G, hits_dict, percentage=percentage, maxT = maxT, minT = minT, alpha=0)
     print("walking...ok")
     return G, walks