コード例 #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"
コード例 #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'
コード例 #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"
コード例 #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'
コード例 #5
0
def test_variances_are_dfs():
    v_t = VarianceThreshold(0)
    v_t.fit(DATA)
    assert is_series(v_t.variances_)