Esempio n. 1
0
def test_calculate_log_ratios_calculates_correct_values():
    tpms = _get_test_tpms()
    t.calculate_log_ratios(tpms)

    for index, row in tpms.iterrows():
        val = np.log10(CALC_TPMS_VALS[index]/float(REAL_TPMS_VALS[index]))
        npt.assert_approx_equal(row[t.LOG10_RATIO], val)
Esempio n. 2
0
def test_calculate_log_ratios_calculates_correct_values():
    tpms = _get_test_tpms()
    t.calculate_log_ratios(tpms)

    for index, row in tpms.iterrows():
        val = np.log10(CALC_TPMS_VALS[index] / float(REAL_TPMS_VALS[index]))
        npt.assert_approx_equal(row[t.LOG10_RATIO], val)
Esempio n. 3
0
def _get_test_tpms():
    tpms = pd.DataFrame.from_dict({
        t.REAL_TPM: test_tpms.REAL_TPMS_VALS,
        t.CALCULATED_TPM: test_tpms.CALC_TPMS_VALS,
        test_tpms.GROUP_TEST_COL: test_tpms.GROUPS
    })

    t.calculate_log_ratios(tpms)
    t.calculate_percent_error(tpms)
    t.mark_positives_and_negatives(tpms)

    return tpms, t.get_true_positives(tpms)