[Review] TensorFlow Linear Model Tutorial

This post follows the official tutorial of tensorflow.
https://www.tensorflow.org/tutorials/wide

## Introduction
In this tutorial, we will use the tf.estimator API in TensorFlow to solve a binary classification problem: Given census data about a person such as age, education, marital status, and occupation (the features), we will try to predict whether or not the person earns more than 50,000 dollars a year (the target label). We will train a logistic regression model, and given an individual's information our model will output a number between 0 and 1, which can be interpreted as the probability that the individual has an annual income of over 50,000 dollars.

## Data Description
The census data we will use in this tutorial containing many columns, in fact, some are continuous and others are categorical. Hence, we should define the two types of columns first.

1. A column is called categorical if its value can only be one of the categories in a finite set. For example, the relationship status of a person (wife, husband, unmarried, etc.) or the education level (high school, college, etc.) are categorical columns.
2. A column is called continuous if its value can be any numerical value in a continuous range. For example, the capital gain of a person (e.g. $14,084) is a continuous column.

Census DataSet
<img width="865" alt="Screen Shot 2018-05-17 at 12.12.15.png" src="https://qiita-image-store.s3.amazonaws.com/0/240801/7e7d6dba-04ac-bbef-e2bd-6ec0c51c18c2.png">

## Preprocessing Data
Building tf.estimator model requires data to fit in a Tensor format. So in this section let's take a look how to process the dataset.
Based on the definition of label and feature below, I would like to check the implementation this function.

- features: A dict from feature column names to Tensors or SparseTensors.
- labels: A Tensor containing the label column.

Each continuous column in the train or test data will be converted into a Tensor, which in general is a good format to represent dense data. For categorical data, we must represent the data as a SparseTensor. This data format is good for representing sparse data. Our input_fn uses the tf.data API, which makes it easy to apply transformations to our dataset:

Optional Material: tf.decode_csv: https://www.tensorflow.org/api_docs/python/tf/decode_csv
tf.Tensor: https://www.tensorflow.org/api_docs/python/tf/Tensor
tf.SparseTensor: https://www.tensorflow.org/api_docs/python/tf/SparseTensor

```python
def input_fn(data_file, num_epochs, shuffle, batch_size):
  """Generate an input function for the Estimator."""
  assert tf.gfile.Exists(data_file), (
      '%s not found. Please make sure you have either run data_download.py or '
      'set both arguments --train_data and --test_data.' % data_file)

  def parse_csv(value):
    print('Parsing', data_file)
    columns = tf.decode_csv(value, record_defaults=_CSV_COLUMN_DEFAULTS)
    features = dict(zip(_CSV_COLUMNS, columns))
    labels = features.pop('income_bracket')
    return features, tf.equal(labels, '>50K')

  # Extract lines from input files using the Dataset API.
  dataset = tf.data.TextLineDataset(data_file)

  if shuffle:
    dataset = dataset.shuffle(buffer_size=_SHUFFLE_BUFFER)

  dataset = dataset.map(parse_csv, num_parallel_calls=5)

  # We call repeat after shuffling, rather than before, to prevent separate
  # epochs from blending together.
  dataset = dataset.repeat(num_epochs)
  dataset = dataset.batch(batch_size)

  iterator = dataset.make_one_shot_iterator()
  features, labels = iterator.get_next()
  return features, labels
```

## Feature Engineering