Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.pad.base
Commits
d1557c28
Commit
d1557c28
authored
Jun 21, 2018
by
Theophile GENTILHOMME
Browse files
[script][vuln_figure] Add hline for roc
parent
d2f3ae96
Pipeline
#21225
canceled with stage
in 13 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/pad/base/script/vuln_figure.py
View file @
d1557c28
...
...
@@ -483,7 +483,6 @@ class BaseVulnDetRoc(PadPlot):
return
for
line
in
self
.
_hlines_at
:
print
(
line
)
thres_baseline
=
frr_threshold
(
licit_neg
,
licit_pos
,
line
)
axlim
=
mpl
.
axis
()
...
...
@@ -516,67 +515,30 @@ class BaseVulnDetRoc(PadPlot):
color
=
'k'
,
linestyle
=
'--'
,
label
=
"%s = %.2f%%"
%
(
self
.
_y_label
,
farfrr_licit
[
1
]
*
100
))
(
'FMNR'
,
farfrr_licit
[
1
]
*
100
))
if
not
self
.
_real_data
:
label_licit
=
'%s @ operating point'
%
self
.
_y_label
label_spoof
=
'IAPMR @ operating point'
else
:
label_licit
=
'FMR=%.2f%%'
%
(
farfrr_licit
[
0
]
*
100
)
label_spoof
=
'IAPMR=%.2f%%'
%
(
farfrr_spoof
[
0
]
*
100
)
mpl
.
plot
(
farfrr_licit_det
[
0
],
farfrr_licit_det
[
1
],
'o'
,
color
=
'C0'
,
label
=
label_licit
)
# FAR point, licit scenario
mpl
.
plot
(
farfrr_spoof_det
[
0
],
farfrr_spoof_det
[
1
],
'o'
,
color
=
'C3'
,
label
=
label_spoof
)
# FAR point, spoof scenario
# annotate the FAR points
if
farfrr_licit_det
[
0
]
<
farfrr_spoof_det
[
0
]:
xyannotate_licit
=
[
farfrr_licit_det
[
0
]
-
0.7
,
farfrr_licit_det
[
1
]
-
0.4
,
]
xyannotate_spoof
=
[
0.1
+
farfrr_spoof_det
[
0
],
farfrr_spoof_det
[
1
]
+
0.3
,
]
else
:
xyannotate_spoof
=
[
farfrr_licit_det
[
0
]
-
0.7
,
farfrr_licit_det
[
1
]
-
0.4
,
]
xyannotate_licit
=
[
0.1
+
farfrr_spoof_det
[
0
],
farfrr_spoof_det
[
1
]
+
0.3
,
]
if
not
self
.
_real_data
:
mpl
.
annotate
(
'%s @ operating point'
%
self
.
_y_label
,
xy
=
(
farfrr_licit_det
[
0
],
farfrr_licit_det
[
1
]),
xycoords
=
'data'
,
xytext
=
(
xyannotate_licit
[
0
],
xyannotate_licit
[
1
]))
mpl
.
annotate
(
'IAPMR @ operating point'
,
xy
=
(
farfrr_spoof_det
[
0
],
farfrr_spoof_det
[
1
]),
xycoords
=
'data'
,
xytext
=
(
xyannotate_spoof
[
0
],
xyannotate_spoof
[
1
]))
else
:
mpl
.
annotate
(
'FMR=%.2f%%'
%
(
farfrr_licit
[
0
]
*
100
),
xy
=
(
farfrr_licit_det
[
0
],
farfrr_licit_det
[
1
]),
xycoords
=
'data'
,
xytext
=
(
xyannotate_licit
[
0
],
xyannotate_licit
[
1
]),
color
=
'C0'
,
size
=
'small'
)
mpl
.
annotate
(
'IAPMR=%.2f%%'
%
(
farfrr_spoof
[
0
]
*
100
),
xy
=
(
farfrr_spoof_det
[
0
],
farfrr_spoof_det
[
1
]),
xycoords
=
'data'
,
xytext
=
(
xyannotate_spoof
[
0
],
xyannotate_spoof
[
1
]),
color
=
'C3'
,
size
=
'small'
)
def
end_process
(
self
):
''' Set title, legend, axis labels, grid colors, save figures and
...
...
@@ -677,6 +639,10 @@ class RocVuln(BaseVulnDetRoc):
label
=
kwargs
.
get
(
'label'
)
)
def
_get_farfrr
(
self
,
x
,
y
,
thres
):
points
=
farfrr
(
x
,
y
,
thres
)
points2
=
(
points
[
0
],
1
-
points
[
1
])
return
points
,
points2
class
FmrIapmr
(
PadPlot
):
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment