Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NCD data aggregation and classification
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
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
flg_bachelors
TS
2024
NCD data aggregation and classification
Commits
1633f84c
Commit
1633f84c
authored
1 month ago
by
Ivan Pavlovich
Browse files
Options
Downloads
Patches
Plain Diff
Modified graph script to ignore models with no result file
parent
0b931ad7
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
testModel/show_results.py
+15
-1
15 additions, 1 deletion
testModel/show_results.py
with
16 additions
and
1 deletion
.gitignore
+
1
−
0
View file @
1633f84c
dataSources/PubMed/tmp/*
dataSources/PubMed/tmp/*
testModel/results/graphs/*
.venv
.venv
\ No newline at end of file
This diff is collapsed.
Click to expand it.
testModel/show_results.py
+
15
−
1
View file @
1633f84c
...
@@ -26,17 +26,31 @@ models = [model for model in MODELS.keys()]
...
@@ -26,17 +26,31 @@ models = [model for model in MODELS.keys()]
metrics
=
[
"
TPR
"
,
"
TNR
"
,
"
Precision
"
,
"
F1
"
]
metrics
=
[
"
TPR
"
,
"
TNR
"
,
"
Precision
"
,
"
F1
"
]
models_results
=
{}
models_results
=
{}
usable_models
=
[]
for
model
in
models
:
for
model
in
models
:
with
open
(
f
"
{
RESULTS_DIR
}
/
{
get_filename
(
model
)
}
.json
"
,
"
r
"
,
encoding
=
"
utf-8
"
)
as
file
:
file_path
=
f
"
{
RESULTS_DIR
}
/
{
get_filename
(
model
)
}
.json
"
if
not
os
.
path
.
exists
(
file_path
):
print
(
f
"
Warning: File
{
file_path
}
not found. Skipping model
{
model
}
.
"
)
continue
with
open
(
file_path
,
"
r
"
,
encoding
=
"
utf-8
"
)
as
file
:
data
=
json
.
load
(
file
)
data
=
json
.
load
(
file
)
if
"
results
"
not
in
data
:
print
(
f
"
Warning:
'
results
'
key missing in
{
file_path
}
. Skipping model
{
model
}
.
"
)
continue
for
length_category
in
length_categories
:
for
length_category
in
length_categories
:
values
=
[
data
[
"
results
"
][
length_category
][
metric
]
for
metric
in
metrics
]
values
=
[
data
[
"
results
"
][
length_category
][
metric
]
for
metric
in
metrics
]
data
[
"
results
"
][
length_category
]
=
values
data
[
"
results
"
][
length_category
]
=
values
models_results
[
model
]
=
data
[
"
results
"
]
models_results
[
model
]
=
data
[
"
results
"
]
usable_models
.
append
(
model
)
models
=
usable_models
print
(
"
GENERATING BAR PLOTS
"
)
print
(
"
GENERATING BAR PLOTS
"
)
...
...
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