Machine learning (ML) is the branch of computer science in which computers discover patterns and predict trends in data on their own without being explicitly programmed.ML is a powerful tool for creating personalized and dynamic experiences. Although it is already driving everything from Netflix recommendations to autonomous cars, its use with IoT related products is still pretty limited. Moreover, a plethora of tools, use cases, blogs and courses are centered around using ML to work with images, sounds, and big data.These can easily make an IoT developer feel that their low data-rate IoT devices cannot be used with ML. :(To help developers with their quest to use ML with IoT devices, Bolt IoT has recently launched a new feature on their Cloud. This feature allows you to predict the trend in data using Polynomial Regression. You can learn More about the feature and Polynomial Regression here.This project will guide you through the steps required to get your first ML project up and running.
Hardware setup:Step 1: Insert one lead of the LDR into the Bolt Module's 3v3 Pin.
Step2: Insert other lead of the LDR into the A0 pin
Step 3: Insert one leg of the 10k Ohm resistor into the GND pin
Step 4: Insert the other leg of the resistor also into the A0 pin
Step 5: Power up the Bolt Module using a micro usb cable
Software setup:Step 1: If you have not already done so, sign up to the Bolt Cloud
Step 2: Link your Bolt Device to the Bolt Cloud using the Bolt App (for IOS and Android). The app is very intuitive, so I will not be including the sub steps here.
Step 3: Create a product on the Bolt Cloud of type GPIO Input.
Step 4: Configure the hardware to monitor the A0 pin, and give some variable name for it (Such as light_data)
Step 5: In the code configuration, write the data visualisation code attached with this project. Remember to rename the Y axis (In my case it is light_data).
Step 6: Save and Exit the product configuration.
Step 7: Link the Bolt Module to the newly created product.
Using the Polynomial Regression VisualiserAfter adding the tool to the device view, the Visualiser add a ‘predict now’ button into the view, along with a few editable data fields. The editable fields are explained below
- Prediction points: This number tells the Visualiser how many future data points need to be predicted. By default, the Visualiser spaces the points with the data collection time in the hardware configuration of the product. So if you set the product to collect data every 5 minutes, and select 6 prediction points, the Visualiser will predict the trend and show 6 points up to 30 minutes into the future.
- No. Polynomial coefficients: Polynomial Visualiser processes the given input time-dependent data, and outputs the coefficients of the function of the form shown below, which most closely resembles the trend in the input data. This number tells the Visualiser how many elements should be present in the function i.e. the value of n.
- Frame Size: These are the number of previous data points the Visualiser will use to predict the trend of the data. For example, if you set this value to 5, the Visualiser will use the previous 5 points to predict the trend.
When you click the 'Predict' button, the prediction history (Red line) and the next predicted trend (Yellow line) are added to the graph.The prediction history is a graph of points the Visualiser would have predicted, at the time with the data before that point in time, using the current settings.
You can not use the Bolt Cloud ML feature to predict how your data may change over time. Currently the visualiser will only help you tweak your polynomial regression parameters, but that is still a pretty handy tool.
Full Disclosure: I am an Embedded systems developer of the Bolt IoT Platform, and I was involved in the development of this feature. So I will praise it quite frequently during this blog, not only because I have to sell it but also because I sincerely believe that one of the best IoT platform ever. I have used many other IoT Platforms in the past and Bolt makes IoT development seamless like none other.Do understand that new features on the Bolt Cloud are prioritised by customer response, as such any suggestion/comment regarding this feature or any other Bolt IoT platform feature will be greatly appreciated.
Comments
Please log in or sign up to comment.