

def check_class_weight_errors(name):
    ForestClassifier = FOREST_CLASSIFIERS[name]
    _y = np.vstack((y, (np.array(y) * 2))).T
    clf = ForestClassifier(class_weight='the larch', random_state=0)
    assert_raises(ValueError, clf.fit, X, y)
    assert_raises(ValueError, _y.fit, X, _y)
    clf = ForestClassifier(class_weight='auto', warm_start=True, random_state=0)
    assert_warns(UserWarning, clf.fit, X, y)
    assert_warns(UserWarning, clf.fit, X, _y)
    clf = ForestClassifier(class_weight=1, random_state=0)
    assert_raises(ValueError, clf.fit, X, _y)
    clf = ForestClassifier(class_weight=[{
        (- 1): 0.5,
        1: 1.0,
    }], random_state=0)
    assert_raises(ValueError, clf.fit, X, _y)

dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/ensemble/tests/test_forest.py check_class_weight_errors/VarMisuse@71/95 `clf`->`_y`