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
85a74b58
Commit
85a74b58
authored
4 years ago
by
leufen1
Browse files
Options
Downloads
Patches
Plain Diff
histogram can handle branched inputs
parent
4eee713d
Branches
Branches containing commit
Tags
0.7.0
Tags containing commit
5 merge requests
!319
add all changes of dev into release v1.4.0 branch
,
!318
Resolve "release v1.4.0"
,
!317
enabled window_lead_time=1
,
!295
Resolve "data handler FIR filter"
,
!259
Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler"
Pipeline
#72588
passed
4 years ago
Stage: test
Stage: docs
Stage: pages
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mlair/plotting/data_insight_plotting.py
+11
-8
11 additions, 8 deletions
mlair/plotting/data_insight_plotting.py
with
11 additions
and
8 deletions
mlair/plotting/data_insight_plotting.py
+
11
−
8
View file @
85a74b58
...
@@ -464,16 +464,18 @@ class PlotDataHistogram(AbstractPlotClass): # pragma: no cover
...
@@ -464,16 +464,18 @@ class PlotDataHistogram(AbstractPlotClass): # pragma: no cover
self
.
variables_dim
=
variables_dim
self
.
variables_dim
=
variables_dim
self
.
time_dim
=
time_dim
self
.
time_dim
=
time_dim
self
.
window_dim
=
window_dim
self
.
window_dim
=
window_dim
self
.
inputs
,
self
.
targets
=
self
.
_get_inputs_targets
(
generators
,
self
.
variables_dim
)
self
.
inputs
,
self
.
targets
,
number_of_branches
=
self
.
_get_inputs_targets
(
generators
,
self
.
variables_dim
)
self
.
bins
=
{}
self
.
bins
=
{}
self
.
interval_width
=
{}
self
.
interval_width
=
{}
self
.
bin_edges
=
{}
self
.
bin_edges
=
{}
# input plots
# input plots
self
.
_calculate_hist
(
generators
,
self
.
inputs
,
input_data
=
True
)
for
branch_pos
in
range
(
number_of_branches
):
self
.
_calculate_hist
(
generators
,
self
.
inputs
,
input_data
=
True
,
branch_pos
=
branch_pos
)
add_name
=
"
input
"
if
number_of_branches
==
1
else
f
"
input_branch_
{
branch_pos
}
"
for
subset
in
generators
.
keys
():
for
subset
in
generators
.
keys
():
self
.
_plot
(
add_name
=
"
input
"
,
subset
=
subset
)
self
.
_plot
(
add_name
=
add_name
,
subset
=
subset
)
self
.
_plot_combined
(
add_name
=
"
input
"
)
self
.
_plot_combined
(
add_name
=
add_name
)
# target plots
# target plots
self
.
_calculate_hist
(
generators
,
self
.
targets
,
input_data
=
False
)
self
.
_calculate_hist
(
generators
,
self
.
targets
,
input_data
=
False
)
...
@@ -487,16 +489,17 @@ class PlotDataHistogram(AbstractPlotClass): # pragma: no cover
...
@@ -487,16 +489,17 @@ class PlotDataHistogram(AbstractPlotClass): # pragma: no cover
gen
=
gens
[
k
][
0
]
gen
=
gens
[
k
][
0
]
inputs
=
to_list
(
gen
.
get_X
(
as_numpy
=
False
)[
0
].
coords
[
dim
].
values
.
tolist
())
inputs
=
to_list
(
gen
.
get_X
(
as_numpy
=
False
)[
0
].
coords
[
dim
].
values
.
tolist
())
targets
=
to_list
(
gen
.
get_Y
(
as_numpy
=
False
).
coords
[
dim
].
values
.
tolist
())
targets
=
to_list
(
gen
.
get_Y
(
as_numpy
=
False
).
coords
[
dim
].
values
.
tolist
())
return
inputs
,
targets
n_branches
=
len
(
gen
.
get_X
(
as_numpy
=
False
))
return
inputs
,
targets
,
n_branches
def
_calculate_hist
(
self
,
generators
,
variables
,
input_data
=
True
):
def
_calculate_hist
(
self
,
generators
,
variables
,
input_data
=
True
,
branch_pos
=
0
):
n_bins
=
100
n_bins
=
100
for
set_type
,
generator
in
generators
.
items
():
for
set_type
,
generator
in
generators
.
items
():
tmp_bins
=
{}
tmp_bins
=
{}
tmp_edges
=
{}
tmp_edges
=
{}
end
=
{}
end
=
{}
start
=
{}
start
=
{}
f
=
lambda
x
:
x
.
get_X
(
as_numpy
=
False
)[
0
]
if
input_data
is
True
else
x
.
get_Y
(
as_numpy
=
False
)
f
=
lambda
x
:
x
.
get_X
(
as_numpy
=
False
)[
branch_pos
]
if
input_data
is
True
else
x
.
get_Y
(
as_numpy
=
False
)
for
gen
in
generator
:
for
gen
in
generator
:
w
=
min
(
abs
(
f
(
gen
).
coords
[
self
.
window_dim
].
values
))
w
=
min
(
abs
(
f
(
gen
).
coords
[
self
.
window_dim
].
values
))
data
=
f
(
gen
).
sel
({
self
.
window_dim
:
w
})
data
=
f
(
gen
).
sel
({
self
.
window_dim
:
w
})
...
...
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