def expand_test_result_df(df_test):
    """Adds columns to a DataFrame with test results

    Args:
    df_test DataFrame as produced by trainer.ModelTrainer, i.e. with columns
      'tp', 'fp', 'fn', 'correct', 'total_examples' and 'examples_above_threshold'

    Returns:
    the input DataFrame with additional columns for 'precision', 'recall',
      'acc'uracy, 'f1' measure and 'coverage' percentage.
    """
    #print('type of df_test', str(type(df_test)))
    #print('keys in df_test', df_test.keys())
    df = df_test
    epsilon = 0.00001 # avoid division by zero
    df['precision'] = df['tp'] / (df['tp'] + df['fp'] + epsilon)
    df['recall'] = df['tp'] / (df['tp'] + df['fn'] + epsilon)
    df['acc'] = df['correct'] / df['examples_above_threshold']
    df['f1'] = 2*df['tp'] / (2*df['tp'] + df['fp'] + df['fn'] + epsilon)
    df['coverage'] = df['examples_above_threshold']/ (df['total_examples'] + epsilon)
    return df