Skip to content
Snippets Groups Projects
Commit 960feb2e authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Small fixes

parent 63d3eae5
No related branches found
No related tags found
1 merge request!48Various fix
Pipeline #
...@@ -37,8 +37,8 @@ def gen(ctx, outdir, mean_match, mean_non_match, n_sys): ...@@ -37,8 +37,8 @@ def gen(ctx, outdir, mean_match, mean_non_match, n_sys):
@common_options.metrics_command(common_options.METRICS_HELP.format( @common_options.metrics_command(common_options.METRICS_HELP.format(
names='FtA, APCER, BPCER, FAR, FRR, ACER', names='FtA, APCER, BPCER, FAR, FRR, ACER',
criteria=CRITERIA, score_format=SCORE_FORMAT, criteria=CRITERIA, score_format=SCORE_FORMAT,
hter_note='Note that FAR = APCER * (1 - FtA), FRR = FtA + BPCER * (1 - FtA) ' hter_note='Note that FAR = APCER * (1 - FtA), '
'and ACER = (FMR + FMNR) / 2.', 'FRR = FtA + BPCER * (1 - FtA) and ACER = (APCER + BPCER) / 2.',
command='bob pad metrics'), criteria=CRITERIA) command='bob pad metrics'), criteria=CRITERIA)
def metrics(ctx, scores, evaluation, **kwargs): def metrics(ctx, scores, evaluation, **kwargs):
process = figure.Metrics(ctx, scores, evaluation, load.split) process = figure.Metrics(ctx, scores, evaluation, load.split)
......
...@@ -71,9 +71,9 @@ def write_scores_to_file(neg, pos, filename, attack=False): ...@@ -71,9 +71,9 @@ def write_scores_to_file(neg, pos, filename, attack=False):
@click.command() @click.command()
@click.argument('outdir') @click.argument('outdir')
@click.option('--mean-gen', default=7, type=FLOAT, show_default=True) @click.option('-mg', '--mean-gen', default=7, type=FLOAT, show_default=True)
@click.option('--mean-zei', default=3, type=FLOAT, show_default=True) @click.option('-mz', '--mean-zei', default=3, type=FLOAT, show_default=True)
@click.option('--mean-pa', default=5, type=FLOAT, show_default=True) @click.option('-mp', '--mean-pa', default=5, type=FLOAT, show_default=True)
@verbosity_option() @verbosity_option()
def gen(outdir, mean_gen, mean_zei, mean_pa): def gen(outdir, mean_gen, mean_zei, mean_pa):
"""Generate random scores. """Generate random scores.
...@@ -104,7 +104,7 @@ def gen(outdir, mean_gen, mean_zei, mean_pa): ...@@ -104,7 +104,7 @@ def gen(outdir, mean_gen, mean_zei, mean_pa):
@click.command() @click.command()
@common_options.scores_argument(min_arg=2, nargs=-1) @common_options.scores_argument(min_arg=2, nargs=-1)
@common_options.output_plot_file_option(default_out='vuln_roc.pdf') @common_options.output_plot_file_option(default_out='roc.pdf')
@common_options.legends_option() @common_options.legends_option()
@common_options.no_legend_option() @common_options.no_legend_option()
@common_options.legend_loc_option(dflt='upper-right') @common_options.legend_loc_option(dflt='upper-right')
...@@ -144,7 +144,7 @@ def roc(ctx, scores, real_data, **kwargs): ...@@ -144,7 +144,7 @@ def roc(ctx, scores, real_data, **kwargs):
@click.command() @click.command()
@common_options.scores_argument(min_arg=2, nargs=-1) @common_options.scores_argument(min_arg=2, nargs=-1)
@common_options.output_plot_file_option(default_out='vuln_det.pdf') @common_options.output_plot_file_option(default_out='det.pdf')
@common_options.legends_option() @common_options.legends_option()
@common_options.no_legend_option() @common_options.no_legend_option()
@common_options.legend_loc_option(dflt='upper-right') @common_options.legend_loc_option(dflt='upper-right')
...@@ -184,7 +184,7 @@ def det(ctx, scores, real_data, **kwargs): ...@@ -184,7 +184,7 @@ def det(ctx, scores, real_data, **kwargs):
@click.command() @click.command()
@common_options.scores_argument(min_arg=2, force_eval=True, nargs=-1) @common_options.scores_argument(min_arg=2, force_eval=True, nargs=-1)
@common_options.output_plot_file_option(default_out='vuln_epc.pdf') @common_options.output_plot_file_option(default_out='epc.pdf')
@common_options.legends_option() @common_options.legends_option()
@common_options.no_legend_option() @common_options.no_legend_option()
@common_options.legend_loc_option() @common_options.legend_loc_option()
...@@ -228,7 +228,7 @@ def epc(ctx, scores, **kwargs): ...@@ -228,7 +228,7 @@ def epc(ctx, scores, **kwargs):
@click.command() @click.command()
@common_options.scores_argument(min_arg=2, force_eval=True, nargs=-1) @common_options.scores_argument(min_arg=2, force_eval=True, nargs=-1)
@common_options.output_plot_file_option(default_out='vuln_epsc.pdf') @common_options.output_plot_file_option(default_out='epsc.pdf')
@common_options.titles_option() @common_options.titles_option()
@common_options.no_legend_option() @common_options.no_legend_option()
@common_options.legend_loc_option() @common_options.legend_loc_option()
...@@ -301,7 +301,7 @@ def epsc(ctx, scores, criteria, var_param, three_d, sampling, ...@@ -301,7 +301,7 @@ def epsc(ctx, scores, criteria, var_param, three_d, sampling,
@click.command() @click.command()
@common_options.scores_argument(nargs=-1, min_arg=2) @common_options.scores_argument(nargs=-1, min_arg=2)
@common_options.output_plot_file_option(default_out='vuln_hist.pdf') @common_options.output_plot_file_option(default_out='hist.pdf')
@common_options.n_bins_option() @common_options.n_bins_option()
@common_options.criterion_option() @common_options.criterion_option()
@common_options.thresholds_option() @common_options.thresholds_option()
...@@ -347,6 +347,8 @@ def hist(ctx, scores, evaluation, **kwargs): ...@@ -347,6 +347,8 @@ def hist(ctx, scores, evaluation, **kwargs):
Examples: Examples:
$ bob vuln hist -v licit/scores-dev spoof/scores-dev
$ bob vuln hist -e -v licit/scores-dev licit/scores-eval \ $ bob vuln hist -e -v licit/scores-dev licit/scores-eval \
spoof/scores-dev spoof/scores-eval spoof/scores-dev spoof/scores-eval
......
...@@ -239,12 +239,12 @@ class Epsc(VulnPlot): ...@@ -239,12 +239,12 @@ class Epsc(VulnPlot):
spoof_dev_pos = input_scores[2][1] spoof_dev_pos = input_scores[2][1]
spoof_eval_neg = input_scores[3][0] spoof_eval_neg = input_scores[3][0]
spoof_eval_pos = input_scores[3][1] spoof_eval_pos = input_scores[3][1]
merge_sys = (self._fixed_params is None or len(self._fixed_params) merge_sys = (self._fixed_params is None or
== 1) and self.n_systems > 1 len(self._fixed_params) == 1) and self.n_systems > 1
if not merge_sys or idx == 0: if not merge_sys or idx == 0:
mpl.gcf().clear() mpl.gcf().clear()
# axis should only be created and twin onece # axes should only be created once
self._axis1 = mpl.gca() self._axis1 = mpl.gca()
self._axis2 = mpl.twinx() self._axis2 = mpl.twinx()
points = 10 points = 10
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment