You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Intermittently this test case throws this error, mostly because of the random number that is generated.
=================================== FAILURES ===================================
_________________ TestTransformers.test_staticpowertransformer _________________
self = <numalogic.tests.preprocess.test_transformer.TestTransformers testMethod=test_staticpowertransformer>
def test_staticpowertransformer(self):
x = 1 + np.random.randn(5, 3)
transformer = StaticPowerTransformer(3, add_factor=2)
x_prime = transformer.transform(x)
assert_almost_equal(np.power(2 + x, 3), x_prime)
assert_almost_equal(transformer.fit_transform(x), x_prime)
> assert_almost_equal(transformer.inverse_transform(x_prime), x, decimal=4)
E AssertionError:
E Arrays are not almost equal to 4 decimals
E
E x and y nan location mismatch:
E x: array([[1.9392, 3.3033, 0.2871],
E [1.5581, 1.6368, 2.0375],
E [0.3713, 3.0054, 1.0976],...
E y: array([[ 1.9392, 3.3033, 0.2871],
E [ 1.5581, 1.6368, 2.0375],
E [ 0.3713, 3.0054, 1.0976],...
numalogic/tests/preprocess/test_transformer.py:26: AssertionError
=============================== warnings summary ===============================
numalogic/tests/preprocess/test_transformer.py::TestTransformers::test_staticpowertransformer
/home/runner/work/numalogic/numalogic/numalogic/preprocess/transformer.py:41: RuntimeWarning: invalid value encountered in power
return np.power(X, 1.0 / self.n) - self.add_factor
Need to offset the random number to make sure that test case always passes.
The text was updated successfully, but these errors were encountered:
Intermittently this test case throws this error, mostly because of the random number that is generated.
Need to offset the random number to make sure that test case always passes.
The text was updated successfully, but these errors were encountered: