Exemplo n.º 1
0
def test_kmeans():
    clusters = kmeans.s(2).delay(DOCS).get()
    assert_equal(len(clusters), len(DOCS))
    assert_equal(set([0, 1]), set(clusters))

    clusters = big_kmeans.s(2).delay(DOCS).get()
    assert_equal(len(clusters), len(DOCS))
    assert_equal(set([0, 1]), set(clusters))
Exemplo n.º 2
0
def test_kmeans():
    clusters = kmeans.s(2).delay(DOCS).get()
    assert_equal(len(clusters), len(DOCS))
    assert_equal(set([0, 1]), set(clusters))

    clusters = big_kmeans.s(2).delay(DOCS).get()
    assert_equal(len(clusters), len(DOCS))
    assert_equal(set([0, 1]), set(clusters))
Exemplo n.º 3
0
def test_kmeans():
    clusters = kmeans.s(2).delay(DOCS).get()
    assert_equal(len(clusters), 2)
    assert_equal(DOCS, sorted(clusters[0] + clusters[1]))

    clusters = big_kmeans.s(3).delay(DOCS).get()
    assert_equal(len(clusters), 3)
    assert_equal(DOCS, sorted(clusters[0] + clusters[1] + clusters[2]))
Exemplo n.º 4
0
def test_kmeans():
    clusters = kmeans.s(2).delay(DOCS).get()
    assert_equal(len(clusters), 2)
    assert_equal(DOCS, sorted(clusters[0] + clusters[1]))

    clusters = big_kmeans.s(3).delay(DOCS).get()
    assert_equal(len(clusters), 3)
    assert_equal(DOCS, sorted(clusters[0] + clusters[1] + clusters[2]))