Heat Map integration for Cafes — 8 Hours of Development in Hackathon

This article is about the experience we had in the hackathon conducted by Jhonson & Jhonson company at Limerick, Ireland. It was a wonderful experience participating in the hackathon. There were two different aspects covered in the hackathon 1. Team building activities and 2. Coding ability. In between the main coding task, there were team build activities conducted, this basically was introduced to handle the ties if any in the coding. These activities were fun and bring all the team together for a very short time and see others :) One activity that I liked was the building a structure out of marshmallows and a spaghetti. I do have the pic of our team’s structures, building it for 48cm tall.

Coming to the coding task, we were asked to use the Open Data Ireland datasets and come up with the ideas and build something interesting. There were around 20 teams participated in the competition. We happened to emerge as the second place.
Browsing through the datasets, we finally decided with this one. This is basically an API that provides the noise levels in decibels given the location attributes and the start and end time. This provides a list of all the readings of noise recorded every five minutes.
Plan
The plan was to get the location of the cafes and fetch the noise levels for the past two years, train a machine learning model about the noise levels. Then given a date and time, we will display a map that shows the options to choose the cafes based on the noise level. Mapbox was used to render the maps, which also provides another wonderful feature of heat maps. From this, we were able to display the noisiest cafes at a given time with dense orangish color as below.

Execution
Backend chosen was Flask and Sklearn for machine learning integration. Architecture goes like below image:

Frontend makes an API call with location and time, flask application in turns loads the trained model and make the prediction and returns the noise levels to be displayed on to the map. API involves parsing the location and time and then generate .geojson file and return it in the API. This was a challenging part of the competition. Though we were not able to make it a dynamic, it was completed after the competition.
Another part of the architecture is to run the machine learning script periodically to fetch the dataset from the API and retrain the model and saved it back again so that the flask app stays always up to date.
Demo
It was a wonderful experience by looking at various other ideas from other teams. Many teams did perform well but also failed a bit on delivering the product that was designed. Our presentation went well, with a little performance of real usage of this product we designed. Acting as a freelancer working in a cafe getting a little annoyed with the noise environment and finding the solution from our app, to book/choose less noisy cafe to work. It displayed out of box thinking on our part, which we are really proud of. The integration of machine learning solutions gave us an edge in putting others behind us in the race. Presentation of the winning team was very good and the idea was good as well presenting it as a game was again an added value for them.
Reward
We were rewarded with 300 Euros. It was a very good experience and motivated up to participate in more Hackathons. Opens up a lot of new things and putting ourselves into action without any support and coming up with a new idea is a very good experience. Picture of the participants.

The code for the project can be found here. It's a flask application with a machine learning script inside it. The home page displays the Mapbox integration. Teammates can reach out here Osho Giri, Sushant Pophli and myself.