tft.coders.CsvCoder

A coder to encode CSV formatted data.

column_names Tuple of strings. Order must match the order in the file.
schema A Schema proto.
delimiter A one-character string used to separate fields.
secondary_delimiter A one-character string used to separate values within the same field.
multivalent_columns A list of names for multivalent columns that need to be split based on secondary delimiter.

ValueError If schema is invalid.

Methods

encode

View source

Encode a tf.transform encoded dict to a csv-formatted string.

Args
instance A python dictionary where the keys are the column names and the values are fixed len or var len encoded features.

Returns
A csv-formatted string. The order of the columns is given by column_names.