[su_note note_color=”#d3d3d3″]Note: This is the third post about using Amazon Machine Learning to predict workout intensity. Check out Part 1 (Overview) and Part 2 (Building the Machine Learning Model) for background. A working model is available via web and Alexa. Code can be found/downloaded from my Hackster site.[/su_note]
After I was able to build a working model, I needed to come up a way to automate the model. I originally planned to allow access through my website, but decided to use Alexa in addition to the website link.
Note: The process of creating an Alexa skill isn’t too complicated (if you have experience building lambda functions). That being said, I suggest you start by building a sample skill – such as the Fact Skill example. Also, be sure to read and follow the certification requirements.
Alexa, AWS, and the exposed Fitbit APIs provided a mechanism to build a model and return results for a specific user – all initiated by voice.
Step 1 – Linking the user’s Fitbit account to the skill
A user has to link his/her Fitbit account to the skill before s/he can (a) build a specific machine learning model based on their history and (b) get a workout recommendation. Step 1 covers the logic for this functionality.
Click image to enlarge

![texting-in-the-gym-300x300[1]](http://s3.amazonaws.com/darianbjohnson/wp-content/uploads/2016/06/texting-in-the-gym-300x3001.jpg)
The flow is as follows:

S topic receives the mobile number as a message
![765a3f73cd8c5b0c0bc96bc3cd094740[1]](http://s3.amazonaws.com/darianbjohnson/wp-content/uploads/2016/02/765a3f73cd8c5b0c0bc96bc3cd0947401-250x167.jpg)
The next day, I went back to the Fitbit website to sign-up for SMS notifications; unfortunately, Fitbit doesn’t provide a low battery notification via SMS.