Exemplo n.º 1
0
def test_mean_centering():
    X1 = np.array([[1,2,3], [4,5,6]])
    X1_out = np.array([[-1, -1, -1], [ 1,  1,  1]])
    mc = MeanCenterer()
    assert(mc.fit_transform(X1).all() == X1_out.all())

    X2 = [1, 2, 3]
    X2_out = np.array([-1, 0, 1])
    mc = MeanCenterer()
    assert(mc.fit_transform(X2).all().all() == X2_out.all())
Exemplo n.º 2
0
def test_mean_centering():
    X1 = np.array([[1, 2, 3], [4, 5, 6]])
    X1_out = np.array([[-1, -1, -1], [1, 1, 1]])
    mc = MeanCenterer()
    assert (mc.fit_transform(X1).all() == X1_out.all())

    X2 = [1, 2, 3]
    X2_out = np.array([-1, 0, 1])
    mc = MeanCenterer()
    assert (mc.fit_transform(X2).all().all() == X2_out.all())
Exemplo n.º 3
0
def test_mean_centering():
    X1 = np.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])
    X1_out = np.array([[-1.0, -1.0, -1.0], [1.0, 1.0, 1.0]])
    mc = MeanCenterer()
    assert mc.fit_transform(X1).all() == X1_out.all()

    X2 = [1.0, 2.0, 3.0]
    X2_out = np.array([-1.0, 0.0, 1.0])
    mc = MeanCenterer()
    assert mc.fit_transform(X2).all().all() == X2_out.all()
Exemplo n.º 4
0
def test_list_mean_centering():
    X2 = [1.0, 2.0, 3.0]
    X2_out = np.array([-1.0, 0.0, 1.0])
    mc = MeanCenterer()
    assert(mc.fit_transform(X2).all().all() == X2_out.all())
Exemplo n.º 5
0
def test_list_mean_centering():
    X2 = [1.0, 2.0, 3.0]
    X2_out = np.array([-1.0, 0.0, 1.0])
    mc = MeanCenterer()
    assert(mc.fit_transform(X2).all().all() == X2_out.all())
Exemplo n.º 6
0
def test_array_mean_centering():
    X1 = np.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])
    X1_out = np.array([[-1.0, -1.0, -1.0], [1.0,  1.0,  1.0]])
    mc = MeanCenterer()
    assert(mc.fit_transform(X1).all() == X1_out.all())