Example #1
0
 def test_const_vec(self):
     tf.standardize(np.array([2, 2, 2]))
Example #2
0
 def test_inf(self):
     tf.standardize(np.array([1, -1, np.inf, -2, 3, -3]))
Example #3
0
 def test_const_mat(self):
     tf.standardize(np.ones((6, 4)))
Example #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)
Example #5
0
 def test_missing(self):
     tf.standardize(np.array([1, -1, np.nan, -2, 3, -3]))
Example #6
0
 def test_const_vec(self):
     tf.standardize(np.array([2, 2, 2]))
Example #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]))
Example #8
0
 def test_const_mat(self):
     tf.standardize(np.ones((6, 4)))
Example #9
0
 def test_inf(self):
     tf.standardize(np.array([1, -1, np.inf, -2, 3, -3]))
Example #10
0
 def test_missing(self):
     tf.standardize(np.array([1, -1, np.nan, -2, 3, -3]))
Example #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)
Example #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]))