Skip to content

Commit 3b74f2a

Browse files
placeholder
1 parent 8aa56b0 commit 3b74f2a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/test/baseline/algos/pagerank.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import networkx as nx
2+
import pandas as pd
3+
from pyTigerGraph.datasets import Datasets
4+
5+
from .base import Baseline
6+
from .common import create_baseline
7+
8+
9+
def run_pagerank(g: nx.Graph, metric):
10+
res = metric(g)
11+
12+
out = []
13+
for k, v in res.items():
14+
out.append({"Vertex_ID": k, "score": v})
15+
16+
out = [{"@@top_scores_heap": out}]
17+
return out
18+
19+
20+
class PagerankBaseline(Baseline):
21+
def __init__(self, data_path_root, baseline_path_root):
22+
self.data_path_root = data_path_root
23+
self.baseline_path_root = baseline_path_root
24+
25+
def run(self):
26+
return

0 commit comments

Comments
 (0)