Skip to content

Instantly share code, notes, and snippets.

@hadifar
Created November 12, 2018 21:00
Show Gist options
  • Save hadifar/c00ee69657b2cb406a32fdfb7bf5b7e9 to your computer and use it in GitHub Desktop.
Save hadifar/c00ee69657b2cb406a32fdfb7bf5b7e9 to your computer and use it in GitHub Desktop.
# convert string labels into numeric value
csv_dataset = csv_dataset.map(lambda x, y: (x, tf.cond(tf.equal(y, 'positive'), lambda: 1, lambda: 0)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment