diff --git a/evalNE_script.py b/evalNE_script.py index e36d76303dd489ad9f12c37c1bd2d18af33d84d4..99d70ee179c2f6fe7bc083b6201979be50af3972 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 1777fa706aed8383e2bd4343d0d14da23ff7abb0..2a3a2ff190fe08b182e1bca710bf54f41beebe76 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,