def test_deprecated_munkres():
    y = np.array([0, 1, 0, 1, 0, 1, 1, 1])
    y_pred = np.array([0, 0, 0, 0, 1, 1, 1, 1])
    (reward, assignment) = unsupervised_clustering_accuracy(y, y_pred)
    assert (reward == 0.625)
    assert (assignment == np.array([[0, 0], [1, 1]])).all()
    y = np.array([1, 1, 2, 2, 0, 0, 3, 3])
    y_pred = np.array([1, 1, 2, 2, 3, 3, 0, 0])
    (reward, assignment) = unsupervised_clustering_accuracy(y, y_pred)
    assert (reward == 1.0)
    assert (assignment == np.array([[0, 3], [1, 1], [2, 2], [3, 0]])).all()
def test_deprecated_munkres():
    y = np.array([0, 1, 0, 1, 0, 1, 1, 1])
    y_pred = np.array([0, 0, 0, 0, 1, 1, 1, 1])
    (reward, assignment) = unsupervised_clustering_accuracy(y, y_pred)
    assert (reward == 0.625)
    assert (assignment == np.array([[0, 0], [1, 1]])).all()
    y = np.array([1, 1, 2, 2, 0, 0, 3, 3])
    y_pred = np.array([1, 1, 2, 2, 3, 3, 0, 0])
    (reward, assignment) = unsupervised_clustering_accuracy(y, y_pred)
    assert (reward == 1.0)
    assert (assignment == np.array([[0, 3], [1, 1], [2, 2], [3, 0]])).all()