In this matrix, each row represents one user and each column represents an item. Items in our example are musical instruments, but depending on the platform they can be anything. If a user has rated an instrument, we have a checkmark (usually along with some value that represents rating) in that cell. So, based on this, how do we create a recommendation for certain users? We could consider some features of the instruments that the user has already ranked or purchased and then recommend similar items. Alternately, we could consider to find similar users based on those rankings and suggest items that those users purchased. But what does it mean that two items are similar? What does it mean that two users are similar? How to calculate that and present that similarity in some mathematical terms?

Different types of recommendation systems take different approaches to these questions. In general, there are four types of recommendation systems:

Content-Based Recommendation Systems

Collaborative Filtering Recommendation Systems

Knowledge-Based Recommendation Systems

Hybrid Solutions Recommendation Systems

From these three types, the first two are used most often and the most popular. In practice, it can happen that we build hybrid solutions to get better results. All of these approaches calculate some type of similarity, whether it is a similarity between items, or it is a similarity between users. So, before we dive into the details of each type of recommended system, let’s take a moment and explain how similarity is measured using cosine similarity.