--- title: Book Recommender emoji: 📚 colorFrom: blue colorTo: indigo sdk: streamlit app_file: app.py pinned: false --- # 📚 AI Book Discovery Engine (Hybrid KNN) A high-performance recommendation system that utilizes the **K-Nearest Neighbors (KNN)** algorithm to identify stylistic and statistical "neighbors" within a library of over 10,000 titles. ## 🚀 Live Demo Built with **Streamlit** and optimized for low-latency performance on local and cloud environments. --- ## 🛠️ Project Overview ### **1. Core Algorithm: Hybrid K-Nearest Neighbors** Unlike simple recommendation engines, this project uses a **multi-dimensional feature space** (6,662 features) to calculate distances between books. * **Feature Vectorization:** Authors and Languages are transformed into binary vectors via One-Hot Encoding. * **Distance Logic:** We use a dual-weight approach: * **Cosine Similarity:** Measures the "stylistic" distance (Authors/Metadata). * **Absolute Difference:** Measures the "popularity" distance (Ratings Count). ### **2. Key Metric: Model Accuracy** The engine was evaluated using **Mean Absolute Error (MAE)** to compare predicted ratings against actual reader sentiment. * **MAE Score:** `0.2927` * **Significance:** An error of less than 0.3 stars proves that the chosen "neighbors" are highly representative of the target book’s quality and reader appeal. --- ## 📈 Business Insights * **Cold Start Mitigation:** By weighting popularity alongside metadata, the system ensures that "blockbuster" readers are recommended verified hits while preserving the niche characteristics of specific authors. * **Resource Efficiency:** Successfully handles a high-dimensional dataset on consumer-grade hardware (8GB RAM), demonstrating efficient state management and caching strategies. --- ## 📂 Repository Structure * `app.py`: The Streamlit dashboard and recommendation logic. * `books.csv`: The cleaned Goodreads dataset. * `requirements.txt`: Environment dependencies for deployment. --- **Author:** [Your Name] **Focus:** Data Science Transition Project (Mastering Applied Data Science)