In [1]:
import boto3
In [2]:
ml_model_id = 'ml-HzDofty2GmI'
end_point = 'https://realtime.machinelearning.us-east-1.amazonaws.com'
In [3]:
session = boto3.Session(
region_name = 'us-east-1',
profile_name = 'ml_user_predict')
In [4]:
ml = session.client('machinelearning')
In [5]:
iris_record = \
{"Row":"1",
"sepal_length":"5.4",
"sepal_width":"3.0",
"petal_length":"4.5",
"petal_width":"1.5"}
In [6]:
iris_record
Out[6]:
In [7]:
iris_prediction = ml.predict(MLModelId = ml_model_id,
Record = iris_record,
PredictEndpoint = end_point)
In [8]:
iris_prediction['Prediction']
Out[8]:
In [9]:
iris_prediction['Prediction']['predictedLabel']
Out[9]:
In [10]:
iris_prediction
Out[10]: