parameters: (df)
return_statement: return feature_cols, label
docstring: Input builder function.
docstring_summary: Input builder function.
docstring_tokens: Input builder function .
function: def input_fn(df):
    """Input builder function."""
    # Creates a dictionary mapping from each continuous feature column name (k) to
    # the values of that column stored in a constant Tensor.
    continuous_cols = {k: tf.constant(df[k].values) for k in CONTINUOUS_COLUMNS}
    # Creates a dictionary mapping from each categorical feature column name (k)
    # to the values of that column stored in a tf.SparseTensor.
    categorical_cols = {k: tf.SparseTensor(
        indices=[[i, 0] for i in range(df[k].size)],
        values=df[k].values,
        shape=[df[k].size, 1])
                        for k in CATEGORICAL_COLUMNS}
    # Merges the two dictionaries into one.
    feature_cols = dict(continuous_cols)
    feature_cols.update(categorical_cols)
    # Converts the label column into a constant Tensor.
    label = tf.constant(df[LABEL_COLUMN].values)
    # Returns the feature columns and the label.
    return feature_cols, label
function_tokens: def input_fn ( df ) : # Creates a dictionary mapping from each continuous feature column name (k) to # the values of that column stored in a constant Tensor. continuous_cols = { k : tf . constant ( df [ k ] . values ) for k in CONTINUOUS_COLUMNS } # Creates a dictionary mapping from each categorical feature column name (k) # to the values of that column stored in a tf.SparseTensor. categorical_cols = { k : tf . SparseTensor ( indices = [ [ i , 0 ] for i in range ( df [ k ] . size ) ] , values = df [ k ] . values , shape = [ df [ k ] . size , 1 ] ) for k in CATEGORICAL_COLUMNS } # Merges the two dictionaries into one. feature_cols = dict ( continuous_cols ) feature_cols . update ( categorical_cols ) # Converts the label column into a constant Tensor. label = tf . constant ( df [ LABEL_COLUMN ] . values ) # Returns the feature columns and the label. return feature_cols , label