A quick & simple technical exercise to be able to make real-time predictions against an AWS Machine Learning model using the AWS SDK for Java.
-
Create an Amazon AWS account, if you don't already have one
-
Create an Amazon Machine Learning (ML) Model
-
Create an IAM that has access to the ML Model created earlier
-
Create a file to store those credentials here:
~/.aws/credentials
[default] aws_access_key_id={YOUR_ACCESS_KEY_ID} aws_secret_access_key={YOUR_SECRET_ACCESS_KEY}
It takes time for a real-time prediction endpoint to become ready for use, so when you run the code for the first time, it will request a real-time endpoint and then possibly crash, as the endpoint may not be ready. So just run the code again after a short-period and it will work without crashing if the endpoint is ready.