Amazon Prime Video Recommendations

Ranking = Recommendation presented as a list.

In my article How do Recommendation Systems work? we learned different approaches to building recommendation systems. In this post, we’ll learn about stacking different models together to build an Ensemble Ranking Model.

What’s an Ensemble?

It’s a technique of combining multiple models in an intelligent way. We use this technique to improve model performance and/or reduce the chances of selecting a poor one.

Let’s say that you want to watch some movies over the weekend. You select a list of 10 movies and ask your friends to rank them. Your friends have their…

You want to learn about “Machine Learning”. You make a Google search. There are 10–15 results linking to the various sources of information. You open the links one by one. You take a one-shot look at them before deciding which ones among the lot you would invest time in reading. This way, you would get to know of some credible sources for reading about ML, which you will use the next time. We call the act of going through the links one by one, Exploration. We call the act of using the sources next time when you want to read…

Image source:

The hatred towards Neymar is insane! We read all over the internet how much of a selfish player he is! People’s opinions are formed from the subjective treatment that Neymar receives from the media. But, what does the data say?

Who is a selfish player, really? For the sake of the argument, let’s say that a selfish player is one who doesn’t think about the team & plays for himself. Good, now that we have got the definition out of the way, let’s focus on Neymar’s career from 2013-present in this article.

Neymar joined Barcelona in 2013 as a Brazilian…

It’s just like how any of us learns.

There are 3 ways in which a machine learns:

  1. Show the machine some examples and it will learn to generalize based on the properties. For example, if you need to teach the machine to differentiate between cats and dogs, you gather a collection of images of dogs and cats and then show it to the machine. Internally, the features like size, shape, color, etc. are extracted from the images and used to learn the differentiation. This is also called Supervised learning.
  2. Give it some examples without labels and ask it to group…

No, we won’t use this one ;)

Let’s say that we have a text file student_records.txt . Each line contains a student name and age. We want to parse student names and their ages.


Our first approach would be to read the files and store the values in a list/dictionary.

def read_student_records(path):
records = []
with open(path) as file:
for line in file:
name, age = line.split(":")
records.append((name, age))
return records
for record in read_student_records(path):
print(record) # do something with record

This gets the job done. However, the function read_student_records() is messy. What if we have to read from multiple files?


If I ask you to tell me one application of Machine Learning that you use everyday, what comes to your mind? No points for guessing! Recommendation engines are common in many products that you use daily, so much so that you do not even consciously think about it. Be it YouTube’s next video suggestion to Amazon showing you “People who bought this also bought..” to Medium suggesting you which articles to read next to Netflix recommending which movie you should watch next. It’s everywhere! Let’s understand approaches to building recommendation systems.

Let’s take the example of Netflix recommendation system. The…

Have a look at the problem statement first,

Today, I solved a very interesting problem on SPOJ. In the initial stages I used Brute Force; judging from the complexity of the algorithm I knew it wouldn’t pass. I searched for some hints on Google. And after that I came up with a very elegant solution.

Anyway, here’s the straightforward problem description: You are given a 2 dimensional array of 0's and 1's. All you have to do is find the distance of each 0 from it’s nearest 1 and write it in its position. …

Saikat Kumar Dey

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store