Example #1
0
 def test_min_max_indicator_inplace_false(self, data_frame):
     """ Test that not setting inplace rules equates to more columns after the transformation"""
     test_feature = MinMaxNormalizer(
         columns=TestMinMaxNormalizer.price_columns, inplace=False)
     test_feature.reset()
     transformed = test_feature.transform(data_frame)
     assert transformed is not None
     assert len(data_frame.columns) != len(transformed.columns)
Example #2
0
    def test_min_max_indicator(self, data_frame, reference_frame):
        """  Check that the min-max indicator is to be expected. """
        test_feature = MinMaxNormalizer(
            columns=TestMinMaxNormalizer.price_columns)
        test_feature.reset()

        roundable = 4

        transformed = test_feature.transform(data_frame)
        assert transformed is not None

        transformed = transformed.round(roundable)
        reference_frame = reference_frame.round(roundable)

        close_1 = transformed.Close.values
        close_2 = reference_frame.Close.values

        is_valid = (close_1 == close_2).all()
        assert is_valid