Skip to content

Instantly share code, notes, and snippets.

@securetorobert
Created September 15, 2018 13:49
Show Gist options
  • Save securetorobert/37ab1bb443b8aa982b3416adb0b3d3e4 to your computer and use it in GitHub Desktop.
Save securetorobert/37ab1bb443b8aa982b3416adb0b3d3e4 to your computer and use it in GitHub Desktop.
Make an input function from a Pandas DataFrame
def make_input_fn(df, num_epochs):
return tf.estimator.inputs.pandas_input_fn(
x = df,
y = df['sentiment'],
batch_size = 128,
num_epochs = num_epochs,
shuffle = True,
queue_capacity = 1000,
num_threads = 1
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment