- Content-based filtering using movie metadata (genre, director, actors, keywords, etc.)
- Text vectorization using CountVectorizer
- Performance enhancement with TfidfVectorizer
- Similarity scoring using cosine similarity
- Intelligent recommendations based on contextual similarity
- Lightweight, fast, and easy to deploy
- Python
- Pandas
- Numpy
- Scikit-learn
CountVectorizerTfidfTransformerorTfidfVectorizercosine_similarity
- Streamlit for building the frontend
This system recommends movies by comparing the content of items (e.g., genres, keywords, cast) rather than relying on user ratings.
Transforms textual movie metadata into a matrix of token counts, providing a base-level numerical representation.
Replaces the CountVectorizer with TF-IDF, which reduces the importance of commonly used words and emphasizes unique terms, improving recommendation quality.
Uses semantic similarity between movies based on metadata context (like plot keywords, genres, cast) to suggest similar movies. This includes:
- Weighted importance of certain features (e.g., genre > cast)
- Real-time similarity computation using cosine distance
-
Data Preprocessing
- Load and clean the dataset (CSV).
- Combine relevant text fields into a single "soup" of content.
-
Feature Extraction
- Apply
CountVectorizerto transform text into vectors. - Then, apply
TfidfVectorizerto enhance the vectors.
- Apply
-
Similarity Matrix
- Compute the cosine similarity matrix between all movies.
-
Recommendation Engine
- Given a movie title, fetch top N similar movies based on similarity score.
Thank you,
Disha Basu
Krishnendu Roy