Skip to content

Commit

Permalink
starting to run pagerank
Browse files Browse the repository at this point in the history
  • Loading branch information
RobRossmiller-TG committed Aug 29, 2024
1 parent b4e5a5f commit 15cf6dc
Show file tree
Hide file tree
Showing 29 changed files with 543 additions and 406 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ __pycache__
.env
*.xml
pyrightconfig.json
l
*.ipynb
8 changes: 4 additions & 4 deletions GDBMS_ALGO/centrality/pagerank.gsql
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ CREATE TEMPLATE QUERY GDBMS_ALGO.centrality.pagerank (STRING v_type, STRING e_ty
BOOL display_edges = FALSE) SYNTAX V1 {

/*
First Author: <First Author Name>
First Commit Date: <First Commit Date>
First Author: unk
First Commit Date: unk

Recent Author: <Recent Commit Author Name>
Recent Commit Date: <Recent Commit Date>
Recent Author: Rob Rossmiller
Recent Commit Date: Rob Rossmiller


Repository:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
CREATE QUERY tg_pagerank (STRING v_type, STRING e_type,
FLOAT max_change=0.001, INT maximum_iteration=25, FLOAT damping=0.85, INT top_k = 100,
BOOL print_results = TRUE, STRING result_attribute = "", STRING file_path = "",
BOOL display_edges = FALSE) SYNTAX V1 {

CREATE QUERY tg_pagerank (STRING v_type, STRING e_type, FLOAT max_change=0.001, INT maximum_iteration=25, FLOAT damping=0.85, INT top_k = 100, BOOL print_results = TRUE, STRING result_attribute = "", STRING file_path = "", BOOL display_edges = FALSE) SYNTAX V1 {
/*
First Author: <First Author Name>
First Commit Date: <First Commit Date>
First Author: unk
First Commit Date: unk

Recent Author: <Recent Commit Author Name>
Recent Commit Date: <Recent Commit Date>
Recent Author: Rob Rossmiller
Recent Commit Date: Rob Rossmiller


Repository:
Expand Down
1 change: 1 addition & 0 deletions tests/data/baseline/centrality/pagerank/Complete.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"@@top_scores_heap": [{"Vertex_ID": "A", "score": 0.125}, {"Vertex_ID": "B", "score": 0.125}, {"Vertex_ID": "C", "score": 0.125}, {"Vertex_ID": "D", "score": 0.125}, {"Vertex_ID": "E", "score": 0.125}, {"Vertex_ID": "F", "score": 0.125}, {"Vertex_ID": "G", "score": 0.125}, {"Vertex_ID": "H", "score": 0.125}]}]
2 changes: 1 addition & 1 deletion tests/data/baseline/centrality/pagerank/Empty.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"@@top_scores_heap": [{"Vertex_ID": "B", "score": 1}, {"Vertex_ID": "H", "score": 1}, {"Vertex_ID": "I", "score": 1}, {"Vertex_ID": "S", "score": 1}, {"Vertex_ID": "Q", "score": 1}, {"Vertex_ID": "F", "score": 1}, {"Vertex_ID": "J", "score": 1}, {"Vertex_ID": "D", "score": 1}, {"Vertex_ID": "E", "score": 1}, {"Vertex_ID": "P", "score": 1}, {"Vertex_ID": "M", "score": 1}, {"Vertex_ID": "R", "score": 1}, {"Vertex_ID": "N", "score": 1}, {"Vertex_ID": "K", "score": 1}, {"Vertex_ID": "O", "score": 1}, {"Vertex_ID": "C", "score": 1}, {"Vertex_ID": "A", "score": 1}, {"Vertex_ID": "L", "score": 1}, {"Vertex_ID": "G", "score": 1}, {"Vertex_ID": "T", "score": 1}]}]
[{"@@top_scores_heap": [{"Vertex_ID": "P", "score": 0}, {"Vertex_ID": "N", "score": 0}, {"Vertex_ID": "F", "score": 0}, {"Vertex_ID": "C", "score": 0}, {"Vertex_ID": "J", "score": 0}, {"Vertex_ID": "R", "score": 0}, {"Vertex_ID": "A", "score": 0}, {"Vertex_ID": "T", "score": 0}, {"Vertex_ID": "D", "score": 0}, {"Vertex_ID": "E", "score": 0}, {"Vertex_ID": "L", "score": 0}, {"Vertex_ID": "S", "score": 0}, {"Vertex_ID": "I", "score": 0}, {"Vertex_ID": "H", "score": 0}, {"Vertex_ID": "G", "score": 0}, {"Vertex_ID": "B", "score": 0}, {"Vertex_ID": "Q", "score": 0}, {"Vertex_ID": "O", "score": 0}, {"Vertex_ID": "K", "score": 0}, {"Vertex_ID": "M", "score": 0}]}]
2 changes: 1 addition & 1 deletion tests/data/baseline/centrality/pagerank/Hub_Spoke.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"@@top_scores_heap": [{"Vertex_ID": "A", "score": 7.642066}, {"Vertex_ID": "I", "score": 0.6504175}, {"Vertex_ID": "C", "score": 0.6504175}, {"Vertex_ID": "T", "score": 0.6504175}, {"Vertex_ID": "Q", "score": 0.6504175}, {"Vertex_ID": "L", "score": 0.6504175}, {"Vertex_ID": "B", "score": 0.6504175}, {"Vertex_ID": "M", "score": 0.6504175}, {"Vertex_ID": "K", "score": 0.6504175}, {"Vertex_ID": "N", "score": 0.6504175}, {"Vertex_ID": "F", "score": 0.6504175}, {"Vertex_ID": "R", "score": 0.6504175}, {"Vertex_ID": "H", "score": 0.6504175}, {"Vertex_ID": "S", "score": 0.6504175}, {"Vertex_ID": "D", "score": 0.6504175}, {"Vertex_ID": "E", "score": 0.6504175}, {"Vertex_ID": "G", "score": 0.6504175}, {"Vertex_ID": "J", "score": 0.6504175}, {"Vertex_ID": "O", "score": 0.6504175}, {"Vertex_ID": "P", "score": 0.6504175}]}]
[{"@@top_scores_heap": [{"Vertex_ID": "A", "score": 0.463517542849035}, {"Vertex_ID": "B", "score": 0.02823591879741922}, {"Vertex_ID": "C", "score": 0.02823591879741922}, {"Vertex_ID": "D", "score": 0.02823591879741922}, {"Vertex_ID": "E", "score": 0.02823591879741922}, {"Vertex_ID": "F", "score": 0.02823591879741922}, {"Vertex_ID": "G", "score": 0.02823591879741922}, {"Vertex_ID": "H", "score": 0.02823591879741922}, {"Vertex_ID": "I", "score": 0.02823591879741922}, {"Vertex_ID": "J", "score": 0.02823591879741922}, {"Vertex_ID": "K", "score": 0.02823591879741922}, {"Vertex_ID": "L", "score": 0.02823591879741922}, {"Vertex_ID": "M", "score": 0.02823591879741922}, {"Vertex_ID": "N", "score": 0.02823591879741922}, {"Vertex_ID": "O", "score": 0.02823591879741922}, {"Vertex_ID": "P", "score": 0.02823591879741922}, {"Vertex_ID": "Q", "score": 0.02823591879741922}, {"Vertex_ID": "R", "score": 0.02823591879741922}, {"Vertex_ID": "S", "score": 0.02823591879741922}, {"Vertex_ID": "T", "score": 0.02823591879741922}]}]
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"@@top_scores_heap": [{"Vertex_ID": "B", "score": 1}, {"Vertex_ID": "N", "score": 1}, {"Vertex_ID": "P", "score": 1}, {"Vertex_ID": "T", "score": 1}, {"Vertex_ID": "H", "score": 1}, {"Vertex_ID": "S", "score": 1}, {"Vertex_ID": "Q", "score": 1}, {"Vertex_ID": "L", "score": 1}, {"Vertex_ID": "D", "score": 1}, {"Vertex_ID": "E", "score": 1}, {"Vertex_ID": "I", "score": 1}, {"Vertex_ID": "G", "score": 1}, {"Vertex_ID": "O", "score": 1}, {"Vertex_ID": "C", "score": 1}, {"Vertex_ID": "F", "score": 1}, {"Vertex_ID": "J", "score": 1}, {"Vertex_ID": "R", "score": 1}, {"Vertex_ID": "K", "score": 1}, {"Vertex_ID": "M", "score": 1}, {"Vertex_ID": "A", "score": 0.15}]}]
[{"@@top_scores_heap": [{"Vertex_ID": "A", "score": 0.04796147421875003}, {"Vertex_ID": "B", "score": 0.050107290830592136}, {"Vertex_ID": "C", "score": 0.050107290830592136}, {"Vertex_ID": "D", "score": 0.050107290830592136}, {"Vertex_ID": "E", "score": 0.050107290830592136}, {"Vertex_ID": "F", "score": 0.050107290830592136}, {"Vertex_ID": "G", "score": 0.050107290830592136}, {"Vertex_ID": "H", "score": 0.050107290830592136}, {"Vertex_ID": "I", "score": 0.050107290830592136}, {"Vertex_ID": "J", "score": 0.050107290830592136}, {"Vertex_ID": "K", "score": 0.050107290830592136}, {"Vertex_ID": "L", "score": 0.050107290830592136}, {"Vertex_ID": "M", "score": 0.050107290830592136}, {"Vertex_ID": "N", "score": 0.050107290830592136}, {"Vertex_ID": "O", "score": 0.050107290830592136}, {"Vertex_ID": "P", "score": 0.050107290830592136}, {"Vertex_ID": "Q", "score": 0.050107290830592136}, {"Vertex_ID": "R", "score": 0.050107290830592136}, {"Vertex_ID": "S", "score": 0.050107290830592136}, {"Vertex_ID": "T", "score": 0.050107290830592136}]}]
2 changes: 1 addition & 1 deletion tests/data/baseline/centrality/pagerank/Line.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"@@top_scores_heap": [{"Vertex_ID": "S", "score": 1.140792}, {"Vertex_ID": "B", "score": 1.140792}, {"Vertex_ID": "C", "score": 1.109244}, {"Vertex_ID": "R", "score": 1.109244}, {"Vertex_ID": "E", "score": 1.037739}, {"Vertex_ID": "P", "score": 1.037739}, {"Vertex_ID": "Q", "score": 1.035503}, {"Vertex_ID": "D", "score": 1.035503}, {"Vertex_ID": "N", "score": 1.010813}, {"Vertex_ID": "G", "score": 1.010813}, {"Vertex_ID": "F", "score": 1.007152}, {"Vertex_ID": "O", "score": 1.007152}, {"Vertex_ID": "I", "score": 1.002082}, {"Vertex_ID": "L", "score": 1.002082}, {"Vertex_ID": "H", "score": 1.000986}, {"Vertex_ID": "M", "score": 1.000986}, {"Vertex_ID": "J", "score": 1.00026}, {"Vertex_ID": "K", "score": 1.00026}, {"Vertex_ID": "T", "score": 0.6554276}, {"Vertex_ID": "A", "score": 0.6554276}]}]
[{"@@top_scores_heap": [{"Vertex_ID": "A", "score": 0.03211926639226151}, {"Vertex_ID": "B", "score": 0.057926119511365004}, {"Vertex_ID": "C", "score": 0.05441422855961764}, {"Vertex_ID": "D", "score": 0.05245734353657548}, {"Vertex_ID": "E", "score": 0.05137048851726371}, {"Vertex_ID": "F", "score": 0.050764880552029296}, {"Vertex_ID": "G", "score": 0.05043133169155993}, {"Vertex_ID": "H", "score": 0.050248328845906194}, {"Vertex_ID": "I", "score": 0.05015421972563542}, {"Vertex_ID": "J", "score": 0.05011379266778576}, {"Vertex_ID": "K", "score": 0.05011379266778576}, {"Vertex_ID": "L", "score": 0.05015421972563542}, {"Vertex_ID": "M", "score": 0.050248328845906194}, {"Vertex_ID": "N", "score": 0.05043133169155993}, {"Vertex_ID": "O", "score": 0.050764880552029296}, {"Vertex_ID": "P", "score": 0.05137048851726371}, {"Vertex_ID": "Q", "score": 0.05245734353657548}, {"Vertex_ID": "R", "score": 0.05441422855961764}, {"Vertex_ID": "S", "score": 0.057926119511365004}, {"Vertex_ID": "T", "score": 0.03211926639226151}]}]
2 changes: 1 addition & 1 deletion tests/data/baseline/centrality/pagerank/Line_Directed.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"@@top_scores_heap": [{"Vertex_ID": "K", "score": 1}, {"Vertex_ID": "P", "score": 1}, {"Vertex_ID": "S", "score": 1}, {"Vertex_ID": "T", "score": 1}, {"Vertex_ID": "O", "score": 1}, {"Vertex_ID": "R", "score": 1}, {"Vertex_ID": "Q", "score": 1}, {"Vertex_ID": "M", "score": 1}, {"Vertex_ID": "L", "score": 1}, {"Vertex_ID": "N", "score": 1}, {"Vertex_ID": "J", "score": 0.8031256}, {"Vertex_ID": "I", "score": 0.768383}, {"Vertex_ID": "H", "score": 0.7275094}, {"Vertex_ID": "G", "score": 0.6794229}, {"Vertex_ID": "F", "score": 0.6228504}, {"Vertex_ID": "E", "score": 0.5562946}, {"Vertex_ID": "D", "score": 0.4779937}, {"Vertex_ID": "C", "score": 0.385875}, {"Vertex_ID": "B", "score": 0.2775}, {"Vertex_ID": "A", "score": 0.15}]}]
[{"@@top_scores_heap": [{"Vertex_ID": "A", "score": 0.010307351836075132}, {"Vertex_ID": "B", "score": 0.019068653273054674}, {"Vertex_ID": "C", "score": 0.026515787505709494}, {"Vertex_ID": "D", "score": 0.03284585745131274}, {"Vertex_ID": "E", "score": 0.03822640263682678}, {"Vertex_ID": "F", "score": 0.0427998335627278}, {"Vertex_ID": "G", "score": 0.046687200921397436}, {"Vertex_ID": "H", "score": 0.049991399441354015}, {"Vertex_ID": "I", "score": 0.05279989116293594}, {"Vertex_ID": "J", "score": 0.055187020230237145}, {"Vertex_ID": "K", "score": 0.05721598047140236}, {"Vertex_ID": "L", "score": 0.05894048784859933}, {"Vertex_ID": "M", "score": 0.0604062020468127}, {"Vertex_ID": "N", "score": 0.0616519348302555}, {"Vertex_ID": "O", "score": 0.06271067715089663}, {"Vertex_ID": "P", "score": 0.06361047219594917}, {"Vertex_ID": "Q", "score": 0.06437515748315642}, {"Vertex_ID": "R", "score": 0.06502499564640625}, {"Vertex_ID": "S", "score": 0.06558121834760403}, {"Vertex_ID": "T", "score": 0.06605347595728643}]}]
2 changes: 1 addition & 1 deletion tests/data/baseline/centrality/pagerank/Ring.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"@@top_scores_heap": [{"Vertex_ID": "F", "score": 1}, {"Vertex_ID": "L", "score": 1}, {"Vertex_ID": "J", "score": 1}, {"Vertex_ID": "K", "score": 1}, {"Vertex_ID": "M", "score": 1}, {"Vertex_ID": "O", "score": 1}, {"Vertex_ID": "C", "score": 1}, {"Vertex_ID": "T", "score": 1}, {"Vertex_ID": "I", "score": 1}, {"Vertex_ID": "P", "score": 1}, {"Vertex_ID": "G", "score": 1}, {"Vertex_ID": "B", "score": 1}, {"Vertex_ID": "D", "score": 1}, {"Vertex_ID": "E", "score": 1}, {"Vertex_ID": "R", "score": 1}, {"Vertex_ID": "A", "score": 1}, {"Vertex_ID": "H", "score": 1}, {"Vertex_ID": "N", "score": 1}, {"Vertex_ID": "S", "score": 1}, {"Vertex_ID": "Q", "score": 1}]}]
[{"@@top_scores_heap": [{"Vertex_ID": "A", "score": 0.05}, {"Vertex_ID": "B", "score": 0.05}, {"Vertex_ID": "C", "score": 0.05}, {"Vertex_ID": "D", "score": 0.05}, {"Vertex_ID": "E", "score": 0.05}, {"Vertex_ID": "F", "score": 0.05}, {"Vertex_ID": "G", "score": 0.05}, {"Vertex_ID": "H", "score": 0.05}, {"Vertex_ID": "I", "score": 0.05}, {"Vertex_ID": "J", "score": 0.05}, {"Vertex_ID": "K", "score": 0.05}, {"Vertex_ID": "L", "score": 0.05}, {"Vertex_ID": "M", "score": 0.05}, {"Vertex_ID": "N", "score": 0.05}, {"Vertex_ID": "O", "score": 0.05}, {"Vertex_ID": "P", "score": 0.05}, {"Vertex_ID": "Q", "score": 0.05}, {"Vertex_ID": "R", "score": 0.05}, {"Vertex_ID": "S", "score": 0.05}, {"Vertex_ID": "T", "score": 0.05}]}]
2 changes: 1 addition & 1 deletion tests/data/baseline/centrality/pagerank/Ring_Directed.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"@@top_scores_heap": [{"Vertex_ID": "T", "score": 1}, {"Vertex_ID": "L", "score": 1}, {"Vertex_ID": "S", "score": 1}, {"Vertex_ID": "N", "score": 1}, {"Vertex_ID": "P", "score": 1}, {"Vertex_ID": "K", "score": 1}, {"Vertex_ID": "I", "score": 1}, {"Vertex_ID": "F", "score": 1}, {"Vertex_ID": "J", "score": 1}, {"Vertex_ID": "H", "score": 1}, {"Vertex_ID": "A", "score": 1}, {"Vertex_ID": "G", "score": 1}, {"Vertex_ID": "D", "score": 1}, {"Vertex_ID": "E", "score": 1}, {"Vertex_ID": "O", "score": 1}, {"Vertex_ID": "C", "score": 1}, {"Vertex_ID": "R", "score": 1}, {"Vertex_ID": "M", "score": 1}, {"Vertex_ID": "B", "score": 1}, {"Vertex_ID": "Q", "score": 1}]}]
[{"@@top_scores_heap": [{"Vertex_ID": "A", "score": 0.05}, {"Vertex_ID": "B", "score": 0.05}, {"Vertex_ID": "C", "score": 0.05}, {"Vertex_ID": "D", "score": 0.05}, {"Vertex_ID": "E", "score": 0.05}, {"Vertex_ID": "F", "score": 0.05}, {"Vertex_ID": "G", "score": 0.05}, {"Vertex_ID": "H", "score": 0.05}, {"Vertex_ID": "I", "score": 0.05}, {"Vertex_ID": "J", "score": 0.05}, {"Vertex_ID": "K", "score": 0.05}, {"Vertex_ID": "L", "score": 0.05}, {"Vertex_ID": "M", "score": 0.05}, {"Vertex_ID": "N", "score": 0.05}, {"Vertex_ID": "O", "score": 0.05}, {"Vertex_ID": "P", "score": 0.05}, {"Vertex_ID": "Q", "score": 0.05}, {"Vertex_ID": "R", "score": 0.05}, {"Vertex_ID": "S", "score": 0.05}, {"Vertex_ID": "T", "score": 0.05}]}]
2 changes: 1 addition & 1 deletion tests/data/baseline/centrality/pagerank/Tree.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"@@top_scores_heap": [{"Vertex_ID": "C", "score": 1.507026}, {"Vertex_ID": "E", "score": 1.503473}, {"Vertex_ID": "F", "score": 1.49345}, {"Vertex_ID": "G", "score": 1.49345}, {"Vertex_ID": "I", "score": 1.485403}, {"Vertex_ID": "H", "score": 1.485403}, {"Vertex_ID": "D", "score": 1.483297}, {"Vertex_ID": "B", "score": 1.367901}, {"Vertex_ID": "J", "score": 1.09461}, {"Vertex_ID": "A", "score": 0.9330747}, {"Vertex_ID": "O", "score": 0.6221145}, {"Vertex_ID": "L", "score": 0.6221145}, {"Vertex_ID": "N", "score": 0.6221145}, {"Vertex_ID": "M", "score": 0.6221145}, {"Vertex_ID": "R", "score": 0.6187774}, {"Vertex_ID": "P", "score": 0.6187774}, {"Vertex_ID": "Q", "score": 0.6187774}, {"Vertex_ID": "S", "score": 0.6187774}, {"Vertex_ID": "T", "score": 0.6181464}, {"Vertex_ID": "K", "score": 0.5711977}]}]
[{"@@top_scores_heap": [{"Vertex_ID": "A", "score": 0.04753738488500107}, {"Vertex_ID": "B", "score": 0.06909959193353465}, {"Vertex_ID": "C", "score": 0.07220759154455525}, {"Vertex_ID": "D", "score": 0.07130204500748626}, {"Vertex_ID": "E", "score": 0.07480080379154676}, {"Vertex_ID": "F", "score": 0.0785393029006319}, {"Vertex_ID": "G", "score": 0.0785393029006319}, {"Vertex_ID": "H", "score": 0.07804404762676867}, {"Vertex_ID": "I", "score": 0.07804404762676867}, {"Vertex_ID": "J", "score": 0.054902205374844214}, {"Vertex_ID": "K", "score": 0.02869374578323252}, {"Vertex_ID": "L", "score": 0.02975219252757403}, {"Vertex_ID": "M", "score": 0.02975219252757403}, {"Vertex_ID": "N", "score": 0.02975219252757403}, {"Vertex_ID": "O", "score": 0.02975219252757403}, {"Vertex_ID": "P", "score": 0.02961198234571507}, {"Vertex_ID": "Q", "score": 0.02961198234571507}, {"Vertex_ID": "R", "score": 0.02961198234571507}, {"Vertex_ID": "S", "score": 0.02961198234571507}, {"Vertex_ID": "T", "score": 0.030833231131841908}]}]
2 changes: 1 addition & 1 deletion tests/data/baseline/centrality/pagerank/Tree_Directed.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"@@top_scores_heap": [{"Vertex_ID": "T", "score": 1}, {"Vertex_ID": "S", "score": 1}, {"Vertex_ID": "K", "score": 1}, {"Vertex_ID": "L", "score": 1}, {"Vertex_ID": "O", "score": 1}, {"Vertex_ID": "R", "score": 1}, {"Vertex_ID": "N", "score": 1}, {"Vertex_ID": "M", "score": 1}, {"Vertex_ID": "P", "score": 1}, {"Vertex_ID": "Q", "score": 1}, {"Vertex_ID": "I", "score": 0.2523586}, {"Vertex_ID": "H", "score": 0.2523586}, {"Vertex_ID": "J", "score": 0.2523586}, {"Vertex_ID": "E", "score": 0.2408437}, {"Vertex_ID": "D", "score": 0.2408437}, {"Vertex_ID": "G", "score": 0.2408437}, {"Vertex_ID": "F", "score": 0.2408437}, {"Vertex_ID": "C", "score": 0.21375}, {"Vertex_ID": "B", "score": 0.21375}, {"Vertex_ID": "A", "score": 0.15}]}]
[{"@@top_scores_heap": [{"Vertex_ID": "A", "score": 0.030283038177750167}, {"Vertex_ID": "B", "score": 0.043153655387605856}, {"Vertex_ID": "C", "score": 0.043153655387605856}, {"Vertex_ID": "D", "score": 0.04862366075639622}, {"Vertex_ID": "E", "score": 0.04862366075639622}, {"Vertex_ID": "F", "score": 0.04862366075639622}, {"Vertex_ID": "G", "score": 0.04862366075639622}, {"Vertex_ID": "H", "score": 0.05094809395836327}, {"Vertex_ID": "I", "score": 0.05094809395836327}, {"Vertex_ID": "J", "score": 0.05094809395836327}, {"Vertex_ID": "K", "score": 0.05094809395836327}, {"Vertex_ID": "L", "score": 0.05094809395836327}, {"Vertex_ID": "M", "score": 0.05094809395836327}, {"Vertex_ID": "N", "score": 0.05094809395836327}, {"Vertex_ID": "O", "score": 0.05094809395836327}, {"Vertex_ID": "P", "score": 0.051935549088716185}, {"Vertex_ID": "Q", "score": 0.051935549088716185}, {"Vertex_ID": "R", "score": 0.051935549088716185}, {"Vertex_ID": "S", "score": 0.051935549088716185}, {"Vertex_ID": "T", "score": 0.07358805999968221}]}]
Binary file modified tests/data/baseline/ml/fastRP.json.gz
Binary file not shown.
6 changes: 4 additions & 2 deletions tests/run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
clear
python3 test/setup.py &&
python3 test/baseline/create_baselines.py &&
pytest test/test_centrality.py #::TestCentrality::test_degree_centrality1 #test/test_ml.py
# python3 test/baseline/create_baselines.py &&
# pytest test/test_centrality.py::TestCentrality::test_degree_centrality1 #test/test_ml.py
pytest test/test_centrality.py::TestCentrality::test_pagerank
# pytest test/test_ml.py
echo 'done'
5 changes: 3 additions & 2 deletions tests/test/baseline/algos/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from .degree_cent import *
from .fastrp import fastrp_wrapper as fastrp
from .degree_centrality import *
from .fastrp import FastRPBaseline
from .pagerank import PagerankBaseline
7 changes: 7 additions & 0 deletions tests/test/baseline/algos/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from abc import ABC, abstractmethod


class Baseline(ABC):
@abstractmethod
def run(self):
...
15 changes: 15 additions & 0 deletions tests/test/baseline/algos/common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import networkx as nx


def create_graph(edges, weights=False, directed=False) -> nx.Graph:
if directed:
g = nx.DiGraph()
else:
g = nx.Graph()
if weights:
# make weights floats
edges = [[a, b, float(c)] for a, b, c in edges]
g.add_weighted_edges_from(edges)
else:
g.add_edges_from(edges)
return g
46 changes: 0 additions & 46 deletions tests/test/baseline/algos/degree_cent.py

This file was deleted.

Loading

0 comments on commit 15cf6dc

Please sign in to comment.