This project focuses on building and evaluating a movie recommendation system using a dataset of user-movie interactions.
- Read
movies.txt
and create a DataFramemovies_df
. - Read
movie_users_10_20.txt
and create a DataFramemovie_users_df
. - Convert relevant columns to appropriate data types.
- Merge
movie_users_df
andmovies_df
onmovie_id
.
- Pivot the merged DataFrame to create an interaction matrix with users as rows, movies as columns, and ratings as values.
- Map user and movie IDs to unique indices.
- Create a COO (Coordinate Format) sparse matrix from the interaction data.
- Optionally convert the COO matrix to CSR (Compressed Sparse Row) format.
- Initialize and train the LightFM model with WARP loss.
- Evaluate the model using precision and recall at k.
- Define a function
get_top_recommendations
to predict top N movie recommendations for a given user. - Generate and display recommendations for selected users.
For future enhancements, we could consider:
- Integrating more diverse data sources for richer user and item profiles.
- Experimenting with different model parameters and advanced algorithms for improved accuracy.
- Implementing a more interactive and user-friendly interface for users to interact with the recommendation system.
This project is a stepping stone towards building more sophisticated and user-centric recommendation systems in the rapidly evolving field of data science and machine learning.