jrmccluskey commented on code in PR #31026:
URL: https://github.com/apache/beam/pull/31026#discussion_r1571282051
##########
sdks/python/apache_beam/ml/transforms/tft_test.py:
##########
@@ -155,6 +155,134 @@ def test_ScaleTo01(self):
actual_output, equal_to(expected_output, equals_fn=np.array_equal))
+class ScaleToGaussianTest(unittest.TestCase):
+ def setUp(self) -> None:
+ self.artifact_location = tempfile.mkdtemp()
+
+ def tearDown(self):
+ shutil.rmtree(self.artifact_location)
+
+ def test_gaussian_list_uniform_distribution(self):
+ list_data = [{'x': [1, 2, 3]}, {'x': [4, 5, 6]}]
+ with beam.Pipeline() as p:
+ list_result = (
+ p
+ | "listCreate" >> beam.Create(list_data)
+ | "listMLTransform" >> base.MLTransform(
+ write_artifact_location=self.artifact_location).with_transform(
+ tft.ScaleToGaussian(columns=['x'])))
+
+ expected_data = [
+ np.array([-1.46385, -0.87831, -0.29277], dtype=np.float32),
Review Comment:
switched to the np float comparison function
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]