def test_multiple_feature_weight(self): A = np.array([[1, 2], [3, 4], [5, 6]]) B = np.array([[1], [1], [1]]) C = multiple_feature_weight(A, B) np.testing.assert_equal(C, A) B = np.array([[2], [2], [2]]) C = multiple_feature_weight(A, B) np.testing.assert_equal(C, np.array([[2, 4], [6, 8], [10, 12]])) B = np.array([[1, 2], [2, 1], [1, 2]]) C = multiple_feature_weight(A, B) np.testing.assert_equal( C, np.array([[1, 2, 2, 4], [6, 3, 8, 4], [5, 10, 6, 12]]))
def test_multiple_feature_weight(self): A = np.array([[1,2],[3,4],[5,6]]) B = np.array([[1],[1],[1]]) C = multiple_feature_weight(A, B) np.testing.assert_equal(C, A) B = np.array([[2],[2],[2]]) C = multiple_feature_weight(A, B) np.testing.assert_equal(C, np.array([[2,4],[6,8],[10,12]])) B = np.array([[1,2],[2,1],[1,2]]) C = multiple_feature_weight(A, B) np.testing.assert_equal(C, np.array([[ 1, 2, 2, 4], [ 6, 3, 8, 4], [ 5, 10, 6, 12]]))
def _pre_propcess(self, blend, X): X = multiple_feature_weight(blend, self.feature_func(X)) return X