def baseline_re_single_analysis(test_data_id, N, samp, cap=10):
    '\n    Analyze edge cases of relative errors on a single network\n    Uses the samp^{th} sample network of size N in test data test_data_id.\n    Relative errors in the range (0, 2^{cap}) are considered edge cases.\n    Returns the number of edge cases divided by the difference |T-B| - |B-T| as a percent.\n    T and B are as defined in (Katz and Reggia 2017).\n    '
    npz = fe.load_npz_file(('results/baseline_re_%s_N_%d_s_%d.npz' % (test_data_id, N, samp)))
    res = fe.load_pkl_file(('results/TvB_%s_N_%d_s_%d.pkl' % (test_data_id, N, samp)))
    re_un = npz['re_un']
    percent = ((100.0 * (re_un < (2 ** cap)).sum()) / np.array((res['T-B'] - res['B-T'])))
    print(('N=%d, samp %d: B-T = %d, T-B = %d, %d (%f%%) possibly unique slow RE(B) < 2**%d' % (N, samp, res['B-T'], res['T-B'], (re_un < (2 ** cap)).sum(), percent, cap)))
    return percent
Analyze edge cases of relative errors on a single network
Uses the samp^{th} sample network of size N in test data test_data_id.
Relative errors in the range (0, 2^{cap}) are considered edge cases.
Returns the number of edge cases divided by the difference |T-B| - |B-T| as a percent.
T and B are as defined in (Katz and Reggia 2017).
def baseline_re_single_analysis(test_data_id, N, samp, cap=10):
    '\n    Analyze edge cases of relative errors on a single network\n    Uses the samp^{th} sample network of size N in test data test_data_id.\n    Relative errors in the range (0, 2^{cap}) are considered edge cases.\n    Returns the number of edge cases divided by the difference |T-B| - |B-T| as a percent.\n    T and B are as defined in (Katz and Reggia 2017).\n    '
    npz = fe.load_npz_file(('results/baseline_re_%s_N_%d_s_%d.npz' % (test_data_id, N, samp)))
    res = fe.load_pkl_file(('results/TvB_%s_N_%d_s_%d.pkl' % (test_data_id, N, samp)))
    re_un = npz['re_un']
    percent = ((100.0 * (re_un < (2 ** cap)).sum()) / np.array((res['T-B'] - res['B-T'])))
    print(('N=%d, samp %d: B-T = %d, T-B = %d, %d (%f%%) possibly unique slow RE(B) < 2**%d' % (N, samp, res['B-T'], res['T-B'], (re_un < (2 ** cap)).sum(), percent, cap)))
    return percent