Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save securetorobert/90dc5aa20b4e150632d1d3d0d26666e1 to your computer and use it in GitHub Desktop.
Save securetorobert/90dc5aa20b4e150632d1d3d0d26666e1 to your computer and use it in GitHub Desktop.
Predictions using DNNClassifier on iris dataset
# Predict the type of some Iris flowers.
# Let's predict the examples in FILE_TEST, repeat only once.
predict_results = classifier.predict(
input_fn=lambda: my_input_fn(FILE_TEST, False, 1))
print("Predictions on test file")
for prediction in predict_results:
# Will print the predicted class, i.e: 0, 1, or 2 if the prediction
# is Iris Sentosa, Vericolor, Virginica, respectively.
print prediction["class_ids"][0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment