Create a live custom machine learning endpoint with AWS API Gateway, AWS Lambda, and AWS Machine Learning.
Keep default for values not specified below
- Create new AWS S3 bucket
- Upload black-friday/BlackFriday.csv to S3 bucket
- Create new Data source + model in AWS Machine Learning
- Point data source location to uploaded bucket + file
- Does the first line in your CSV contain the column names? -> Yes
- Select Target as Purchase column
- Identifier as User_ID
- Keep defaults and create model
- Create new function
- Create custom role
- Navigate to the IAM services and select roles
- Attach policies to created role
- AmazonMachineLearningFullAccess
- Go back to lambda function
- Add API Gateway as a trigger
- Create new API with Open security
- Copy and paste index.js from github repo into lambda function
- Edit MLModelID parameter to match created machine learning model
- Verify Model has "Completed" status
- Select Create Endpoint under Enable real-time predictions
- Try real-time predictions to get some example outputs
- Test Lambda function
- Navigate to API in API Gateway service
- Create POST method on the existing resource
- Have it execute your lambda function
- Enable CORS for API
- Copy from Stages->Default->Invoke URL into api-test.py
- Test it out!