← All work

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.

Role
Data work + deployment
Method
Cosine similarity on feature vectors
Data
TMDB 5000, two datasets merged
Deployment
Streamlit Community Cloud
~5,000movies indexed
2datasets merged
1precomputed similarity matrix

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 lookup

03 — BUILD LOG

The decisions that shaped the system, and why each one was made.

  1. Two datasets, one movie

    TMDB splits metadata and credits across separate files. Merging them on movie_id produces 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

○ Not deployed Target: Streamlit Community Cloud — needs model artefacts. Until then, the steps below run it locally.
  1. 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
  2. Run

    streamlit run app.py
  3. 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

PythonPandasNumPyscikit-learnCosine similarityStreamlitpickleTMDB dataset
Read the source on GitHub ↗