Amazon Machine Learning

This graph template allows you to call an Amazon Web Services Machine Learning  real-time machine learning endpoint to get a prediction or a score from a model. 

The graph uses the HTTPS web service end point identified in the AWS machine learning console. It requires an AWS Access Key and Secret Access key. It is recommended that these are held in your application parameters rather than within the graph or project itself. Use the Kitewheel Refresh Application Parameters graph to assist with this process. 

Package contents

  • Graph: awsMachineLearning
  • Public Variables: 
    • None

Using

There are two structures that need to be passed to the graph - the AWS API information including the access key and then the information to be passed to the web service endpoint itself. 

Amazon Options

{
	"accessKeyId": "****",
	"secretAccessKey": "***",
	"region": "eu-west-1",
	"service": "machinelearning",
	"host": "realtime.machinelearning.eu-west-1.amazonaws.com",
	"x-amz-target": "AmazonML_20141212.Predict",
	"path": "/",
	"endpoint": "https://realtime.machinelearning.eu-west-1.amazonaws.com",
	"method": "POST"
}

These values are as follows:

  • accessKeyId - the AWS Access Key - not shown above 
  • secretAccessKey - the AWS Secret Access key - not shown above
  • region - the AWS region name - AWS ML is not available in all regions but is available in "eu-west-1" - Dublin and "us-east-1" - North Virginia
  • service - always "machinelearning" 
  • host - the realtime scoring endpoint for your region - see the AWS Machine Learning Console 
  • x-amz-target - not very well documented - but always set to "AmazonML_20141212.Predict"
  • path - always "/"
  • endpoint - from the AWS Machine Learning Console 
  • method - always "POST" 


Machine Learning Request 

The machine learning request has the following format: 

{
	"MLModelId": "ml-****",
	"Record": {
		"age": "23"
	    ...
	},
	"PredictEndpoint": "https://realtime.machinelearning.eu-west-1.amazonaws.com"
}

The values are as follows: 

  • MLModelId - the unique identifier for the AWS Machine Learning Model from the AWS Machine Learning Console
  • PredictEndpoint - from the AWS Machine Learning Console - same as the "endpoint" field in the Amazon Options
  • Record - this is an object that provides all of the input criteria to the model for scoring - all values passed as strings


Add the Managed Graph 


Add the managed graph to your project: 

If you don't have one already create a Web Service Connection that specifies your Realtime Endpoint from the AWS Machine Learning Console as the Endpoint


The graph can then be used in your flow. Depending on the model type it may return different responses. In the example below this is a binary prediction model. 



The returned object is: 

{
	"Prediction": {
		"predictedLabel": "0",
		"predictedScores": {
			"0": 0.42783865332603455
		},
		"details": {
			"PredictiveModelType": "BINARY",
			"Algorithm": "SGD"
		}
	}
}


Privacy Policy
© 2022 CSG International, Inc.