Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mhc_rank
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Patrick Skillman-Lawrence
mhc_rank
Commits
8c8ee19b
Commit
8c8ee19b
authored
9 years ago
by
Alex Rubinsteyn
Browse files
Options
Downloads
Patches
Plain Diff
moved fixed dataset paths into own module
parent
a2857ed2
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
experiments/dataset_paths.py
+15
-0
15 additions, 0 deletions
experiments/dataset_paths.py
experiments/model-selection.py
+2
-29
2 additions, 29 deletions
experiments/model-selection.py
experiments/model_selection_helpers.py
+3
-3
3 additions, 3 deletions
experiments/model_selection_helpers.py
with
20 additions
and
32 deletions
experiments/dataset_paths.py
0 → 100644
+
15
−
0
View file @
8c8ee19b
from
os.path
import
join
from
mhcflurry.paths
import
CLASS1_DATA_DIRECTORY
PETERS2009_CSV_FILENAME
=
"
bdata.2009.mhci.public.1.txt
"
PETERS2009_CSV_PATH
=
join
(
CLASS1_DATA_DIRECTORY
,
PETERS2009_CSV_FILENAME
)
PETERS2013_CSV_FILENAME
=
"
bdata.20130222.mhci.public.1.txt
"
PETERS2013_CSV_PATH
=
join
(
CLASS1_DATA_DIRECTORY
,
PETERS2013_CSV_FILENAME
)
BLIND_2013_CSV_FILENAME
=
"
bdata.2013.mhci.public.blind.1.txt
"
BLIND_2013_CSV_PATH
=
join
(
CLASS1_DATA_DIRECTORY
,
BLIND_2013_CSV_FILENAME
)
COMBINED_CSV_FILENAME
=
"
combined_human_class1_dataset.csv
"
COMBINED_CSV_PATH
=
join
(
CLASS1_DATA_DIRECTORY
,
COMBINED_CSV_FILENAME
)
This diff is collapsed.
Click to expand it.
experiments/model-selection.py
+
2
−
29
View file @
8c8ee19b
...
...
@@ -20,7 +20,6 @@ from __future__ import (
absolute_import
,
unicode_literals
)
from
os.path
import
join
import
argparse
from
time
import
time
...
...
@@ -29,9 +28,7 @@ import numpy as np
import
pandas
as
pd
from
mhcflurry.data_helpers
import
load_data
from
mhcflurry.paths
import
(
CLASS1_DATA_DIRECTORY
)
from
model_configs
import
(
generate_all_model_configs
,
...
...
@@ -53,19 +50,7 @@ from model_selection_helpers import (
from
summarize_model_results
import
hyperparameter_performance
from
arg_parsing
import
parse_int_list
,
parse_float_list
,
parse_string_list
PETERS2009_CSV_FILENAME
=
"
bdata.2009.mhci.public.1.txt
"
PETERS2009_CSV_PATH
=
join
(
CLASS1_DATA_DIRECTORY
,
PETERS2009_CSV_FILENAME
)
PETERS2013_CSV_FILENAME
=
"
bdata.20130222.mhci.public.1.txt
"
PETERS2013_CSV_PATH
=
join
(
CLASS1_DATA_DIRECTORY
,
PETERS2013_CSV_FILENAME
)
BLIND_2013_CSV_FILENAME
=
"
bdata.2013.mhci.public.blind.1.txt
"
BLIND_2013_CSV_PATH
=
join
(
CLASS1_DATA_DIRECTORY
,
BLIND_2013_CSV_FILENAME
)
COMBINED_CSV_FILENAME
=
"
combined_human_class1_dataset.csv
"
COMBINED_CSV_PATH
=
join
(
CLASS1_DATA_DIRECTORY
,
COMBINED_CSV_FILENAME
)
from
dataset_paths
import
PETERS2009_CSV_PATH
parser
=
argparse
.
ArgumentParser
()
...
...
@@ -160,18 +145,6 @@ parser.add_argument(
type
=
parse_string_list
,
help
=
"
Comma separated list of optimization methods
"
)
parser
.
add_argument
(
"
--ensemble-size
"
,
default
=
[
0
],
type
=
parse_int_list
,
help
=
"
Number of classifiers in ensemble, default=0 (don
'
t use an ensemble)
"
)
parser
.
add_argument
(
"
--ensemble-fraction-dataset
"
,
default
=
[
1.0
],
type
=
parse_float_list
,
help
=
"
Size of ensemble training sets (sampled with replacement)
"
)
def
evaluate_model_configs
(
configs
,
results_filename
,
train_fn
):
all_dataframes
=
[]
...
...
This diff is collapsed.
Click to expand it.
experiments/model_selection_helpers.py
+
3
−
3
View file @
8c8ee19b
...
...
@@ -37,10 +37,10 @@ def f1_score(true_label, label_pred):
tp
=
(
true_label
&
label_pred
).
sum
()
fp
=
((
~
true_label
)
&
label_pred
).
sum
()
fn
=
(
true_label
&
(
~
label_pred
)).
sum
()
sensitivity
=
(
tp
/
float
(
tp
+
fn
))
if
(
tp
+
fn
)
>
0
else
0.0
recall
=
(
tp
/
float
(
tp
+
fn
))
if
(
tp
+
fn
)
>
0
else
0.0
precision
=
(
tp
/
float
(
tp
+
fp
))
if
(
tp
+
fp
)
>
0
else
0.0
if
(
precision
+
sensitivity
)
>
0
:
return
(
2
*
precision
*
sensitivity
)
/
(
precision
+
sensitivity
)
if
(
precision
+
recall
)
>
0
:
return
(
2
*
precision
*
recall
)
/
(
precision
+
recall
)
else
:
return
0.0
...
...
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