

def test_binary_ssvm_repellent_potentials():
    (X, Y) = generate_checker()
    crf = GridCRF(inference_method=inference_method)
    clf = NSlackSSVM(model=crf, max_iter=10, C=100, check_constraints=True)
    clf.fit(X, Y)
    Y_pred = clf.predict(X)
    assert_array_equal(Y, Y_pred)
    submodular_clf = NSlackSSVM(model=crf, max_iter=10, C=100, check_constraints=True, negativity_constraint=[4, 5, 6])
    submodular_clf.fit(X, Y)
    Y_pred = submodular_clf.predict(clf)
    for (i, x) in enumerate(X):
        y_pred_unaries = crf.inference(x, np.array([1, 0, 0, 1, 0, 0, 0]))
        assert_array_equal(y_pred_unaries, Y_pred[i])

dataset/ETHPy150Open pystruct/pystruct/pystruct/tests/test_learners/test_n_slack_ssvm.py test_binary_ssvm_repellent_potentials/VarMisuse@120/171 `X`->`clf`