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
b50a7ffb
Commit
b50a7ffb
authored
4 years ago
by
Fize Jacques
Browse files
Options
Downloads
Patches
Plain Diff
debug
parent
9ee35151
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
eval_mixed_model.py
+5
-2
5 additions, 2 deletions
eval_mixed_model.py
with
5 additions
and
2 deletions
eval_mixed_model.py
+
5
−
2
View file @
b50a7ffb
...
@@ -39,9 +39,11 @@ parser.add_argument("alpha",type=float)
...
@@ -39,9 +39,11 @@ parser.add_argument("alpha",type=float)
parser
.
add_argument
(
"
nb_iterations
"
,
type
=
int
)
parser
.
add_argument
(
"
nb_iterations
"
,
type
=
int
)
parser
.
add_argument
(
'
-f
'
,
'
--features
'
,
help
=
'
Feature(s) used in the model training
'
,
type
=
str
)
parser
.
add_argument
(
'
-f
'
,
'
--features
'
,
help
=
'
Feature(s) used in the model training
'
,
type
=
str
)
parser
.
add_argument
(
"
-v
"
,
"
--verbose
"
,
action
=
"
store_true
"
)
parser
.
add_argument
(
"
-v
"
,
"
--verbose
"
,
action
=
"
store_true
"
)
parser
.
add_argument
(
"
-t
"
,
"
--timeout
"
,
default
=
30
,
type
=
int
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
# COMMAND LINE ARGS VALUES
GRAPH_NODE_NB
=
args
.
nb_nodes
GRAPH_NODE_NB
=
args
.
nb_nodes
GRAPH_EDGE_NB
=
args
.
nb_edges
GRAPH_EDGE_NB
=
args
.
nb_edges
ALPHA
=
args
.
alpha
ALPHA
=
args
.
alpha
...
@@ -49,7 +51,8 @@ NB_COM = args.nb_com
...
@@ -49,7 +51,8 @@ NB_COM = args.nb_com
NB_ITERATION
=
args
.
nb_iterations
NB_ITERATION
=
args
.
nb_iterations
VERBOSE
=
args
.
verbose
VERBOSE
=
args
.
verbose
FEATURES
=
set
(
args
.
features
.
split
(
"
,
"
))
FEATURES
=
set
(
args
.
features
.
split
(
"
,
"
))
TIMEOUT
=
60
TIMEOUT
=
args
.
timeout
dist
=
lambda
a
,
b
:
np
.
linalg
.
norm
(
a
-
b
)
**
2
dist
=
lambda
a
,
b
:
np
.
linalg
.
norm
(
a
-
b
)
**
2
hash_func
=
lambda
x
:
"
_
"
.
join
(
sorted
([
str
(
x
[
0
]),
str
(
x
[
1
])]))
hash_func
=
lambda
x
:
"
_
"
.
join
(
sorted
([
str
(
x
[
0
]),
str
(
x
[
1
])]))
...
@@ -63,7 +66,7 @@ def get_aucs(G):
...
@@ -63,7 +66,7 @@ def get_aucs(G):
auc_spatial
=
nee
.
evaluate_baseline
(
method
=
"
spatial_link_prediction
"
,
timeout
=
TIMEOUT
).
test_scores
.
auroc
()
auc_spatial
=
nee
.
evaluate_baseline
(
method
=
"
spatial_link_prediction
"
,
timeout
=
TIMEOUT
).
test_scores
.
auroc
()
auc_sbm
=
nee
.
evaluate_baseline
(
method
=
"
stochastic_block_model
"
,
timeout
=
TIMEOUT
).
test_scores
.
auroc
()
auc_sbm
=
nee
.
evaluate_baseline
(
method
=
"
stochastic_block_model
"
,
timeout
=
TIMEOUT
).
test_scores
.
auroc
()
except
:
except
:
print
(
"
Could not compu
y
te AUC !
"
)
print
(
"
Could not compute AUC !
"
)
return
auc_sbm
,
auc_spatial
return
auc_sbm
,
auc_spatial
dist
=
lambda
a
,
b
:
np
.
linalg
.
norm
(
a
-
b
)
dist
=
lambda
a
,
b
:
np
.
linalg
.
norm
(
a
-
b
)
...
...
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