import re


def parse_metrics(lines):
    """
    Parse metrics data into key-value pairs.
    """
    metrics_class = lines[0].strip().split('.')[-1]
    metric_names = ['{}__{}'.format(metrics_class, n)
                    for n in lines[1].strip().split('\t')]
    metric_vals = [float(v) if not re.search(r'[^\d.]+', v)
                   else v
                   for v in lines[2].strip().split('\t')]
    return dict(zip(metric_names, metric_vals))