Commit a56c4d88 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Helpers for creating common commands

parent a143c51f
Pipeline #21201 passed with stage
in 15 minutes and 12 seconds
This diff is collapsed.
This diff is collapsed.
...@@ -160,8 +160,10 @@ class Metrics(MeasureBase): ...@@ -160,8 +160,10 @@ class Metrics(MeasureBase):
output stream output stream
''' '''
def __init__(self, ctx, scores, evaluation, func_load): def __init__(self, ctx, scores, evaluation, func_load,
names=('FtA', 'FMR', 'FNMR', 'FAR', 'FRR', 'HTER')):
super(Metrics, self).__init__(ctx, scores, evaluation, func_load) super(Metrics, self).__init__(ctx, scores, evaluation, func_load)
self.names = names
self._tablefmt = ctx.meta.get('tablefmt') self._tablefmt = ctx.meta.get('tablefmt')
self._criterion = ctx.meta.get('criterion') self._criterion = ctx.meta.get('criterion')
self._open_mode = ctx.meta.get('open_mode') self._open_mode = ctx.meta.get('open_mode')
...@@ -225,12 +227,12 @@ class Metrics(MeasureBase): ...@@ -225,12 +227,12 @@ class Metrics(MeasureBase):
dev_frr_str = "%.1f%%" % (100 * dev_frr) dev_frr_str = "%.1f%%" % (100 * dev_frr)
dev_hter_str = "%.1f%%" % (100 * dev_hter) dev_hter_str = "%.1f%%" % (100 * dev_hter)
headers = ['' or title, 'Development %s' % dev_file] headers = ['' or title, 'Development %s' % dev_file]
raws = [['FtA', dev_fta_str], raws = [[self.names[0], dev_fta_str],
['FMR', dev_fmr_str], [self.names[1], dev_fmr_str],
['FNMR', dev_fnmr_str], [self.names[2], dev_fnmr_str],
['FAR', dev_far_str], [self.names[3], dev_far_str],
['FRR', dev_frr_str], [self.names[4], dev_frr_str],
['HTER', dev_hter_str]] [self.names[5], dev_hter_str]]
if self._eval: if self._eval:
# computes statistics for the eval set based on the threshold a priori # computes statistics for the eval set based on the threshold a priori
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment