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):
@common_options.metrics_command(common_options.METRICS_HELP.format(
names='FtA, APCER, BPCER, FAR, FRR, ACER',
criteria=CRITERIA, score_format=SCORE_FORMAT,
hter_note='Note that FAR = APCER * (1 - FtA), FRR = FtA + BPCER * (1 - FtA) '
'and ACER = (FMR + FMNR) / 2.',
hter_note='Note that FAR = APCER * (1 - FtA), '
'FRR = FtA + BPCER * (1 - FtA) and ACER = (APCER + BPCER) / 2.',
command='bob pad metrics'), criteria=CRITERIA)
def metrics(ctx, scores, evaluation, **kwargs):
process = figure.Metrics(ctx, scores, evaluation, load.split)
......
......@@ -71,9 +71,9 @@ def write_scores_to_file(neg, pos, filename, attack=False):
@click.command()
@click.argument('outdir')
@click.option('--mean-gen', default=7, type=FLOAT, show_default=True)
@click.option('--mean-zei', default=3, type=FLOAT, show_default=True)
@click.option('--mean-pa', default=5, type=FLOAT, show_default=True)
@click.option('-mg', '--mean-gen', default=7, type=FLOAT, show_default=True)
@click.option('-mz', '--mean-zei', default=3, type=FLOAT, show_default=True)
@click.option('-mp', '--mean-pa', default=5, type=FLOAT, show_default=True)
@verbosity_option()
def gen(outdir, mean_gen, mean_zei, mean_pa):
"""Generate random scores.
......@@ -104,7 +104,7 @@ def gen(outdir, mean_gen, mean_zei, mean_pa):
@click.command()
@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.no_legend_option()
@common_options.legend_loc_option(dflt='upper-right')
......@@ -144,7 +144,7 @@ def roc(ctx, scores, real_data, **kwargs):
@click.command()
@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.no_legend_option()
@common_options.legend_loc_option(dflt='upper-right')
......@@ -184,7 +184,7 @@ def det(ctx, scores, real_data, **kwargs):
@click.command()
@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.no_legend_option()
@common_options.legend_loc_option()
......@@ -228,7 +228,7 @@ def epc(ctx, scores, **kwargs):
@click.command()
@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.no_legend_option()
@common_options.legend_loc_option()
......@@ -301,7 +301,7 @@ def epsc(ctx, scores, criteria, var_param, three_d, sampling,
@click.command()
@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.criterion_option()
@common_options.thresholds_option()
......@@ -347,6 +347,8 @@ def hist(ctx, scores, evaluation, **kwargs):
Examples:
$ bob vuln hist -v licit/scores-dev spoof/scores-dev
$ bob vuln hist -e -v licit/scores-dev licit/scores-eval \
spoof/scores-dev spoof/scores-eval
......
......@@ -239,12 +239,12 @@ class Epsc(VulnPlot):
spoof_dev_pos = input_scores[2][1]
spoof_eval_neg = input_scores[3][0]
spoof_eval_pos = input_scores[3][1]
merge_sys = (self._fixed_params is None or len(self._fixed_params)
== 1) and self.n_systems > 1
merge_sys = (self._fixed_params is None or
len(self._fixed_params) == 1) and self.n_systems > 1
if not merge_sys or idx == 0:
mpl.gcf().clear()
# axis should only be created and twin onece
# axes should only be created once
self._axis1 = mpl.gca()
self._axis2 = mpl.twinx()
points = 10
......@@ -327,7 +327,7 @@ class Epsc(VulnPlot):
)
if self._titles is not None and len(self._titles) > idx:
title = self._titles[idx] if self._titles[idx].replace(' ', '') \
else None
else None
mpl.title(title)
mpl.grid()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment