Skip to content

Movie Recommendation System using PyTorch and Collaborative Filtering and trained on the MovieLens 25M dataset

Notifications You must be signed in to change notification settings

SamDc73/Flickpick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Movie Recommendation System with PyTorch

This repository contains Jupyter notebooks for training and tuning a movie recommendation system using PyTorch and the MovieLens dataset.

Notebooks

1. main.ipynb

This notebook contains the main code for training the movie recommendation model. It includes:

  • Implementing a collaborative filtering approach using matrix factorization, specifically the Neural Collaborative Filtering (NCF) algorithm.
  • Employing techniques such as embedding layers, fully connected layers with non-linear activations, dropout regularization, and optimization algorithms like Adam to capture complex user-movie interactions and prevent overfitting.
  • Evaluating the trained model's performance useing Root Mean Squared Error (RMSE) and Mean Absolute Error (MAE), and generating personalized movie recommendations based on the learned user and movie embeddings.

2. tuning.ipynb

This notebook focuses on hyperparameter tuning for the movie recommendation model, but due to computational resource limitations, the code in this notebook was written but not executed. It includes:

  • Implementing a grid search approach to explore different combinations of hyperparameters.
  • Utilizing k-fold cross-validation technique to evaluate the model's performance across different hyperparameter settings.
  • Identifying the best-performing hyperparameter configuration based on the cross-validation results.

Models

  • The trained movie recommendation model has been serialized and saved in two different formats: PyTorch model checkpoint (.pth) and ONNX (Open Neural Network Exchange) format (.onnx).
  • PyTorch model checkpoint (final_model_state_dict.pth): The model's parameters have been converted to half-precision (FP16).
  • ONNX format (model.onnx) has been exported using torch.onnx.export().

Dataset

  • used the MovieLens 25M Dataset which can be found here

Prerequisites

  • Python 3.6+
  • Jupyter Notebook
  • PyTorch
  • Additional Python libraries: pandas, numpy, matplotlib, tqdm, scikit-learn.

About

Movie Recommendation System using PyTorch and Collaborative Filtering and trained on the MovieLens 25M dataset

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published