

def test_binary_blocks_perceptron_online():
    (X, Y) = generate_blocks(n_samples=10)
    inference_method = get_installed(['qpbo', 'ad3', 'lp'])[0]
    crf = GridCRF(inference_method=inference_method)
    clf = StructuredPerceptron(model=crf, max_iter=20)
    clf.fit(X, Y)
    Y_pred = clf.predict(X)
    assert_array_equal(Y, Y_pred)

dataset/ETHPy150Open pystruct/pystruct/pystruct/tests/test_learners/test_structured_perceptron.py test_binary_blocks_perceptron_online/original