Greetings Everyone🌻, This is my Movie Recommendation System built using Flask and Python
This task was assigned by AspireNex for the Artificial Intelligence Internship Selection Process.
TASK 2 - RECOMMENDATION SYSTEM
Create a simple recommendation system that suggests items to users based on their preferences. You can use techniques like collaborative filtering or content-based filtering to recommend movies, books, or products to users.
This project is a movie recommendation system built using Flask, Python, and AI techniques like Singular Value Decomposition (SVD) for recommendations.The frontend is designed using HTML,
CSS (Tailwind), and JavaScript.
Let’s take a quick look at how the code works
Data Handling and Flask Setup:
The movie recommendation system is built using Flask, a lightweight web framework for Python
Data Preparation:
The sample data and movie data are defined using dictionaries and converted to Pandas DataFrames.
User-Item Matrix Creation: A pivot table is created to form the user-item matrix, which is then converted to a sparse matrix format.
Normalization: The user-item matrix is normalized by subtracting the mean rating for each user.
Singular Value Decomposition (SVD):
SVD is performed on the normalized matrix to decompose it into three matrices (U, Sigma, Vt).
Prediction Generation: The decomposed matrices are used to reconstruct the original matrix, generating predicted ratings for all users.
Recommendation Function:
A function recommend_movies
is defined to generate movie recommendations for a specific user based on the predicted ratings.
Flask Route:
The /
route renders the index.html
template with the recommended and already rated movies for a sample user.
After cloning the repository, open the project in your code editor.
Navigate to the terminal and execute the following command to start the Flask server:
In summary, this movie recommendation system effectively suggests movies to users based on their preferences using Singular Value Decomposition (SVD).
It normalizes user ratings, decomposes the user-item matrix, and generates personalized recommendations.
Moving forward, I plan to enhance its capabilities further by integrating more advanced collaborative filtering techniques.
Thank you for visiting!