Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
f0_estimation
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Paul Best
f0_estimation
Commits
ca82ce11
Commit
ca82ce11
authored
11 months ago
by
Paul Best
Browse files
Options
Downloads
Patches
Plain Diff
descent plot
parent
758deb99
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
figures/scatter_scores_columns.pdf
+0
-0
0 additions, 0 deletions
figures/scatter_scores_columns.pdf
plot_scores_columns.py
+67
-0
67 additions, 0 deletions
plot_scores_columns.py
with
67 additions
and
0 deletions
figures/scatter_scores_columns.pdf
0 → 100644
+
0
−
0
View file @
ca82ce11
File added
This diff is collapsed.
Click to expand it.
plot_scores_columns.py
0 → 100644
+
67
−
0
View file @
ca82ce11
import
matplotlib.pyplot
as
plt
from
matplotlib.patches
import
Rectangle
from
matplotlib
import
colors
import
pandas
as
pd
,
numpy
as
np
from
metadata
import
species
#colors = ['#006BA4', '#FF800E', '#ABABAB', '#595959', '#5F9ED1', '#C85200', '#898989', '#A2C8EC', '#FFBC79', '#CFCFCF']
colors
=
list
(
colors
.
TABLEAU_COLORS
)
# plt.rcParams['legend.title_fontsize'] = 'x-small'
markers
=
[
(
'
o
'
,
'
right
'
,
colors
[
0
]),
(
'
d
'
,
'
none
'
,
colors
[
0
]),
(
'
s
'
,
'
none
'
,
colors
[
1
]),
(
'
v
'
,
'
none
'
,
colors
[
1
]),
(
'
H
'
,
'
none
'
,
colors
[
1
]),
(
'
<
'
,
'
none
'
,
colors
[
2
]),
(
'
>
'
,
'
none
'
,
colors
[
2
]),
(
'
^
'
,
'
none
'
,
colors
[
2
]),
(
'
p
'
,
'
none
'
,
colors
[
2
]),
(
'
P
'
,
'
none
'
,
colors
[
3
]),
(
'
*
'
,
'
none
'
,
colors
[
3
]),
(
'
X
'
,
'
none
'
,
colors
[
3
]),
(
'
D
'
,
'
none
'
,
colors
[
3
])
,
(
'
h
'
,
'
left
'
,
colors
[
3
])]
species_list
=
[
'
wolves
'
,
'
spotted_hyenas
'
,
# 2 good salience & harmonicity
'
bottlenose_dolphins
'
,
'
rodents
'
,
'
little_owls
'
,
# 3 good salience only
'
monk_parakeets
'
,
'
lions
'
,
'
orangutans
'
,
'
long-billed_hermits
'
,
# 4 good harmonicity only
'
hummingbirds
'
,
'
disk-winged_bats
'
,
'
Reunion_grey_white_eyes
'
,
'
dolphins
'
,
'
La_Palma_chaffinches
'
]
# 5 neither
algos
=
[
'
basic
'
,
'
pyin
'
,
'
pesto
'
,
'
praat
'
,
'
pesto_ft
'
,
'
tcrepe_ftoth
'
,
'
tcrepe_ftsp
'
]
algo_names
=
[
'
basic
'
,
'
pyin
'
,
'
pesto-music
'
,
'
praat
'
,
'
pesto-bio
'
,
'
crepe-other
'
,
'
crepe-target
'
]
metrics
=
[
'
Pitch acc
'
]
#, 'Chroma acc']
# metrics = ['Recall', 'Specificity', 'Vocalisation recall']
fig
,
ax
=
plt
.
subplots
(
nrows
=
1
,
ncols
=
len
(
metrics
),
figsize
=
(
10
,
4.5
),
sharex
=
True
,
sharey
=
True
)
#ax[0].set_yticks([0, .2, .4, .6, .8, 1])
ax
.
set_ylim
(
0
,
1
)
algo_legend
=
[]
for
i
,
metric
in
enumerate
(
metrics
):
m_ax
=
ax
#ax[int(i//2), i%2]
m_ax
.
grid
(
'
both
'
,
axis
=
'
y
'
)
m_ax
.
set_ylabel
(
metric
,
fontsize
=
'
medium
'
)
ok
=
pd
.
DataFrame
()
for
j
,
(
specie
,
marker
)
in
enumerate
(
zip
(
species_list
,
markers
)):
df
=
pd
.
read_csv
(
f
'
scores/
{
specie
}
_scores.csv
'
,
index_col
=
0
)
df
[
'
Specificity
'
]
=
1
-
df
[
'
False alarm
'
]
df
.
rename
(
columns
=
{
'
Voc. recall
'
:
'
Vocalisation recall
'
},
inplace
=
True
)
ok
.
loc
[
specie
,
df
.
index
]
=
df
[
metric
]
tt
=
m_ax
.
plot
(
np
.
arange
(
len
(
algos
))
-
.
3
+
j
*
0.6
/
len
(
species_list
),
ok
.
loc
[
specie
,
algos
],
marker
=
marker
[
0
],
color
=
marker
[
2
],
fillstyle
=
marker
[
1
],
markersize
=
8
,
label
=
specie
.
replace
(
'
_
'
,
'
'
),
linestyle
=
'
none
'
)
algo_legend
.
append
(
tt
[
0
])
m_ax
.
set_xticks
(
range
(
len
(
algo_names
)))
m_ax
.
set_xticklabels
(
algo_names
)
#ax[1].set_xticklabels(algos, rotation=22)
plt
.
tight_layout
(
rect
=
(
0
,
0
,
1
,
.
87
))
species_list
=
[
s
.
replace
(
'
_
'
,
'
'
)
for
s
in
species_list
]
leg
=
ax
.
legend
(
algo_legend
[:
2
],
species_list
[:
2
],
title
=
'
salient & harmonic
'
,
loc
=
'
lower left
'
,
bbox_to_anchor
=
(
0
,
1.02
),
fontsize
=
'
x-small
'
)
ax
.
add_artist
(
leg
)
leg
=
ax
.
legend
(
algo_legend
[
2
:
5
],
species_list
[
2
:
5
],
title
=
'
salient & non-harmonic
'
,
loc
=
'
lower left
'
,
bbox_to_anchor
=
(
0.16
,
1.02
),
fontsize
=
'
x-small
'
)
ax
.
add_artist
(
leg
)
leg
=
ax
.
legend
(
algo_legend
[
5
:
9
],
species_list
[
5
:
9
],
ncols
=
2
,
title
=
'
non-salient & harmonic
'
,
loc
=
'
lower left
'
,
bbox_to_anchor
=
(
0.36
,
1.02
),
fontsize
=
'
x-small
'
)
ax
.
add_artist
(
leg
)
leg
=
ax
.
legend
(
algo_legend
[
9
:],
species_list
[
9
:],
ncols
=
2
,
title
=
'
non-salient & non-harmonic
'
,
loc
=
'
lower left
'
,
bbox_to_anchor
=
(
0.65
,
1.02
),
fontsize
=
'
x-small
'
)
ax
.
add_artist
(
leg
)
# ax.legend(loc='lower left', ncols=7, bbox_to_anchor=(0, 1.1), fontsize='x-small')
plt
.
savefig
(
f
'
figures/scatter_scores_columns.pdf
'
)
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