How devabisheik/movie-recommendation-system works
Purpose and entry points
This repository is a content-based movie recommender with a Streamlit UI. app.py is the runtime entry point (streamlit run app.py); create_pickle.py is the offline/on-demand artifact-generation entry point. The source catalog is movies.csv.
Application runtime
app.py owns the interactive recommendation flow: load persisted movie and similarity data, let a user select a movie, find its nearest neighbors, and render the top 10 results. It also fetches poster imagery from TMDB, making the UI dependent on external network/API availability.
Grounding: app.py, requirements.txt
Dataset and feature source
movies.csv is the local movie catalog used for recommendation training and lookup. Its movie metadata is the boundary between raw source data and the derived model artifacts consumed by the UI.
Grounding: movies.csv, create_pickle.py
Recommendation artifact pipeline
create_pickle.py transforms the CSV catalog into reusable serialized artifacts. The documented stages are preprocessing, feature combination, TF-IDF vectorization, and cosine-similarity calculation. This separates comparatively expensive model construction from interactive recommendation serving.
Grounding: create_pickle.py, movies.csv
Persistence and startup behavior
The application uses Pickle to persist a movie table/index and the similarity matrix as movies.pkl and similarity.pkl. These generated files are not present in the supplied tree, so they are runtime-derived state. Per the README, the application creates them on first run if absent.
Grounding: app.py, create_pickle.py
Recommendation control flow
A user selection in Streamlit maps to a movie record/index in the persisted movie dataset. app.py uses that index to read similarity scores from the cosine-similarity matrix, ranks candidate movies, selects the top 10, and presents them with TMDB poster data.
Grounding: app.py
Dependencies and external boundary
The material runtime is Python with Streamlit, Pandas, scikit-learn, Requests, and Pickle, declared in requirements.txt. Scikit-learn provides TF-IDF and cosine similarity; Requests crosses the application boundary to TMDB for poster retrieval. Development can optionally run in the provided container environment.
Grounding: requirements.txt, .devcontainer/devcontainer.json, app.py
Main entry points: app.py Streamlit app · create_pickle.py Artifact generator · requirements.txt Python dependencies · movies.csv Movie catalog
Components 15
Artifact pipeline
Builds reusable recommendation data.
- Movie catalog · Raw movie metadata used for training and lookup.
movies.csv - Artifact generator · Prepares and serializes recommendation artifacts.
create_pickle.py - Preprocessing
create_pickle.py - Combined features
create_pickle.py - TF-IDF vectors
create_pickle.py - Cosine similarity
create_pickle.py - Movie table/index · Runtime-derived movie lookup data.
- Similarity matrix · Runtime-derived nearest-neighbor scores.
Streamlit serving
Interactive recommendation flow.
- Streamlit app · Interactive runtime and recommendation orchestrator.
app.py - Movie selection
app.py - Top-10 ranking · Ranks candidates using similarity scores.
app.py - Recommendation results
app.py
Other components
- TMDB · Supplies poster imagery over the network.
- Python dependencies · Streamlit, Pandas, scikit-learn, Requests, and Pickle.
requirements.txt - Dev container
.devcontainer/devcontainer.json
Connections 18
- Movie catalog → Artifact generator: input
- Artifact generator → Preprocessing: runs
- Preprocessing → Combined features: cleans metadata
- Combined features → TF-IDF vectors: vectorizes
- TF-IDF vectors → Cosine similarity: compares
- Artifact generator → Movie table/index: serializes
- Cosine similarity → Similarity matrix: serializes
- Movie table/index → Streamlit app: loads at startup
- Similarity matrix → Streamlit app: loads at startup
- Streamlit app → Movie selection: accepts
- Movie selection → Top-10 ranking: movie index
- Movie table/index → Top-10 ranking: lookup
- Similarity matrix → Top-10 ranking: scores
- Top-10 ranking → Recommendation results: top 10
- TMDB → Recommendation results: poster data
- Python dependencies → Streamlit app: provides runtime libraries
- Python dependencies → Artifact generator: provides ML libraries
- Dev container → Streamlit app: optional development runtime