示例#1
0
 def test_const_vec(self):
     tf.standardize(np.array([2, 2, 2]))
示例#2
0
 def test_inf(self):
     tf.standardize(np.array([1, -1, np.inf, -2, 3, -3]))
示例#3
0
 def test_const_mat(self):
     tf.standardize(np.ones((6, 4)))
示例#4
0
 def test_vec(self):
     data_std = tf.standardize(np.array([1, -1, 2, -2, 3, -3]))
     assert np.isclose(np.mean(data_std), 0)
     assert np.isclose(np.std(data_std), 1)
示例#5
0
 def test_missing(self):
     tf.standardize(np.array([1, -1, np.nan, -2, 3, -3]))
示例#6
0
 def test_const_vec(self):
     tf.standardize(np.array([2, 2, 2]))
示例#7
0
    def test_clean_data(self):
        data_std = tf.standardize(DATA1)

        assert np.allclose(np.mean(data_std, 0), np.zeros(DATA1.shape[1]))
        assert np.allclose(np.std(data_std, 0), np.ones(DATA1.shape[1]))
示例#8
0
 def test_const_mat(self):
     tf.standardize(np.ones((6, 4)))
示例#9
0
 def test_inf(self):
     tf.standardize(np.array([1, -1, np.inf, -2, 3, -3]))
示例#10
0
 def test_missing(self):
     tf.standardize(np.array([1, -1, np.nan, -2, 3, -3]))
示例#11
0
 def test_vec(self):
     data_std = tf.standardize(np.array([1, -1, 2, -2, 3, -3]))
     assert np.isclose(np.mean(data_std), 0)
     assert np.isclose(np.std(data_std), 1)
示例#12
0
    def test_clean_data(self):
        data_std = tf.standardize(DATA1)

        assert np.allclose(np.mean(data_std, 0), np.zeros(DATA1.shape[1]))
        assert np.allclose(np.std(data_std, 0), np.ones(DATA1.shape[1]))