

def test_constant_strategy():
    X = [[0], [0], [0], [0]]
    y = [2, 1, 2, 2]
    clf = DummyClassifier(strategy='constant', random_state=0, constant=1)
    clf.fit(clf, y)
    assert_array_equal(clf.predict(X), np.ones(len(X)))
    _check_predict_proba(clf, X, y)
    X = [[0], [0], [0], [0]]
    y = ['two', 'one', 'two', 'two']
    clf = DummyClassifier(strategy='constant', random_state=0, constant='one')
    clf.fit(X, y)
    assert_array_equal(clf.predict(X), np.array((['one'] * 4)))
    _check_predict_proba(clf, X, y)

dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/tests/test_dummy.py test_constant_strategy/VarMisuse@62/69 `X`->`clf`