Skip to content

Commit

Permalink
Project import generated by Copybara.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 219664000
  • Loading branch information
tf-transform-team authored and zoyahav committed Nov 1, 2018
1 parent 88f209c commit c8ee7f1
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 18 deletions.
22 changes: 12 additions & 10 deletions docs/api_docs/python/tft/coders/CsvCoder.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ Initializes CsvCoder.
* <b>`delimiter`</b>: A one-character string used to separate fields.
* <b>`secondary_delimiter`</b>: A one-character string used to separate values within
the same field.
* <b>`multivalent_columns`</b>: A list of names for multivalent columns that need
to be split based on secondary delimiter.
* <b>`multivalent_columns`</b>: A list of names for multivalent columns that need to
be split based on secondary delimiter.


#### Raises:

Expand All @@ -56,14 +57,15 @@ Decodes the given string record according to the schema.

Missing value handling is as follows:

1.a) If FixedLenFeature and has a default value, use that value for missing
entries.
1.b) If FixedLenFeature and doesn't has default value throw an Exception on
missing entries.
1. For FixedLenFeature:
1. If FixedLenFeature and has a default value, use that value for
missing entries.
2. If FixedLenFeature and doesn't have default value throw an Exception
on missing entries.

2) For VarLenFeature return an empty array.
2. For VarLenFeature return an empty array.

3) For SparseFeature throw an Exception if only one of the indices or values
3. For SparseFeature throw an Exception if only one of the indices or values
has a missing entry. If both indices and values are missing, return
a tuple of 2 empty arrays.

Expand Down Expand Up @@ -98,8 +100,8 @@ Encode a tf.transform encoded dict to a csv-formatted string.

#### Args:

* <b>`instance`</b>: A python dictionary where the keys are the column names and
the values are fixed len or var len encoded features.
* <b>`instance`</b>: A python dictionary where the keys are the column names and the
values are fixed len or var len encoded features.


#### Returns:
Expand Down
2 changes: 1 addition & 1 deletion docs/api_docs/python/tft/compute_and_apply_vocabulary.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ zero. String value not in the vocabulary is assigned default_value.

#### Raises:

* <b>`ValueError`</b>: If `top_k` or `frequency_threshold` is negative.
* <b>`ValueError`</b>: If `top_k` or `frequency_threshold` is negative.
2 changes: 1 addition & 1 deletion docs/api_docs/python/tft/vocabulary.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ The path name for the vocabulary file containing the unique values of `x`.

#### Raises:

* <b>`ValueError`</b>: If `top_k` or `frequency_threshold` is negative.
* <b>`ValueError`</b>: If `top_k` or `frequency_threshold` is negative.
9 changes: 9 additions & 0 deletions docs/api_docs/python/tft_beam/AnalyzeAndTransformDataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<meta itemprop="property" content="infer_output_type"/>
<meta itemprop="property" content="next"/>
<meta itemprop="property" content="register_urn"/>
<meta itemprop="property" content="runner_api_requires_keyed_input"/>
<meta itemprop="property" content="to_runner_api"/>
<meta itemprop="property" content="to_runner_api_parameter"/>
<meta itemprop="property" content="to_runner_api_pickled"/>
Expand Down Expand Up @@ -255,6 +256,14 @@ register_urn(



<h3 id="runner_api_requires_keyed_input"><code>runner_api_requires_keyed_input</code></h3>

``` python
runner_api_requires_keyed_input()
```



<h3 id="to_runner_api"><code>to_runner_api</code></h3>

``` python
Expand Down
9 changes: 9 additions & 0 deletions docs/api_docs/python/tft_beam/AnalyzeDataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<meta itemprop="property" content="infer_output_type"/>
<meta itemprop="property" content="next"/>
<meta itemprop="property" content="register_urn"/>
<meta itemprop="property" content="runner_api_requires_keyed_input"/>
<meta itemprop="property" content="to_runner_api"/>
<meta itemprop="property" content="to_runner_api_parameter"/>
<meta itemprop="property" content="to_runner_api_pickled"/>
Expand Down Expand Up @@ -255,6 +256,14 @@ register_urn(



<h3 id="runner_api_requires_keyed_input"><code>runner_api_requires_keyed_input</code></h3>

``` python
runner_api_requires_keyed_input()
```



<h3 id="to_runner_api"><code>to_runner_api</code></h3>

``` python
Expand Down
9 changes: 9 additions & 0 deletions docs/api_docs/python/tft_beam/ReadTransformFn.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<meta itemprop="property" content="infer_output_type"/>
<meta itemprop="property" content="next"/>
<meta itemprop="property" content="register_urn"/>
<meta itemprop="property" content="runner_api_requires_keyed_input"/>
<meta itemprop="property" content="to_runner_api"/>
<meta itemprop="property" content="to_runner_api_parameter"/>
<meta itemprop="property" content="to_runner_api_pickled"/>
Expand Down Expand Up @@ -230,6 +231,14 @@ register_urn(



<h3 id="runner_api_requires_keyed_input"><code>runner_api_requires_keyed_input</code></h3>

``` python
runner_api_requires_keyed_input()
```



<h3 id="to_runner_api"><code>to_runner_api</code></h3>

``` python
Expand Down
9 changes: 9 additions & 0 deletions docs/api_docs/python/tft_beam/TransformDataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<meta itemprop="property" content="infer_output_type"/>
<meta itemprop="property" content="next"/>
<meta itemprop="property" content="register_urn"/>
<meta itemprop="property" content="runner_api_requires_keyed_input"/>
<meta itemprop="property" content="to_runner_api"/>
<meta itemprop="property" content="to_runner_api_parameter"/>
<meta itemprop="property" content="to_runner_api_pickled"/>
Expand Down Expand Up @@ -247,6 +248,14 @@ register_urn(



<h3 id="runner_api_requires_keyed_input"><code>runner_api_requires_keyed_input</code></h3>

``` python
runner_api_requires_keyed_input()
```



<h3 id="to_runner_api"><code>to_runner_api</code></h3>

``` python
Expand Down
9 changes: 9 additions & 0 deletions docs/api_docs/python/tft_beam/WriteMetadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<meta itemprop="property" content="infer_output_type"/>
<meta itemprop="property" content="next"/>
<meta itemprop="property" content="register_urn"/>
<meta itemprop="property" content="runner_api_requires_keyed_input"/>
<meta itemprop="property" content="to_runner_api"/>
<meta itemprop="property" content="to_runner_api_parameter"/>
<meta itemprop="property" content="to_runner_api_pickled"/>
Expand Down Expand Up @@ -235,6 +236,14 @@ register_urn(



<h3 id="runner_api_requires_keyed_input"><code>runner_api_requires_keyed_input</code></h3>

``` python
runner_api_requires_keyed_input()
```



<h3 id="to_runner_api"><code>to_runner_api</code></h3>

``` python
Expand Down
9 changes: 9 additions & 0 deletions docs/api_docs/python/tft_beam/WriteTransformFn.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<meta itemprop="property" content="infer_output_type"/>
<meta itemprop="property" content="next"/>
<meta itemprop="property" content="register_urn"/>
<meta itemprop="property" content="runner_api_requires_keyed_input"/>
<meta itemprop="property" content="to_runner_api"/>
<meta itemprop="property" content="to_runner_api_parameter"/>
<meta itemprop="property" content="to_runner_api_pickled"/>
Expand Down Expand Up @@ -235,6 +236,14 @@ register_urn(



<h3 id="runner_api_requires_keyed_input"><code>runner_api_requires_keyed_input</code></h3>

``` python
runner_api_requires_keyed_input()
```



<h3 id="to_runner_api"><code>to_runner_api</code></h3>

``` python
Expand Down
13 changes: 7 additions & 6 deletions tensorflow_transform/coders/csv_coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,14 +504,15 @@ def decode(self, csv_string):
Missing value handling is as follows:
1.a) If FixedLenFeature and has a default value, use that value for missing
entries.
1.b) If FixedLenFeature and doesn't have default value throw an Exception on
missing entries.
1. For FixedLenFeature:
1. If FixedLenFeature and has a default value, use that value for
missing entries.
2. If FixedLenFeature and doesn't have default value throw an Exception
on missing entries.
2) For VarLenFeature return an empty array.
2. For VarLenFeature return an empty array.
3) For SparseFeature throw an Exception if only one of the indices or values
3. For SparseFeature throw an Exception if only one of the indices or values
has a missing entry. If both indices and values are missing, return
a tuple of 2 empty arrays.
Expand Down

0 comments on commit c8ee7f1

Please sign in to comment.