Commit 3e83cf9a authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Handle nans in sorting more properly

parent 37726f48
"""Prints Cross-db metrics analysis """Prints Cross-db metrics analysis
""" """
import os
import click import click
import jinja2
import logging import logging
import math
import os
import yaml import yaml
import jinja2 from bob.bio.base.score.load import split
from tabulate import tabulate from bob.extension.scripts.click_helper import verbosity_option, bool_option
from bob.measure import eer_threshold, farfrr from bob.measure import eer_threshold, farfrr
from bob.measure.script import common_options from bob.measure.script import common_options
from bob.measure.utils import get_fta from bob.measure.utils import get_fta
from bob.extension.scripts.click_helper import verbosity_option, bool_option
from bob.bio.base.score.load import split
from gridtk.generator import expand from gridtk.generator import expand
from tabulate import tabulate
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
...@@ -102,10 +103,8 @@ def cross(ctx, score_jinja_template, databases, protocols, algorithms, ...@@ -102,10 +103,8 @@ def cross(ctx, score_jinja_template, databases, protocols, algorithms,
def sort_key(alg): def sort_key(alg):
r = [] r = []
for grp in ('eval', 'dev', 'train'): for grp in ('eval', 'dev', 'train'):
hter = metrics.get( hter = metrics[(train_database, train_protocol, alg, group)][0]
(train_database, train_protocol, alg, group)) r.append(1 if math.isnan(hter) else hter)
hter = hter if hter is None else hter[0]
r.append(hter)
return tuple(r) return tuple(r)
algorithms = sorted(algorithms, key=sort_key) algorithms = sorted(algorithms, key=sort_key)
......
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