@@ -0,0 +1,878 @@
+import numpy as np%0Afrom ..neighbors import Neighbors%0A%0Afrom numpy.testing import assert_array_equal%0A%0Adef test_neighbors_1D():%0A    %22%22%22%0A    Nearest Neighbors in a line.%0A    %22%22%22%0A    # some constants%0A    n = 10%0A    n_2 = n/2%0A    samples = %5B%5Bx%5D for x in range(0, n)%5D%0A    labels  = %5B0%5D*n_2 + %5B1%5D*n_2%0A    zeros   = np.zeros(n_2)%0A    ones    = np.ones(n_2)%0A%0A    # k = 1%0A    nn = Neighbors(samples, labels=labels, k=1)%0A    assert_array_equal( nn.predict(%5B %5Bi +0.01%5D for i in range(0,n_2)%5D),%0A                        zeros)%0A    assert_array_equal( nn.predict(%5B %5Bi-0.01%5D for i in range(n_2, 10)%5D),%0A                        ones)%0A%0A    # k = 3%0A    nn = Neighbors(samples, labels=labels, k=3)%0A    assert_array_equal( nn.predict(%5B %5Bi +0.01%5D for i in range(0,5)%5D),%0A                        zeros)%0A    assert_array_equal( nn.predict(%5B %5Bi-0.01%5D for i in range(5, 10)%5D),%0A                        ones)%0A

Add tests for Nearest Neighbor Algorithm.