Giter Site home page Giter Site logo

carson-evans / book-recommendation-knn Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 39 KB

This project utilizes the k-nearest neighbors algorithm to power a book recommendation system, providing personalized suggestions based on user rating patterns.

License: MIT License

Jupyter Notebook 100.00%
collaborative-filtering data-processing data-quality k-nearest-neighbors machine-learning user-rating

book-recommendation-knn's Introduction

Book Recommendation System

Project Overview

This project develops a book recommendation system using the Book-Crossings dataset. It utilizes Python, Pandas for data manipulation, Scipy for sparse matrix handling, and Scikit-learn for applying the Nearest Neighbors algorithm. The goal is to recommend books based on user ratings, showcasing collaborative filtering techniques in recommendation systems.

Dataset

The dataset, sourced from the Book-Crossings community, includes:

  • BX-Books.csv: Contains book details such as ISBN, book title, and author.
  • BX-Book-Ratings.csv: Comprises user ratings for various books.

Initial preprocessing steps include merging the datasets, filtering out users who have rated fewer than 200 books, and books with fewer than 100 ratings to ensure data quality and relevance.

Methodology

The recommendation system is built using the following steps:

  1. Data Preprocessing: Importing the data, merging book titles with their corresponding ratings, and filtering the data to include only users and books with a significant number of ratings to ensure reliable recommendations.
  2. Data Visualization: Plotting control histograms to observe the distribution of ratings among users and books.
  3. Matrix Transformation: Converting the user-book ratings into a pivot table, thereby creating a sparse matrix suitable for fitting with the Nearest Neighbors model.
  4. Model Training: Utilizing the Nearest Neighbors algorithm with cosine similarity to train the model on users' book ratings.
  5. Recommendation Function: Implementing a function to recommend books based on a given book title by identifying the nearest neighbors (i.e., similar user ratings).

Results

The recommendation system successfully suggests books that are similar to a given book based on user ratings. For example, recommending books related to "Where the Heart Is (Oprah's Book Club (Paperback))" yields titles such as "I'll Be Seeing You", "The Weight of Water", and "The Surgeon", among others, demonstrating the system's ability to identify and recommend books with similar reader appeal.

Conclusion and Future Work

This project demonstrates the applicability of the Nearest Neighbors algorithm in building a simple yet effective book recommendation system. Future improvements could include exploring different similarity metrics, incorporating user feedback for dynamic updating of recommendations, or extending the system to incorporate content-based filtering techniques for a hybrid recommendation approach.

book-recommendation-knn's People

Contributors

carson-evans avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.