07 · RECOMMENDATION · ML
Movie Recommendation System
Repository codename · Content-Based Recommender
A content-based recommender built over roughly five thousand TMDB titles, precomputed so that a recommendation is a lookup rather than a calculation — and deployed publicly on Streamlit Community Cloud.
01 — THE PROBLEM
Collaborative filtering is the usual answer to recommendation, and it is useless on day one — with no interaction history there is nothing to collaborate on. A content-based approach sidesteps that cold start entirely by recommending from what a film is rather than from who else happened to watch it.
The work then shifts into a data problem: building a representation of a film rich enough that similarity between two vectors actually means something.
02 — ARCHITECTURE
tmdb_5000_movies.csv ┐
├─ merge on movie_id → genres + cast + crew
tmdb_5000_credits.csv ┘ + overview + keywords
↓
feature vectors
↓
cosine similarity matrix
↓
similarity.pkl → Streamlit lookup03 — BUILD LOG
The decisions that shaped the system, and why each one was made.
-
Two datasets, one movie
TMDB splits metadata and credits across separate files. Merging them on
movie_idproduces a single record carrying title, genres, cast, crew, overview and keywords — cast and crew being the part that makes similarity feel intuitive to a human, since people follow directors and actors. -
A combined feature soup
Genres, keywords, cast, crew and plot overview are folded into one text representation per film, then vectorised. The alternative — weighting each field separately — adds tuning parameters without clearly improving what a viewer would call a good recommendation.
-
Cosine similarity over raw distance
Cosine compares direction rather than magnitude, so a film with a long, detailed overview is not judged less similar simply for carrying more text.
-
Precompute the matrix, ship the pickle
The similarity matrix is computed once and serialised to
similarity.pkl. At request time the app performs a lookup instead of a computation, which is what keeps it responsive on Streamlit Cloud's free tier. -
Deployed, not merely runnable
Pushed to GitHub and deployed through Streamlit Community Cloud, so the project has a public URL rather than a set of local setup instructions.
04 — WALKTHROUGH
Running it end to end.
-
Install
git clone https://github.com/pinkaofc/movie-recommendation-system.git cd movie-recommendation-system python -m venv venv venv\Scripts\activate # Mac/Linux: source venv/bin/activate pip install -r requirements.txt -
Run
streamlit run app.py -
Use it
Pick a film from the dropdown and the app returns the most similar titles straight from the precomputed matrix.
http://localhost:8501
05 — STACK