Skip to content

Instantly share code, notes, and snippets.

@metal3d
Created June 7, 2018 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save metal3d/b5a250836c25633c9ba49fea171b7fe6 to your computer and use it in GitHub Desktop.
Save metal3d/b5a250836c25633c9ba49fea171b7fe6 to your computer and use it in GitHub Desktop.
Sagmaker prediction
from sagemaker.predictor import RealTimePredictor
from sagemaker.predictor import json_serializer
# get the name in SageMaker interface and put it there
endpoint = 'name of your endpoint'
# you can use other serializer, or none if you are able
# to get data in binary format
predictor = RealTimePredictor(endpoint, serializer=json_serializer)
# and call prediction as previously
res = predict(some_data)
print(res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment