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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esde
machine-learning
MLAir
Commits
1c32a84f
Commit
1c32a84f
authored
4 years ago
by
leufen1
Browse files
Options
Downloads
Patches
Plain Diff
PlotCompetitiveSkillScore has now a horizontal and vertical version
parent
9c56c82e
No related branches found
No related tags found
3 merge requests
!253
include current develop
,
!252
Resolve "release v1.3.0"
,
!196
Resolve "Competitor Models"
Pipeline
#57732
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/postprocessing_plotting.py
+23
-4
23 additions, 4 deletions
mlair/plotting/postprocessing_plotting.py
with
23 additions
and
4 deletions
mlair/plotting/postprocessing_plotting.py
+
23
−
4
View file @
1c32a84f
...
...
@@ -702,6 +702,10 @@ class PlotCompetitiveSkillScore(AbstractPlotClass):
self
.
_data
=
self
.
_prepare_data
(
data
)
self
.
_plot
()
self
.
_save
()
# draw also a vertical version
self
.
plot_name
+=
"
_vertical
"
self
.
_plot_vertical
()
self
.
_save
()
def
_prepare_data
(
self
,
data
:
pd
.
DataFrame
)
->
pd
.
DataFrame
:
"""
...
...
@@ -720,7 +724,7 @@ class PlotCompetitiveSkillScore(AbstractPlotClass):
return
data
.
stack
(
level
=
0
).
reset_index
(
level
=
2
,
drop
=
True
).
reset_index
(
name
=
"
data
"
)
def
_plot
(
self
):
"""
Plot skill scores of the comparisons
cnn-persi, ols-persi and cnn-ols
.
"""
"""
Plot skill scores of the comparisons.
"""
fig
,
ax
=
plt
.
subplots
()
order
=
self
.
_create_pseudo_order
()
sns
.
boxplot
(
x
=
"
comparison
"
,
y
=
"
data
"
,
hue
=
"
ahead
"
,
data
=
self
.
_data
,
whis
=
1.
,
ax
=
ax
,
palette
=
"
Blues_d
"
,
...
...
@@ -728,7 +732,22 @@ class PlotCompetitiveSkillScore(AbstractPlotClass):
order
=
order
)
ax
.
axhline
(
y
=
0
,
color
=
"
grey
"
,
linewidth
=
.
5
)
ax
.
set
(
ylabel
=
"
skill score
"
,
xlabel
=
"
competing models
"
,
title
=
"
summary of all stations
"
,
ylim
=
self
.
_ylim
())
ax
.
set
(
ylabel
=
"
skill score
"
,
xlabel
=
"
competing models
"
,
title
=
"
summary of all stations
"
,
ylim
=
self
.
_lim
())
handles
,
_
=
ax
.
get_legend_handles_labels
()
plt
.
xticks
(
rotation
=
20
)
ax
.
legend
(
handles
,
self
.
_labels
)
plt
.
tight_layout
()
def
_plot_vertical
(
self
):
"""
Plot skill scores of the comparisons, but vertically aligned.
"""
fig
,
ax
=
plt
.
subplots
()
order
=
self
.
_create_pseudo_order
()
sns
.
boxplot
(
y
=
"
comparison
"
,
x
=
"
data
"
,
hue
=
"
ahead
"
,
data
=
self
.
_data
,
whis
=
1.
,
ax
=
ax
,
palette
=
"
Blues_d
"
,
showmeans
=
True
,
meanprops
=
{
"
markersize
"
:
3
,
"
markeredgecolor
"
:
"
k
"
},
flierprops
=
{
"
marker
"
:
"
.
"
},
order
=
order
)
# ax.axhline(x=0, color="grey", linewidth=.5)
ax
.
axvline
(
x
=
0
,
color
=
"
grey
"
,
linewidth
=
.
5
)
ax
.
set
(
xlabel
=
"
skill score
"
,
ylabel
=
"
competing models
"
,
title
=
"
summary of all stations
"
,
xlim
=
self
.
_lim
())
handles
,
_
=
ax
.
get_legend_handles_labels
()
ax
.
legend
(
handles
,
self
.
_labels
)
plt
.
tight_layout
()
...
...
@@ -739,9 +758,9 @@ class PlotCompetitiveSkillScore(AbstractPlotClass):
uniq
,
index
=
np
.
unique
(
first_elements
+
self
.
_data
.
comparison
.
unique
().
tolist
(),
return_index
=
True
)
return
uniq
[
index
.
argsort
()]
def
_
y
lim
(
self
)
->
Tuple
[
float
,
float
]:
def
_lim
(
self
)
->
Tuple
[
float
,
float
]:
"""
Calculate
y-
axis limits from data.
Calculate axis limits from data
(Can be used to set axis extend)
.
Lower limit is the minimum of 0 and data
'
s minimum (reduced by small subtrahend) and upper limit is data
'
s
maximum (increased by a small addend).
...
...
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