def test_vectorizer():
 data = np.random.rand(150, 18, 6)
 vect = Vectorizer()
 result = vect.fit_transform(data)
 assert_equal(result.ndim, 2)
 orig_data = vect.inverse_transform(result)
 assert_equal(orig_data.ndim, 3)
 assert_array_equal(orig_data, data)
 assert_array_equal(vect.inverse_transform(result[1:]), data[1:])
 assert_equal(vect.fit_transform(np.random.rand(150, 18, 6, 3)).shape, (150, 324))
 assert_equal(vect.fit_transform(data[1:]).shape, (149, 108))
 vect.fit(np.random.rand(105, 12, 3))
 assert_raises(ValueError, vect.transform, np.random.rand(105, 12, 3, 1))
 assert_raises(ValueError, vect.inverse_transform, np.random.rand(102, 12, 12))

def test_vectorizer ( ) : data = np . random . rand ( 150 , 18 , 6 ) vect = Vectorizer ( ) result = vect . fit_transform ( data ) assert_equal ( result . ndim , 2 ) orig_data = vect . inverse_transform ( result ) assert_equal ( orig_data . ndim , 3 ) assert_array_equal ( orig_data , data ) assert_array_equal ( vect . inverse_transform ( result [ 1 : ] ) , data [ 1 : ] ) assert_equal ( vect . fit_transform ( np . random . rand ( 150 , 18 , 6 , 3 ) ) . shape , ( 150 , 324 ) ) assert_equal ( vect . fit_transform ( data [ 1 : ] ) . shape , ( 149 , 108 ) ) vect . fit ( np . random . rand ( 105 , 12 , 3 ) ) assert_raises ( ValueError , vect . transform , np . random . rand ( 105 , 12 , 3 , 1 ) ) assert_raises ( ValueError , vect . inverse_transform , np . random . rand ( 102 , 12 , 12 ) )
test vectorizer .