The Task
Test a heavy machine learning algorithm on the Raspberry Pi 2 Model B. For this purpose, I applied the Latent Dirichlet Allocation algorithm on a dataset of recent tweets around the Bitcoin crypto-currency and the situation in Eastern Europe and the Middle East.
Since the algorithm requires time to complete, I used a LED light which flashes in order to indicate that the results are available.
Algorithmic Details
LDA constitutes a "topic modeling" method, which means detecting "abstract" topics from a collection of text documents. In this case we treat each tweet as a single document. All tweets are in English and no pre-processing took place. Roughly speaking, we treat LDA as a statistical method, which takes documents as input and produces a list of topics. Each topic is represented by a bunch of words of high probability. This means that those words are the best candidates for describing that topic.
Using Resin.io
By signing up to resin.io and following the instructions on the "getting started guide" you can setup the Raspberry in order to easily push your code and run it on the device.
The whole process of developing a Node.js application for this project with Resin.io is smooth and easy since resin.io does all the hard work for you.
How to
- Create account at resin.io
-
Create a new application selecting the Raspberry Pi 2 as a device.
-
Download the OS image file
-
Burn OS image to your SD card
-
Put your SD card to your RPi and connect the LED as shown in the circuit diagram below
-
Clone the project repository from Github
-
Add your resin remote upstream to your repository
-
Connect your RPi and wait for the device to appear on your resin dashboard
-
Git push to your resin upstream
-
Ready. Check the logs to see what's happening
You can also read more on resin.io’s blog.
Comments