Skip to content
Snippets Groups Projects
Commit 7cd81e26 authored by Theophile GENTILHOMME's avatar Theophile GENTILHOMME
Browse files

Change variable name from criter to criterion

parent bbfa677e
Branches
Tags
1 merge request!146Add 4-5-col files related functionalities and add click commands
Pipeline #
......@@ -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!")
......@@ -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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment