コード例 #1
0
ファイル: test_tpms.py プロジェクト: COMBINE-lab/piquant
def test_apply_classifiers_adds_correct_columns():
    classifier_names = ["a", "b", "c"]
    classifiers = [_DummyClassifier(x) for x in classifier_names]

    tpms = _get_test_tpms()
    t.apply_classifiers(tpms, classifiers)

    for name in classifier_names:
        assert tpms[name] is not None
コード例 #2
0
def test_apply_classifiers_adds_correct_columns():
    classifier_names = ["a", "b", "c"]
    classifiers = [_DummyClassifier(x) for x in classifier_names]

    tpms = _get_test_tpms()
    t.apply_classifiers(tpms, classifiers)

    for name in classifier_names:
        assert tpms[name] is not None
コード例 #3
0
ファイル: test_tpms.py プロジェクト: COMBINE-lab/piquant
def test_apply_classifiers_calculates_correct_values():
    name = "dummy"
    val = 5
    classifiers = [_DummyClassifier(name, lambda x: x[t.CALCULATED_TPM] + val)]

    tpms = _get_test_tpms()
    t.apply_classifiers(tpms, classifiers)

    for index, row in tpms.iterrows():
        assert row[name] == CALC_TPMS_VALS[index] + val
コード例 #4
0
def test_apply_classifiers_calculates_correct_values():
    name = "dummy"
    val = 5
    classifiers = [_DummyClassifier(name, lambda x: x[t.CALCULATED_TPM] + val)]

    tpms = _get_test_tpms()
    t.apply_classifiers(tpms, classifiers)

    for index, row in tpms.iterrows():
        assert row[name] == CALC_TPMS_VALS[index] + val