Пример #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))
Пример #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))
Пример #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]))
Пример #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]))