Interview question: What is collaborative filtering in recommendation systems in Python

Crystal X
3 min readJan 18, 2023

Individuals seeking to pursue a career in data science will no doubt encounter technical questions when attending interviews. One such question that could be asked is about collaborative filtering.

Collaborative filtering is a method used in recommendation systems to make predictions about a user’s interests by using the interests of other users. There are two main types of collaborative filtering: user-based and item-based.

In user-based collaborative filtering, the system looks at the past behaviour of similar users and makes recommendations based on that.

In item-based collaborative filtering, the system looks at the past behaviour of the user with respect to items and makes recommendations based on that.

Below is a simple recommendation system based on Python’s bandas library.

The first thing to do is to import the library that will be used in this program, which is pandas in this instance.

Pandas is an open-source data manipulation and analysis library. It provides easy-to-use data structures and data analysis tools for handling and manipulating numerical tables and time series data. Pandas allows for data cleaning, transformation, and analysis. It also creates…

--

--

Crystal X
Crystal X

Written by Crystal X

I have over five decades experience in the world of work, being in fast food, the military, business, non-profits, and the healthcare sector.

No responses yet