Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
journal_eiv
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
Container 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
Jörg Martin
journal_eiv
Commits
a09559e6
Commit
a09559e6
authored
3 years ago
by
Jörg Martin
Browse files
Options
Downloads
Patches
Plain Diff
Allowed for incomplete entries create_tabular
parent
02042a9a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Experiments/create_tabular.py
+23
-6
23 additions, 6 deletions
Experiments/create_tabular.py
Experiments/train_eiv.py
+1
-1
1 addition, 1 deletion
Experiments/train_eiv.py
Experiments/train_noneiv.py
+1
-1
1 addition, 1 deletion
Experiments/train_noneiv.py
with
25 additions
and
8 deletions
Experiments/create_tabular.py
+
23
−
6
View file @
a09559e6
import
os
import
glob
import
argparse
import
json
metrics_to_display
=
[
'
rmse
'
,
'
logdens
'
,
'
bias
'
,
'
coverage_n
ormalized
'
]
metrics_to_display
=
[
'
rmse
'
,
'
logdens
'
,
'
bias
'
,
'
true_
coverage_n
umerical
'
]
show_incomplete
=
True
list_of_result_files
=
glob
.
glob
(
os
.
path
.
join
(
'
results
'
,
'
*.json
'
))
results
=
{}
...
...
@@ -12,6 +13,16 @@ for filename in list_of_result_files:
with
open
(
filename
,
'
r
'
)
as
f
:
results
[
data
]
=
json
.
load
(
f
)
def
save_readout
(
dictionary
,
key
):
"""
Returns the value of the `dictionary` for `key`, unless
the later doesn
'
t exist, in which case (None,None) is returned.
"""
try
:
return
dictionary
[
key
]
except
KeyError
:
return
(
None
,
None
)
## header
header_string
=
'
DATA
'
offset
=
20
...
...
@@ -21,19 +32,25 @@ print(header_string)
print
(
offset
*
'
_
'
+
70
*
'
_
'
)
## results
for
data
in
results
.
keys
():
noneiv_results
=
[
results
[
data
][
'
noneiv
'
]
[
metric
]
noneiv_results
=
[
save_readout
(
results
[
data
][
'
noneiv
'
]
,
metric
)
for
metric
in
metrics_to_display
]
noneiv_row_name
=
f
'
{
data
}
- nonEiV:
'
noneiv_results_string
=
noneiv_row_name
+
(
offset
-
len
(
noneiv_row_name
))
*
'
'
for
[
metric_mean
,
metric_std
]
in
noneiv_results
:
noneiv_results_string
+=
f
'
{
metric_mean
:
.
3
f
}
(
{
metric_std
:
.
3
f
}
)
'
if
metric_mean
is
None
:
noneiv_results_string
+=
'
None (None)
'
else
:
noneiv_results_string
+=
f
'
{
metric_mean
:
.
3
f
}
(
{
metric_std
:
.
3
f
}
)
'
print
(
noneiv_results_string
)
eiv_results
=
[
results
[
data
][
'
eiv
'
]
[
metric
]
eiv_results
=
[
save_readout
(
results
[
data
][
'
eiv
'
]
,
metric
)
for
metric
in
metrics_to_display
]
eiv_row_name
=
f
'
{
data
}
- EiV:
'
eiv_results_string
=
eiv_row_name
+
(
offset
-
len
(
eiv_row_name
))
*
'
'
for
[
metric_mean
,
metric_std
]
in
eiv_results
:
eiv_results_string
+=
f
'
{
metric_mean
:
.
3
f
}
(
{
metric_std
:
.
3
f
}
)
'
if
metric_mean
is
None
:
eiv_results_string
+=
'
None (None)
'
else
:
eiv_results_string
+=
f
'
{
metric_mean
:
.
3
f
}
(
{
metric_std
:
.
3
f
}
)
'
print
(
eiv_results_string
)
print
(
offset
*
'
_
'
+
70
*
'
_
'
)
...
...
This diff is collapsed.
Click to expand it.
Experiments/train_eiv.py
+
1
−
1
View file @
a09559e6
...
...
@@ -19,7 +19,7 @@ from EIVTrainingRoutines import train_and_store, loss_functions
# read in data via --data option
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"
--data
"
,
help
=
"
Loads data
"
,
default
=
'
california
'
)
parser
.
add_argument
(
"
--data
"
,
help
=
"
Loads data
"
,
default
=
'
linear
'
)
parser
.
add_argument
(
"
--no-autoindent
"
,
help
=
""
,
action
=
"
store_true
"
)
# to avoid conflics in IPython
args
=
parser
.
parse_args
()
...
...
This diff is collapsed.
Click to expand it.
Experiments/train_noneiv.py
+
1
−
1
View file @
a09559e6
...
...
@@ -19,7 +19,7 @@ from EIVTrainingRoutines import train_and_store, loss_functions
# read in data via --data option
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"
--data
"
,
help
=
"
Loads data
"
,
default
=
'
california
'
)
parser
.
add_argument
(
"
--data
"
,
help
=
"
Loads data
"
,
default
=
'
linear
'
)
parser
.
add_argument
(
"
--no-autoindent
"
,
help
=
""
,
action
=
"
store_true
"
)
# to avoid conflics in IPython
args
=
parser
.
parse_args
()
...
...
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