Commit 04280b11 authored by Theophile GENTILHOMME's avatar Theophile GENTILHOMME

[script][figure] Log error to warn for Nans in metrics; change message

parent 2df2c742
Pipeline #21514 passed with stage
in 11 minutes and 18 seconds
...@@ -293,8 +293,8 @@ class Metrics(MeasureBase): ...@@ -293,8 +293,8 @@ class Metrics(MeasureBase):
all_metrics = self._get_all_metrics(idx, input_scores, input_names) all_metrics = self._get_all_metrics(idx, input_scores, input_names)
fta_dev = float(all_metrics[0][0].replace('%', '')) fta_dev = float(all_metrics[0][0].replace('%', ''))
if fta_dev > 0.0: if fta_dev > 0.0:
LOGGER.error("NaNs scores (%s) were found in %s", all_metrics[0][0], LOGGER.warn("NaNs scores (%s) were found in %s amd removed",
dev_file) all_metrics[0][0], dev_file)
headers = [' ' or title, 'Development'] headers = [' ' or title, 'Development']
rows = [[self.names[0], all_metrics[0][1]], rows = [[self.names[0], all_metrics[0][1]],
[self.names[1], all_metrics[0][2]], [self.names[1], all_metrics[0][2]],
...@@ -306,7 +306,7 @@ class Metrics(MeasureBase): ...@@ -306,7 +306,7 @@ class Metrics(MeasureBase):
eval_file = input_names[1] eval_file = input_names[1]
fta_eval = float(all_metrics[1][0].replace('%', '')) fta_eval = float(all_metrics[1][0].replace('%', ''))
if fta_eval > 0.0: if fta_eval > 0.0:
LOGGER.error("NaNs scores (%s) were found in %s", LOGGER.warn("NaNs scores (%s) were found in %s and removed.",
all_metrics[1][0], eval_file) all_metrics[1][0], eval_file)
# computes statistics for the eval set based on the threshold a # computes statistics for the eval set based on the threshold a
# priori # priori
...@@ -577,10 +577,10 @@ class Roc(PlotBase): ...@@ -577,10 +577,10 @@ class Roc(PlotBase):
label=self._label('eval.', idx) label=self._label('eval.', idx)
) )
if self._far_at is not None: if self._far_at is not None:
from .. import farfrr from .. import fprfnr
for line in self._far_at: for line in self._far_at:
thres_line = far_threshold(dev_neg, dev_pos, line) thres_line = far_threshold(dev_neg, dev_pos, line)
eval_fmr, eval_fnmr = farfrr( eval_fmr, eval_fnmr = fprfnr(
eval_neg, eval_pos, thres_line) eval_neg, eval_pos, thres_line)
eval_fnmr = 1 - eval_fnmr eval_fnmr = 1 - eval_fnmr
mpl.scatter(eval_fmr, eval_fnmr, c=self._colors[idx], s=30) mpl.scatter(eval_fmr, eval_fnmr, c=self._colors[idx], s=30)
......
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