Skip to content

kyklospi/memory-collaborative-filtering

Repository files navigation

Movie Recommendation System

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.

Features

  • 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

Files

  • recommendation.py — Main logic for predictions and recommendations
  • data.csv — Sample user-item rating matrix (not included, add your own)
  • README.md — Project overview and usage instructions

Key Functions

  • 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.

How to Use

  1. Prepare your ratings matrix as a NumPy array with shape (num_users, num_movies).
  2. Call the relevant functions with user/movie indices.
  3. Adjust k (number of neighbors) to tune prediction quality.

Example

user_idx = 0
recommend_top_n_movies(user_idx, ratings, n=3)

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors