From acc7c00588635765b96d6e1a74ff81b8b76ad45d Mon Sep 17 00:00:00 2001 From: Mark Daoust Date: Wed, 6 Sep 2017 12:14:53 -0700 Subject: [PATCH] Add csv dataset example to get_started/regression. PiperOrigin-RevId: 167754634 --- .../docs_src/programmers_guide/datasets.md | 6 + .../get_started/regression/dnn_regression.py | 18 +- .../get_started/regression/imports85.py | 170 ++++++++++++++---- .../regression/linear_regression.py | 21 +-- .../linear_regression_categorical.py | 21 +-- .../examples/get_started/regression/test.py | 66 ++++--- 6 files changed, 215 insertions(+), 87 deletions(-) diff --git a/tensorflow/docs_src/programmers_guide/datasets.md b/tensorflow/docs_src/programmers_guide/datasets.md index ba26bd5e941..aaebabfddf9 100644 --- a/tensorflow/docs_src/programmers_guide/datasets.md +++ b/tensorflow/docs_src/programmers_guide/datasets.md @@ -146,6 +146,9 @@ for i in range(100): assert i == value ``` +Note: Currently, one-shot iterators are the only type that is easily usable +with an `Estimator`. + An **initializable** iterator requires you to run an explicit `iterator.initializer` operation before using it. In exchange for this inconvenience, it enables you to *parameterize* the definition of the dataset, @@ -452,6 +455,9 @@ dataset = dataset.flat_map( .filter(lambda line: tf.not_equal(tf.substr(line, 0, 1), "#")))) ``` +For a full example of parsing a CSV file using datasets, see [`imports85.py`](https://www.tensorflow.org/code/tensorflow/examples/get_started/regression/imports85.py) +in @{$get_started/linear_regression}. +