TensorFlow Transform tft.coders
Module¶
tensorflow_transform.coders
¶
Module level imports for tensorflow_transform.coders.
Classes¶
CsvCoder
¶
CsvCoder(
column_names,
schema,
delimiter=",",
secondary_delimiter=None,
multivalent_columns=None,
)
A coder to encode CSV formatted data.
Initializes CsvCoder.
PARAMETER | DESCRIPTION |
---|---|
column_names
|
Tuple of strings. Order must match the order in the file.
|
schema
|
A
|
delimiter
|
A one-character string used to separate fields.
DEFAULT:
|
secondary_delimiter
|
A one-character string used to separate values within the same field.
DEFAULT:
|
multivalent_columns
|
A list of names for multivalent columns that need to be split based on secondary delimiter.
DEFAULT:
|
RAISES | DESCRIPTION |
---|---|
ValueError
|
If |
Source code in tensorflow_transform/coders/csv_coder.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
|
Functions¶
encode
¶
Encode a tf.transform encoded dict to a csv-formatted string.
PARAMETER | DESCRIPTION |
---|---|
instance
|
A python dictionary where the keys are the column names and the values are fixed len or var len encoded features.
|
RETURNS | DESCRIPTION |
---|---|
A csv-formatted string. The order of the columns is given by column_names. |
Source code in tensorflow_transform/coders/csv_coder.py
ExampleProtoCoder
¶
A coder between maybe-serialized TF Examples and tf.Transform datasets.
Build an ExampleProtoCoder.
PARAMETER | DESCRIPTION |
---|---|
schema
|
A
|
serialized
|
Whether to encode serialized Example protos (as opposed to in-memory Example protos).
DEFAULT:
|
RAISES | DESCRIPTION |
---|---|
ValueError
|
If |
Source code in tensorflow_transform/coders/example_proto_coder.py
Functions¶
encode
¶
Encode a tf.transform encoded dict as tf.Example.