Exemplo n.º 1
0
    def test_predict_df(self):

        c = ChildClassifier(features=["x", "y"], targets=["c"])

        res = c.predict(DATA_FRAME)
        assert is_series(res)
        assert np.array_equal(res.index, DATA_FRAME.index)
        assert res.name == "c"
Exemplo n.º 2
0
    def test_predict_df(self):

        c = ChildRegressor(features=['x', 'y'], targets=['c'])

        res = c.predict(DATA_FRAME)
        assert is_series(res)
        assert np.array_equal(res.index, DATA_FRAME.index)
        assert res.name == 'c'
Exemplo n.º 3
0
    def test_predict_arr_pdmode(self):

        c = ChildClassifier(features=["x", "y"], targets=["a"])

        with pytest.warns(CompatabilityWarning):
            res = c.predict(TWO_D_ARRAY)

        assert is_series(res)
        assert np.array_equal(res.index, range(len(TWO_D_ARRAY)))
        assert res.name == "a"
Exemplo n.º 4
0
    def test_predict_arr_pdmode(self):

        c = ChildRegressor(features=['x', 'y'], targets=['a'])

        with pytest.warns(CompatabilityWarning):
            res = c.predict(TWO_D_ARRAY)

        assert is_series(res)
        assert np.array_equal(res.index, range(len(TWO_D_ARRAY)))
        assert res.name == 'a'
def test_variances_are_dfs():
    v_t = VarianceThreshold(0)
    v_t.fit(DATA)
    assert is_series(v_t.variances_)