

def test_binary_ssvm_attractive_potentials():
    (X, Y) = generate_blocks(n_samples=10)
    crf = GridCRF(inference_method=inference_method)
    submodular_clf = NSlackSSVM(model=crf, max_iter=200, C=100, check_constraints=True, negativity_constraint=[5])
    submodular_clf.fit(X, Y)
    Y_pred = submodular_clf.predict(X)
    assert_array_equal(Y, Y_pred)
    assert_true((submodular_clf.w[5] < 0))

dataset/ETHPy150Open pystruct/pystruct/pystruct/tests/test_learners/test_n_slack_ssvm.py test_binary_ssvm_attractive_potentials/original