From 7cd81e2649520ddb03aa2454b237f4e5f88fce7f Mon Sep 17 00:00:00 2001 From: Theophile GENTILHOMME <tgentilhomme@jurasix08.idiap.ch> Date: Thu, 26 Apr 2018 08:06:32 +0200 Subject: [PATCH] Change variable name from criter to criterion --- bob/bio/base/script/commands.py | 14 +++++++------- bob/bio/base/script/figure.py | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bob/bio/base/script/commands.py b/bob/bio/base/script/commands.py index 99d58f62..5a72af03 100644 --- a/bob/bio/base/script/commands.py +++ b/bob/bio/base/script/commands.py @@ -59,7 +59,7 @@ def metrics(ctx, scores, evaluation, **kargs): $ bob bio metrics {dev,eval}-scores1 {dev,eval}-scores2 """ - if 'criter' in ctx.meta and ctx.meta['criter'] == 'rr': + if 'criterion' in ctx.meta and ctx.meta['criterion'] == 'rr': process = bio_figure.Metrics(ctx, scores, evaluation, load.cmc) else: process = bio_figure.Metrics(ctx, scores, evaluation, load.split) @@ -365,25 +365,25 @@ def evaluate(ctx, scores, evaluation, **kwargs): # first time erase if existing file ctx.meta['open_mode'] = 'w' click.echo("Computing metrics with EER%s..." % log_str) - ctx.meta['criter'] = 'eer' # no criterion passed to evaluate + ctx.meta['criterion'] = 'eer' # no criterion passed to evaluate ctx.invoke(metrics, scores=scores, evaluation=evaluation) # other times, appends the content ctx.meta['open_mode'] = 'a' click.echo("Computing metrics with HTER%s..." % log_str) - ctx.meta['criter'] = 'hter' # no criterion passed in evaluate + ctx.meta['criterion'] = 'hter' # no criterion passed in evaluate ctx.invoke(metrics, scores=scores, evaluation=evaluation) if 'far_value' in ctx.meta and ctx.meta['far_value'] is not None: click.echo("Computing metrics with FAR=%f%s..." %\ (ctx.meta['far_value'], log_str)) - ctx.meta['criter'] = 'far' # no criterio % n passed in evaluate + ctx.meta['criterion'] = 'far' # no criterio % n passed in evaluate ctx.invoke(metrics, scores=scores, evaluation=evaluation) click.echo("Computing minDCF%s..." % log_str) - ctx.meta['criter'] = 'mindcf' # no criterion passed in evaluate + ctx.meta['criterion'] = 'mindcf' # no criterion passed in evaluate ctx.invoke(metrics, scores=scores, evaluation=evaluation) click.echo("Computing Cllr and minCllr%s..." % log_str) - ctx.meta['criter'] = 'cllr' # no criterion passed in evaluate + ctx.meta['criterion'] = 'cllr' # no criterion passed in evaluate ctx.invoke(metrics, scores=scores, evaluation=evaluation) # avoid closing pdf file before all figures are plotted @@ -407,7 +407,7 @@ def evaluate(ctx, scores, evaluation, **kwargs): # the last one closes the file ctx.meta['closef'] = True click.echo("Generating score histograms in %s..." % ctx.meta['output']) - ctx.meta['criter'] = 'hter' # no criterion passed in evaluate + ctx.meta['criterion'] = 'hter' # no criterion passed in evaluate ctx.forward(hist) click.echo("Evaluate successfully completed!") diff --git a/bob/bio/base/script/figure.py b/bob/bio/base/script/figure.py index 887ac3e7..31156f45 100644 --- a/bob/bio/base/script/figure.py +++ b/bob/bio/base/script/figure.py @@ -107,7 +107,7 @@ class Dir(measure_figure.PlotBase): class Metrics(measure_figure.Metrics): ''' Compute metrics from score files''' def init_process(self): - if self._criter == 'rr': + if self._criterion == 'rr': self._thres = [None] * self.n_systems if self._thres is None else \ self._thres @@ -117,7 +117,7 @@ class Metrics(measure_figure.Metrics): headers = ['' or title, 'Development %s' % input_names[0]] if self._eval and input_scores[1] is not None: headers.append('eval % s' % input_names[1]) - if self._criter == 'rr': + if self._criterion == 'rr': rr = bob.measure.recognition_rate(input_scores[0], self._thres[idx]) dev_rr = "%.1f%%" % (100 * rr) raws = [['RR', dev_rr]] @@ -128,7 +128,7 @@ class Metrics(measure_figure.Metrics): click.echo( tabulate(raws, headers, self._tablefmt), file=self.log_file ) - elif self._criter == 'mindcf': + elif self._criterion == 'mindcf': if 'cost' in self._ctx.meta: cost = 0.99 if 'cost' not in self._ctx.meta else\ self._ctx.meta['cost'] @@ -170,7 +170,7 @@ class Metrics(measure_figure.Metrics): click.echo( tabulate(raws, headers, self._tablefmt), file=self.log_file ) - elif self._criter == 'cllr': + elif self._criterion == 'cllr': cllr = bob.measure.calibration.cllr(input_scores[0][0], input_scores[0][1]) min_cllr = bob.measure.calibration.min_cllr( -- GitLab