Shane Bogue Projects

Book recommendation system

My WGU computer science capstone

A dark Streamlit app titled Literature Recommendation, with a book picker, KNN and cosine similarity options, and a list of similar books with ratings, similarity scores and genres.
The Streamlit app showing cosine-similarity results for a selected book. Fig. 1 2025
  • Education
Year
2025
Role
Sole author
Org
Western Governors University
Stack
Python, pandas, NumPy, scikit-learn (TF-IDF, NearestNeighbors, KMeans, PCA), Streamlit and 4 more

A content-based book recommender built on Goodreads metadata and served as a two-page Streamlit app. It turns each book's title, author and genres into TF-IDF vectors, recommends with KNN or a cosine-similarity matrix, and then re-weights by author and genre.

Problem

The capstone scenario: readers have trouble finding books that fit their own taste, and bestseller lists and broad ratings ignore individual preference.

Scatter plot of books in colored clusters, projected onto two PCA components.
KMeans genre clusters projected with PCA. Fig. 2

Approach

I cleaned and deduplicated the dataset with pandas, combined title, author and genres into one feature string, and vectorized it with TF-IDF. I built a scikit-learn NearestNeighbors model with cosine distance and a cosine-similarity matrix, plus a similarity function weighted by genre and author. I explored the data in a Colab notebook: top genres, the rating distribution, ratings against review counts, and KMeans genre clusters projected with PCA. The written deliverable covered a proposal, an executive summary, a post-implementation report and a quick-start guide.

Bar chart of the seven most common genres in the dataset.
The seven most common genres. Fig. 3

Process

3 dated steps, from the project’s history

  1. 01

    Proposal

    The capstone proposal letter, written for WGU's role-play scenario.

  2. 02

    Code and notebook

    Uploaded the app, the exploration notebook, the capstone document and requirements.

    Scatter plot of average book rating against number of reviews on a log scale.
    Exploration: average rating against review count. Fig. 4
  3. 03

    Portfolio polish

    Added a dev container, refactored the model, popular and recommended modules, and captured the app. See Fig. 1, above.

Results

The testing in my report supports the idea that metadata-based recommendations beat popularity-based ones, with a caveat I wrote into the report: "accuracy" here is subjective, and similarity scores run high for books in a series.

Lesson

Content-based filtering does very well on series and under-scores standalone books, and the report says so.