Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
linkprediction_depo
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jacques Fize
linkprediction_depo
Commits
f5f22683
Commit
f5f22683
authored
4 years ago
by
Fize Jacques
Browse files
Options
Downloads
Patches
Plain Diff
Debug
parent
5149144a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
evalNE_script.py
+3
-2
3 additions, 2 deletions
evalNE_script.py
generate_theoric_random_graph.py
+17
-17
17 additions, 17 deletions
generate_theoric_random_graph.py
with
20 additions
and
19 deletions
evalNE_script.py
+
3
−
2
View file @
f5f22683
...
...
@@ -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 !
"
)
...
...
This diff is collapsed.
Click to expand it.
generate_theoric_random_graph.py
+
17
−
17
View file @
f5f22683
...
...
@@ -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
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment