From f5f22683b10cc5f0181a3b7a67b638a95c5bd5c5 Mon Sep 17 00:00:00 2001
From: Fize Jacques <jacques.fize@cirad.fr>
Date: Wed, 10 Feb 2021 11:10:57 +0100
Subject: [PATCH] Debug

---
 evalNE_script.py                 |  5 +++--
 generate_theoric_random_graph.py | 34 ++++++++++++++++----------------
 2 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/evalNE_script.py b/evalNE_script.py
index e36d763..99d70ee 100644
--- a/evalNE_script.py
+++ b/evalNE_script.py
@@ -14,6 +14,7 @@ parser.add_argument("graph_filename")
 parser.add_argument("-n","--network-embedding",action="store_true",help="If you want to use neural network embedding for link prediction")
 parser.add_argument("-v","--verbose",action="store_true")
 parser.add_argument("-f","--format",default="gexf",choices=["gexf","gml","txt"])
+parser.add_argument("-t","--train-frac",default=0.9,type=float)
 
 args = parser.parse_args()
 
@@ -41,9 +42,9 @@ log("Building link prediction dataset...")
 # Create an evaluator and generate train/test edge split
 traintest_split = LPEvalSplit()
 try:
-    traintest_split.compute_splits(G, split_alg="spanning_tree", train_frac=0.9, fe_ratio=1)
+    traintest_split.compute_splits(G, split_alg="spanning_tree", train_frac=args.train_frac, fe_ratio=1)
 except ValueError:
-    traintest_split.compute_splits(G, split_alg="fast", train_frac=0.9, fe_ratio=1)
+    traintest_split.compute_splits(G, split_alg="fast", train_frac=args.train_frac, fe_ratio=1)
 nee = LPEvaluator(traintest_split)
 
 log("Dataset Built !")
diff --git a/generate_theoric_random_graph.py b/generate_theoric_random_graph.py
index 1777fa7..2a3a2ff 100644
--- a/generate_theoric_random_graph.py
+++ b/generate_theoric_random_graph.py
@@ -19,7 +19,7 @@ args = parser.parse_args()
 
 GRAPH_SIZE = [80,800]
 EDGE_SIZE = [2,3]
-sample_per_params  = 1
+sample_per_params  = 4
 
 OUTPUT_DIR = args.output_dir
 if not os.path.exists(OUTPUT_DIR):
@@ -27,22 +27,22 @@ if not os.path.exists(OUTPUT_DIR):
 
 
 parameters = {
-    "stochastic_block_model_graph": {
-        "nb_nodes":GRAPH_SIZE,
-        "nb_edges":EDGE_SIZE,
-        "nb_com" :[2,5,8,16],
-        "percentage_edge_betw":[0.1,0.01]
-    },
-    "ER_graph": {
-        "nb_nodes":GRAPH_SIZE,
-        "nb_edges":EDGE_SIZE
-    },
-    "powerlaw_graph": {  # configuration_model
-        "nb_nodes":GRAPH_SIZE,
-        "nb_edges":EDGE_SIZE,
-        "exponent":[2,3],
-        "tries":[100]
-    },
+    # "stochastic_block_model_graph": {
+    #     "nb_nodes":GRAPH_SIZE,
+    #     "nb_edges":EDGE_SIZE,
+    #     "nb_com" :[2,5,8,16],
+    #     "percentage_edge_betw":[0.1,0.01]
+    # },
+    # "ER_graph": {
+    #     "nb_nodes":GRAPH_SIZE,
+    #     "nb_edges":EDGE_SIZE
+    # },
+    # "powerlaw_graph": {  # configuration_model
+    #     "nb_nodes":GRAPH_SIZE,
+    #     "nb_edges":EDGE_SIZE,
+    #     "exponent":[2,3],
+    #     "tries":[100]
+    # },
     "spatial_graph":{
         "nb_nodes":GRAPH_SIZE,
         "nb_edges":EDGE_SIZE,
-- 
GitLab