TensoFlow API

tf.estimator API

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import tensorflow as tf

# set up a linear classifier
classifier = tf.estimator.LinearClassifier()

# train the model on some example data
classfier.train(input=train_input_fn, steps=2000)

# use it to predict
predictions = classifier.predict(input_fn = predict_input_fn)