def test_cutoff_warning():
    X_data = [1, 2, 0.5, 0.7, 100, -1, -23, 0]

    cutoff = CutOff()

    with pytest.warns(UserWarning):
        cutoff.fit_transform(X_data)
Beispiel #2
0
def test_cutoff_warning():
    X_data = [1, 2, 0.5, 0.7, 100, -1, -23, 0]

    cutoff = CutOff()

    with pytest.raises(ValueError):
        cutoff.fit_transform(X_data)
Beispiel #3
0
def test_cutoff_transformer():
    cutoff = CutOff()

    X_data = np.array([1, 2, 0.5, 0.7, 100, -1, -23, 0]).reshape(-1, 1)

    assert np.all(
        cutoff.fit_transform(X_data) == np.array([1, 1, 0.5, 0.7, 1, 0, 0, 0
                                                  ]).reshape(-1, 1))
def test_cutoff_transformer():
    cutoff = CutOff()

    X_data = [1, 2, 0.5, 0.7, 100, -1, -23, 0]

    assert np.all(cutoff.fit_transform(X_data) == [1, 1, 0.5, 0.7, 1, 0, 0, 0])