Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cami
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chow Castro, Marcos
cami
Commits
c86cfaf6
Commit
c86cfaf6
authored
1 year ago
by
mlmial
Browse files
Options
Downloads
Patches
Plain Diff
made seed variation runable
parent
2518dde2
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
cami_src/cami_suite.py
+18
-5
18 additions, 5 deletions
cami_src/cami_suite.py
cami_src/evaluation_scripts/seed_variation_script.py
+9
-7
9 additions, 7 deletions
cami_src/evaluation_scripts/seed_variation_script.py
with
27 additions
and
12 deletions
cami_src/cami_suite.py
+
18
−
5
View file @
c86cfaf6
...
@@ -357,13 +357,26 @@ class cami():
...
@@ -357,13 +357,26 @@ class cami():
for
tool
in
result_sets
:
for
tool
in
result_sets
:
result_sets
[
tool
]
-=
set
(
self
.
seed_lst
)
result_sets
[
tool
]
-=
set
(
self
.
seed_lst
)
params_tr
=
{
'
hub_penalty
'
:
[
0.25
],
params_0
=
{
'
function
'
:
{
'
union
'
:
cami_v1
.
make_union
,
'
intersection
'
:
cami_v1
.
make_intersection
,
'
first_neighbours
'
:
cami_v1
.
make_first_neighbor_result_set
}
}
params_tr1
=
{
'
hub_penalty
'
:
[
0.5
],
'
damping_factor
'
:
[
0.75
],
'
damping_factor
'
:
[
0.75
],
'
confidence_level
'
:
[
0.8
],
'
confidence_level
'
:
[
0.8
],
'
ranking
'
:
[
'
trustrank
'
],
'
ranking
'
:
[
'
trustrank
'
],
'
function
'
:
{
'
cami_v
3
'
:
cami_v
3
.
run_cami
}}
'
function
'
:
{
'
cami_v
2
'
:
cami_v
2
.
run_cami
}}
cami_setting_list
=
generate_param_combinations
(
params_tr
)
params_tr2
=
{
'
hub_penalty
'
:
[
0.5
],
'
damping_factor
'
:
[
0.85
],
'
confidence_level
'
:
[
0.65
],
'
ranking
'
:
[
'
trustrank
'
],
'
function
'
:
{
'
cami_v3
'
:
cami_v3
.
run_cami
}
}
cami_setting_list
=
generate_param_combinations
(
params_0
)
+
\
generate_param_combinations
(
params_tr1
)
+
\
generate_param_combinations
(
params_tr2
)
camis
=
{}
camis
=
{}
for
setting
in
cami_setting_list
:
for
setting
in
cami_setting_list
:
...
...
This diff is collapsed.
Click to expand it.
cami_src/evaluation_scripts/seed_variation_script.py
+
9
−
7
View file @
c86cfaf6
...
@@ -52,7 +52,9 @@ def make_seedvariation(cami, n_iterations, removal_frac=0.2, vis=False, plot=Tru
...
@@ -52,7 +52,9 @@ def make_seedvariation(cami, n_iterations, removal_frac=0.2, vis=False, plot=Tru
for
tool
in
prediction_tools
:
for
tool
in
prediction_tools
:
res_table
.
write
(
f
'
\t
{
tool
}
_msr_ks_pvalue
'
)
res_table
.
write
(
f
'
\t
{
tool
}
_msr_ks_pvalue
'
)
with
open
(
os
.
path
.
join
(
cami
.
tmp_dir
,
f
'
{
used_tools
[
0
]
}
_
{
cami
.
uid
}
_relevance_scores.tsv)
'
),
'
r
'
)
as
f
:
# if relevance scores file exsits:
if
os
.
path
.
exists
(
os
.
path
.
join
(
cami
.
tmp_dir
,
f
'
{
used_tools
[
0
]
}
_
{
identifier
}
_relevance_scores.tsv)
'
)):
with
open
(
os
.
path
.
join
(
cami
.
tmp_dir
,
f
'
{
used_tools
[
0
]
}
_
{
identifier
}
_relevance_scores.tsv)
'
),
'
r
'
)
as
f
:
for
line
in
f
:
for
line
in
f
:
val_name
=
line
.
split
(
'
\t
'
)[
0
]
val_name
=
line
.
split
(
'
\t
'
)[
0
]
redisc_table
.
write
(
f
'
\t
{
val_name
}
'
)
redisc_table
.
write
(
f
'
\t
{
val_name
}
'
)
...
@@ -141,8 +143,8 @@ def make_seedvariation(cami, n_iterations, removal_frac=0.2, vis=False, plot=Tru
...
@@ -141,8 +143,8 @@ def make_seedvariation(cami, n_iterations, removal_frac=0.2, vis=False, plot=Tru
p_val
=
kolmogorov_smirnoff
.
calculate_ks_p_value
(
list
(
module_size_dict
[
tool
]),
p_val
=
kolmogorov_smirnoff
.
calculate_ks_p_value
(
list
(
module_size_dict
[
tool
]),
list
(
module_size_dict
[
pred_tool
]))
list
(
module_size_dict
[
pred_tool
]))
res_table
.
write
(
f
'
\t
{
p_val
}
'
)
res_table
.
write
(
f
'
\t
{
p_val
}
'
)
if
os
.
path
.
exists
(
os
.
path
.
join
(
cami
.
tmp_dir
,
f
'
{
used_tools
[
0
]
}
_
{
identifier
}
_relevance_scores.tsv)
'
)):
with
open
(
os
.
path
.
join
(
cami
.
tmp_dir
,
f
'
{
tool
}
_
{
cami
.
uid
}
_relevance_scores.tsv
)
'
),
'
r
'
)
as
f
:
with
open
(
os
.
path
.
join
(
cami
.
tmp_dir
,
f
'
{
tool
}
_
{
identifier
}
_relevance_scores.tsv
'
),
'
r
'
)
as
f
:
for
line
in
f
:
for
line
in
f
:
rel_score
=
line
.
split
(
'
\t
'
)[
1
].
strip
()
rel_score
=
line
.
split
(
'
\t
'
)[
1
].
strip
()
res_table
.
write
(
f
'
\t
{
rel_score
}
'
)
res_table
.
write
(
f
'
\t
{
rel_score
}
'
)
...
...
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