14ee57f33aa9a07fa6440c049fefd47099dbc5ae,tensorflow_transform/beam/impl_test.py,BeamImplTest,testUniquesAnalyzerWithTopK,#BeamImplTest#,624

Before Change


        "index1": tf.VarLenFeature(tf.int64),
        "index2": tf.VarLenFeature(tf.int64)
    })
    self.assertDatasetsEqual(
        transformed_dataset,
        (expected_transformed_data, expected_transformed_schema))

  def testUniquesAnalyzerWithFrequencyThreshold(self):
    // User defined transform_fn accepts and returns a dict of Columns.
    def preprocessing_fn(inputs):

After Change


        {"a": "hello goodbye world"},
        {"a": "hello goodbye foo"}
    ]
    input_metadata = dataset_metadata.DatasetMetadata({
        "a": sch.ColumnSchema(tf.string, [], sch.FixedColumnRepresentation())
    })
    // Generated vocab (ordered by frequency, then value) should be:
    // ["hello", "world", "goodbye", "foo"]. After applying top_k=2, this becomes
    // ["hello", "world"].
    expected_data = [
        {"index1": [0, 0, 1], "index2": [0, 0, 1]},
        {"index1": [0, -99, 1], "index2": [0, -9, 1]},
        {"index1": [0, -99, -99], "index2": [0, -9, -9]}
    ]
    expected_metadata = dataset_metadata.DatasetMetadata({
        "index1": sch.ColumnSchema(tf.int64, [None],
                                   sch.ListColumnRepresentation()),
        "index2": sch.ColumnSchema(tf.int64, [None],
                                   sch.ListColumnRepresentation())
    })
    self.assertAnalyzeAndTransformResults(
        input_data, input_metadata, preprocessing_fn, expected_data,
        expected_metadata)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 26

Instances


Project Name: tensorflow/transform
Commit Name: 14ee57f33aa9a07fa6440c049fefd47099dbc5ae
Time: 2017-04-26
Author: no-reply@google.com
File Name: tensorflow_transform/beam/impl_test.py
Class Name: BeamImplTest
Method Name: testUniquesAnalyzerWithTopK


Project Name: tensorflow/transform
Commit Name: 14ee57f33aa9a07fa6440c049fefd47099dbc5ae
Time: 2017-04-26
Author: no-reply@google.com
File Name: tensorflow_transform/beam/impl_test.py
Class Name: BeamImplTest
Method Name: testUniquesAnalyzerWithTopK


Project Name: tensorflow/transform
Commit Name: 14ee57f33aa9a07fa6440c049fefd47099dbc5ae
Time: 2017-04-26
Author: no-reply@google.com
File Name: tensorflow_transform/beam/impl_test.py
Class Name: BeamImplTest
Method Name: testUniquesAnalyzerWithFrequencyThreshold


Project Name: tensorflow/transform
Commit Name: 14ee57f33aa9a07fa6440c049fefd47099dbc5ae
Time: 2017-04-26
Author: no-reply@google.com
File Name: tensorflow_transform/beam/impl_test.py
Class Name: BeamImplTest
Method Name: testUniquesAnalyzerWithFrequencyThresholdTooHigh