コード例 #1
0
ファイル: test_dataset.py プロジェクト: sungjinlees/spira
def test_mean_axis0():
    expected = [2, 4, 10. / 3, 1]
    for func in (sp.csr_matrix, sp.csc_matrix, sp.coo_matrix):
        means = mean(func(X, dtype=np.float64), axis=0)
    assert_array_almost_equal(means, expected)
コード例 #2
0
ファイル: test_dataset.py プロジェクト: lizhangzhan/spira
def test_mean_axis0():
    expected = [2, 4, 10./3, 1]
    for func in (sp.csr_matrix, sp.csc_matrix, sp.coo_matrix):
        means = mean(func(X, dtype=np.float64), axis=0)
    assert_array_almost_equal(means, expected)
コード例 #3
0
ファイル: test_dataset.py プロジェクト: sungjinlees/spira
def test_mean_axis1():
    expected = [2, 3.5, 3.5, 2, 1]
    for func in (sp.csr_matrix, sp.csc_matrix, sp.coo_matrix):
        means = mean(func(X, dtype=np.float64))
        assert_array_almost_equal(means, expected)
コード例 #4
0
ファイル: test_dataset.py プロジェクト: lizhangzhan/spira
def test_mean_axis1():
    expected = [2, 3.5, 3.5, 2, 1]
    for func in (sp.csr_matrix, sp.csc_matrix, sp.coo_matrix):
        means = mean(func(X, dtype=np.float64))
        assert_array_almost_equal(means, expected)