Getting everything ready for you…

Loading courses, problems and your progress. This takes just a moment.

0s

Projects › Intermediate

Movie Recommendation System

Recommend movies similar to one you like using content-based filtering, served in a Streamlit web app.

Level: Intermediate · Time: 1 week · Tech stack: Python, pandas, scikit-learn, Streamlit

Features to build

What you will learn

Step-by-step guide

1. Data

Use the TMDB 5000 or MovieLens dataset from Kaggle. Load with pandas, drop rows without overviews, merge credits.

2. Build a "tags" column

Combine overview + genres + top 3 cast + director into one lowercase string per movie. Remove spaces inside names ("Tom Hanks" → "tomhanks") so they stay one token.

3. Vectorise and compare

from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
vec = TfidfVectorizer(max_features=5000, stop_words='english')
X = vec.fit_transform(movies['tags'])
sim = cosine_similarity(X)

def recommend(title, k=10):
    i = movies.index[movies.title == title][0]
    best = sim[i].argsort()[::-1][1:k + 1]
    return movies.title.iloc[best].tolist()

4. Check quality

Try 10 movies you know. Do the results make sense? Tune which features you include.

5. App

Streamlit: a selectbox with titles, a button, and posters in st.columns(5). Save sim with pickle so the app loads instantly.

6. Deploy

Streamlit Community Cloud or Hugging Face Spaces (free). Keep the TMDB key in secrets.

Level it up

On your resume

Learn on Codify