Welcome to the Movie Recommendation System! This Python-based project uses the cosine similarity algorithm to recommend movies based on user input. By leveraging the power of machine learning and natural language processing, this system provides personalized movie recommendations using movie descriptions and genres.
-
Data Preprocessing:
- Reads a CSV file containing movie data (id, title, genre, overview).
- Combines the "genre" and "overview" columns into a new "tags" column.
- Creates a new DataFrame with "id", "title", and "tags" columns.
-
Feature Engineering:
- Converts the "tags" column into a matrix of token counts using
CountVectorizer
from scikit-learn. - Transforms the token count matrix into a TF-IDF representation using
TfidfTransformer
.
- Converts the "tags" column into a matrix of token counts using
-
Similarity Calculation:
- Calculates cosine similarity between movie vectors using scikit-learn's
cosine_similarity
function. - Generates a similarity matrix where each element represents the similarity score between two movies.
- Calculates cosine similarity between movie vectors using scikit-learn's
-
Recommendation Generation:
- Defines a
recommendator
function that takes a movie title as input. - Finds the index of the input movie in the DataFrame.
- Sorts the cosine similarity scores for that movie in descending order.
- Prints the titles of the top 5 most similar movies.
- Defines a
Here’s a quick example of how to use the system:
from movie_recommender import recommendator
# Get recommendations for a movie titled "Inception"
recommendator("Inception")
- Build a basic movie recommendation system.
- Develop more sophisticated recommendation algorithms incorporating user ratings, release dates, and popularity.
- Adapt the system to recommend other items like books, articles, or products.
Contributions are welcome! Please feel free to submit a pull request or open an issue.
For any questions or suggestions, please contact [Raktim ] at [[email protected]].
Thank you for checking out this project! I hope you find it useful and exciting. Let's make movie recommendations smarter and more personalized! 🎥✨