This project is a simple user-based and item-based collaborative filtering movie recommendation system built with Python and NumPy. It predicts user ratings and recommends top-N mock movies to users based on their past preferences and item similarity.
- Predict missing ratings using item-based collaborative filtering
- Recommend top-N movies for a given user
- Identify the best user to recommend a specific movie to
recommendation.py— Main logic for predictions and recommendationsdata.csv— Sample user-item rating matrix (not included, add your own)README.md— Project overview and usage instructions
-
predict_item_based(user_idx, item_idx, k=2)
Predicts a user's rating for a movie using the k most similar items. -
recommend_top_n_movies(user_idx, ratings, n=3, k=2)
Recommends the top-N movies a user is most likely to enjoy. -
find_best_user_for_movie(item_idx, ratings, k=2)
Finds the user who would most likely enjoy a specific movie.
- Prepare your ratings matrix as a NumPy array with shape
(num_users, num_movies). - Call the relevant functions with user/movie indices.
- Adjust
k(number of neighbors) to tune prediction quality.
user_idx = 0
recommend_top_n_movies(user_idx, ratings, n=3)