Created
October 3, 2018 14:42
-
-
Save mikeapted/67a8cbb77eda0d9b55a589bba1ffc5b3 to your computer and use it in GitHub Desktop.
Revisions
-
mikeapted renamed this gist
Oct 3, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
mikeapted created this gist
Oct 3, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ import boto3 import json def lambda_handler(event, context): payload = '1,13000 \n 1,20000 \n 2,3500 \n 2,5000 \n 3,3000 \n 3,3300 \n 4,2 \n 4,10' endpoint_name = 'YourInitials-kmeans-anomalydetection' runtime = boto3.client('runtime.sagemaker') response = runtime.invoke_endpoint(EndpointName=endpoint_name, ContentType='text/csv', Body=payload) result = json.loads(response['Body'].read().decode()) for p in result['predictions']: print (p) return 'Complete'