aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/docs_src/tutorials/wide.md
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/docs_src/tutorials/wide.md')
-rw-r--r--tensorflow/docs_src/tutorials/wide.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/tensorflow/docs_src/tutorials/wide.md b/tensorflow/docs_src/tutorials/wide.md
index 079efb201e..471811ea1a 100644
--- a/tensorflow/docs_src/tutorials/wide.md
+++ b/tensorflow/docs_src/tutorials/wide.md
@@ -188,7 +188,7 @@ def input_fn(df):
categorical_cols = {k: tf.SparseTensor(
indices=[[i, 0] for i in range(df[k].size)],
values=df[k].values,
- shape=[df[k].size, 1])
+ dense_shape=[df[k].size, 1])
for k in CATEGORICAL_COLUMNS}
# Merges the two dictionaries into one.
feature_cols = dict(continuous_cols.items() + categorical_cols.items())
@@ -261,6 +261,8 @@ learned through the model training process we'll go through later.
We'll do the similar trick to define the other categorical features:
```python
+race = tf.contrib.layers.sparse_column_with_hash_bucket("race", hash_bucket_size=100)
+marital_status = tf.contrib.layers.sparse_column_with_hash_bucket("marital_status", hash_bucket_size=100)
relationship = tf.contrib.layers.sparse_column_with_hash_bucket("relationship", hash_bucket_size=100)
workclass = tf.contrib.layers.sparse_column_with_hash_bucket("workclass", hash_bucket_size=100)
occupation = tf.contrib.layers.sparse_column_with_hash_bucket("occupation", hash_bucket_size=1000)
@@ -377,7 +379,7 @@ the labels of the holdout data:
```python
results = m.evaluate(input_fn=eval_input_fn, steps=1)
for key in sorted(results):
- print "%s: %s" % (key, results[key])
+ print("%s: %s" % (key, results[key]))
```
The first line of the output should be something like `accuracy: 0.83557522`,