tf.estimator.inputs.pandas_input_fn
tf.estimator.inputs.pandas_input_fn
tf.estimator.inputs.pandas_input_fn
pandas_input_fn( x, y=None, batch_size=128, num_epochs=1, shuffle=None, queue_capacity=1000, num_threads=1, target_column='target' )
Defined in tensorflow/python/estimator/inputs/pandas_io.py
.
Returns input function that would feed Pandas DataFrame into the model.
Note:y
's index must matchx
's index.
Args:
-
x
: pandasDataFrame
object. -
y
: pandasSeries
object.None
if absent. -
batch_size
: int, size of batches to return. -
num_epochs
: int, number of epochs to iterate over data. If notNone
, read attempts that would exceed this value will raiseOutOfRangeError
. -
shuffle
: bool, whether to read the records in random order. -
queue_capacity
: int, size of the read queue. IfNone
, it will be set roughly to the size ofx
. -
num_threads
: Integer, number of threads used for reading and enqueueing. In order to have predicted and repeatable order of reading and enqueueing, such as in prediction and evaluation mode,num_threads
should be 1. -
target_column
: str, name to give the target columny
.
Returns:
Function, that has signature of ()->(dict of features
, target
)
Raises:
-
ValueError
: ifx
already contains a column with the same name asy
, or if the indexes ofx
andy
don't match. -
TypeError
:shuffle
is not bool.
© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/estimator/inputs/pandas_input_fn