This repository contains Jupyter notebooks for training and tuning a movie recommendation system using PyTorch and the MovieLens dataset.
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.
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.
- 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().
- used the MovieLens 25M Dataset which can be found here
- Python 3.6+
- Jupyter Notebook
- PyTorch
- Additional Python libraries: pandas, numpy, matplotlib, tqdm, scikit-learn.