Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MLAir
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
Container registry
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esde
machine-learning
MLAir
Commits
cb5ebf89
Commit
cb5ebf89
authored
Sep 14, 2022
by
leufen1
Browse files
Options
Downloads
Patches
Plain Diff
can now skip persi reference if not provided in competitor list
parent
cb3248d6
Branches
Branches containing commit
Tags
Tags containing commit
3 merge requests
!500
Develop
,
!499
Resolve "release v2.3.0"
,
!486
Resolve "enable persi only if requested"
Pipeline
#112147
failed
Sep 14, 2022
Stage: test
Stage: docs
Stage: pages
Stage: deploy
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mlair/configuration/defaults.py
+1
-1
1 addition, 1 deletion
mlair/configuration/defaults.py
mlair/run_modules/post_processing.py
+15
-2
15 additions, 2 deletions
mlair/run_modules/post_processing.py
with
16 additions
and
3 deletions
mlair/configuration/defaults.py
+
1
−
1
View file @
cb5ebf89
...
@@ -48,7 +48,7 @@ DEFAULT_TEST_END = "2017-12-31"
...
@@ -48,7 +48,7 @@ DEFAULT_TEST_END = "2017-12-31"
DEFAULT_TEST_MIN_LENGTH
=
90
DEFAULT_TEST_MIN_LENGTH
=
90
DEFAULT_TRAIN_VAL_MIN_LENGTH
=
180
DEFAULT_TRAIN_VAL_MIN_LENGTH
=
180
DEFAULT_USE_ALL_STATIONS_ON_ALL_DATA_SETS
=
True
DEFAULT_USE_ALL_STATIONS_ON_ALL_DATA_SETS
=
True
DEFAULT_COMPETITORS
=
[
"
ols
"
]
DEFAULT_COMPETITORS
=
[
"
ols
"
,
"
persi
"
]
DEFAULT_DO_UNCERTAINTY_ESTIMATE
=
True
DEFAULT_DO_UNCERTAINTY_ESTIMATE
=
True
DEFAULT_UNCERTAINTY_ESTIMATE_BLOCK_LENGTH
=
"
1m
"
DEFAULT_UNCERTAINTY_ESTIMATE_BLOCK_LENGTH
=
"
1m
"
DEFAULT_UNCERTAINTY_ESTIMATE_EVALUATE_COMPETITORS
=
True
DEFAULT_UNCERTAINTY_ESTIMATE_EVALUATE_COMPETITORS
=
True
...
...
This diff is collapsed.
Click to expand it.
mlair/run_modules/post_processing.py
+
15
−
2
View file @
cb5ebf89
...
@@ -72,6 +72,7 @@ class PostProcessing(RunEnvironment):
...
@@ -72,6 +72,7 @@ class PostProcessing(RunEnvironment):
self
.
model
:
AbstractModelClass
=
self
.
_load_model
()
self
.
model
:
AbstractModelClass
=
self
.
_load_model
()
self
.
model_name
=
self
.
data_store
.
get
(
"
model_name
"
,
"
model
"
).
rsplit
(
"
/
"
,
1
)[
1
].
split
(
"
.
"
,
1
)[
0
]
self
.
model_name
=
self
.
data_store
.
get
(
"
model_name
"
,
"
model
"
).
rsplit
(
"
/
"
,
1
)[
1
].
split
(
"
.
"
,
1
)[
0
]
self
.
ols_model
=
None
self
.
ols_model
=
None
self
.
persi_model
=
True
self
.
batch_size
:
int
=
self
.
data_store
.
get_default
(
"
batch_size
"
,
"
model
"
,
64
)
self
.
batch_size
:
int
=
self
.
data_store
.
get_default
(
"
batch_size
"
,
"
model
"
,
64
)
self
.
test_data
=
self
.
data_store
.
get
(
"
data_collection
"
,
"
test
"
)
self
.
test_data
=
self
.
data_store
.
get
(
"
data_collection
"
,
"
test
"
)
batch_path
=
self
.
data_store
.
get
(
"
batch_path
"
,
scope
=
"
test
"
)
batch_path
=
self
.
data_store
.
get
(
"
batch_path
"
,
scope
=
"
test
"
)
...
@@ -106,6 +107,9 @@ class PostProcessing(RunEnvironment):
...
@@ -106,6 +107,9 @@ class PostProcessing(RunEnvironment):
# ols model
# ols model
self
.
train_ols_model
()
self
.
train_ols_model
()
# persi model
self
.
setup_persistence
()
# forecasts on test data
# forecasts on test data
self
.
make_prediction
(
self
.
test_data
)
self
.
make_prediction
(
self
.
test_data
)
self
.
make_prediction
(
self
.
train_val_data
)
self
.
make_prediction
(
self
.
train_val_data
)
...
@@ -715,6 +719,12 @@ class PostProcessing(RunEnvironment):
...
@@ -715,6 +719,12 @@ class PostProcessing(RunEnvironment):
else
:
else
:
logging
.
info
(
f
"
Skip train ols model as it is not present in competitors.
"
)
logging
.
info
(
f
"
Skip train ols model as it is not present in competitors.
"
)
def
setup_persistence
(
self
):
"""
Check if persistence is requested from competitors and store this information.
"""
self
.
persi_model
=
any
(
x
in
map
(
str
.
lower
,
self
.
competitors
)
for
x
in
[
"
persi
"
,
"
persistence
"
])
if
self
.
persi_model
is
False
:
logging
.
info
(
f
"
Persistence is not calculated as it is not present in competitors.
"
)
@TimeTrackingWrapper
@TimeTrackingWrapper
def
make_prediction
(
self
,
subset
):
def
make_prediction
(
self
,
subset
):
"""
"""
...
@@ -748,8 +758,11 @@ class PostProcessing(RunEnvironment):
...
@@ -748,8 +758,11 @@ class PostProcessing(RunEnvironment):
nn_prediction
=
self
.
_create_nn_forecast
(
copy
.
deepcopy
(
nn_output
),
nn_prediction
,
transformation_func
,
normalised
)
nn_prediction
=
self
.
_create_nn_forecast
(
copy
.
deepcopy
(
nn_output
),
nn_prediction
,
transformation_func
,
normalised
)
# persistence
# persistence
if
self
.
persi_model
is
True
:
persistence_prediction
=
self
.
_create_persistence_forecast
(
observation_data
,
persistence_prediction
,
persistence_prediction
=
self
.
_create_persistence_forecast
(
observation_data
,
persistence_prediction
,
transformation_func
,
normalised
)
transformation_func
,
normalised
)
else
:
persistence_prediction
=
None
# ols
# ols
if
self
.
ols_model
is
not
None
:
if
self
.
ols_model
is
not
None
:
...
...
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
sign in
to comment