This project is a movie recommendation system designed to suggest movies based on a user's previous search history and interests. The system leverages collaborative filtering and content-based filtering techniques to provide personalized movie recommendations.
- Collaborative Filtering: Recommends movies by finding users with similar tastes and suggesting movies they have liked.
- Content-Based Filtering: Suggests movies similar to those the user has previously enjoyed, based on movie attributes like genre, cast, and keywords.
- Hybrid Approach: Combines collaborative and content-based filtering to improve recommendation accuracy and address the cold-start problem.
- Python: The primary programming language used for the project.
- Pandas: For data manipulation and analysis.
- NumPy: For numerical operations.
- Scikit-learn: For machine learning algorithms.
- Surprise: For building and evaluating collaborative filtering models.
- NLTK: For natural language processing tasks.
-
Clone the repository: bash git clone https://github.com/yourusername/movierecommender.git cd movierecommender
-
Install the required libraries: bash pip install numpy pandas scikit-learn scikit-surprise nltk
-
Data Preparation: Load and preprocess the movie and ratings datasets. python import pandas as pd from surprise import Dataset
movies = pd.read_csv('movies.csv') ratings = pd.read_csv('ratings.csv')
data = Dataset.load_builtin('ml-100k')
-
Model Training: Train the recommendation models using collaborative filtering and content-based filtering. python from surprise import SVD from surprise.model_selection import train_test_split
trainset, testset = train_test_split(data, test_size=0.25)
algo = SVD() algo.fit(trainset)
-
Making Recommendations: Generate movie recommendations for a user. python from surprise import accuracy
predictions = algo.test(testset)
accuracy.rmse(predictions)
Contributions are welcome! Please fork the repository and submit a pull request with your changes.