MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / parse_csv

Function parse_csv

modelzoo/bst/train.py:372–383  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

370# generate dataset pipline
371def build_model_input(filename, batch_size, num_epochs):
372 def parse_csv(value):
373 tf.logging.info('Parsing {}'.format(filename))
374 string_defaults = [[' '] for i in range(1, 19)]
375 label_defaults = [[0], [0]]
376 column_headers = INPUT_COLUMN
377 record_defaults = label_defaults + string_defaults
378 columns = tf.io.decode_csv(value, record_defaults=record_defaults)
379 all_columns = collections.OrderedDict(zip(column_headers, columns))
380 labels = all_columns.pop(LABEL_COLUMN[0])
381 all_columns.pop(BUY_COLUMN[0])
382 features = all_columns
383 return features, labels
384
385 def parse_parquet(value):
386 tf.logging.info('Parsing {}'.format(filename))

Callers

nothing calls this directly

Calls 4

infoMethod · 0.80
rangeFunction · 0.50
formatMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected