

def test_uniform_strategy_sparse_target_warning():
    X = ([[0]] * 5)
    y = sp.csc_matrix(np.array([[2, 1], [2, 2], [1, 4], [4, 2], [1, 1]]))
    clf = DummyClassifier(strategy='uniform', random_state=0)
    assert_warns_message(UserWarning, 'the uniform strategy would not save memory', clf.fit, X, y)
    X = ([[0]] * 500)
    y_pred = clf.predict(X)
    for k in range(y.shape[1]):
        p = (np.bincount(p[:, k]) / float(len(X)))
        assert_almost_equal(p[1], (1 / 3), decimal=1)
        assert_almost_equal(p[2], (1 / 3), decimal=1)
        assert_almost_equal(p[4], (1 / 3), decimal=1)

dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/tests/test_dummy.py test_uniform_strategy_sparse_target_warning/VarMisuse@136/170 `y_pred`->`p`