Code-On

Manasvi Patidar
MDG Space
Published in
5 min readFeb 19, 2020

Flutter, flawless and enchanting…. Machine Learning, it’s gonna be everywhere…. Javascript, there is nothing it can’t do…. Competitive Coding, it can teach you a lot(like really a huge lot)….these are the observations that I made during the last winter vacation. Not that these are unstated facts or something of the sort but these are the realizations that I had while making an amazing app to solve a problem that I and many of my mates faced. I would love to jump straight to them but first, you need some context.

The Journey

Competitive Coding can be a bit infuriating at times, imagine yourself in the shoes of a beginner(i.e me 😧) you would either get bored by those easy problems if you sort them by descending number of solves or get discouraged by jumping straight into the difficult sections. Finding the right problem-set was always a hassle for me. I had to find a solution to this. At the same time, I found out that Season of Code for MDG is up. It was like hitting two birds with the same stone. I drafted up a proposal real quick and started doing some research work about what I would need to learn in order to make an App that could solve our problem. After, a few minor tweaks to the proposal I sent it to MDG, the proposal got selected and then came the real work, making of the app. The idea was to make an application that generated problem recommendations based on the solved problems of the current user. I would have a backend to generate and store the recommendations and a frontend to display them in a user-friendly manner.

The first observation I made was that ‘Flutter is flawless’, why would anyone use anything else? It is a cross-platform software development kit that gives a native-like performance with limitless possibilities of a great UI. I saw a few introductory videos about flutter and went straight to VSCode to test out some example apps. I learnt a lot more about Flutter as the work continued. I had to implement a User Authentication system to my app along with a database to store the recommendations.

This is where I found out about firebase, along with fulfilling these two requirements it also comes with cloud functions that can act as an API for our app and generate recommendations upon user’s request. Next was how to generate the recommendations? Collaborative Filtering was the answer to this one. This is where Machine Learning came in, well this was not any high tech, game-changing revolutionary kind of thing but still pretty interesting that how a few hundred lines of code can understand a person's preferences and generate similar results that would satisfy him/her. For the curious ones out there Collaborative filtering is a technique that can filter out items that a user might like on the basis of reactions by similar users or items. There are 2 major types of Collaborative Filtering in use:-

User-Based CF

Users similar to the target users are found and the selections corresponding to these ‘similar’ users are recommended to our target user. The similarity between two users is computed from the number of items they have in common in the dataset by cosine similarity. This algorithm is very efficient when the number of users is way smaller than the number of items. The major drawback is that adding a new user is expensive since it requires to update all similarities between users.

Item-Based CF

The item-based algorithm uses the same approach but reverses the view between users and items. It recommends items that are similar to the ones previously liked by the target user. As before the similarity between two items is computed using the number of users they have in common in the dataset by cosine similarity. This algorithm is best when the number of items is way smaller than the number of users.

After writing the code for this I had the later two realizations, Javascript (language used for Firebase Cloud Functions to implement these algorithms) can be used for almost anything that you could dream of. It has sufficient support, documentation and the community that even if you feel that you are doing something new with this language there would be something on the internet that could guide you on the right path. And Machine Learning, it can truly be incorporated in any tech out there and the results would be amazing. After all this, the app looked almost finished. It was giving out recommendations and all it needed was some final touch-ups. I added a screen for solved problems and a screen to select the type of filtering to perform and voila the app was finished. The final result looked something like this:-

The Guide(SOC)

None of this would have been possible without MDG and my mentor Ritik, who guided me along the entire period. This project was done under the banner of MDG Season of Code. This is an event organized every year by MDG to promote students of IIT R to get into development and it also acts as a method of selection for students to be a part of the MDG team. It’s almost 2 months long, with a coding phase of 1 month(December) and rest of the time split up for planning and release. During the entire time, we were constantly in touch with our mentor. We were given some deadlines and always kept motivated to finish the project. The entire event was designed to be fun and educational at the same time.

To sum all of it up, this winter was a huge success for me. I learnt a lot from this project and more importantly, I learnt that the most efficient way to understand any new tech is dive right into it, keep learning new thing along the way, keep reading blogs, medium stories and follow some of the pros in that field on twitter or any such networking site that they use. Never back down, never give up!

--

--