Spaces:
Sleeping
title: Netflix Recommendation App
emoji: πΏ
colorFrom: blue
colorTo: red
sdk: docker
python_version: '3.12'
app_port: 7860
pinned: false
short_description: Netflix title recommendations using cosine similarity.
tags:
- recommendation
- netflix
- flask
- cosine-similarity
- docker
Netflix Recommender App
A Flask-based web application that provides personalized recommendations for Netflix content using a content-based filtering approach.
Features
- Content-based recommendations based on TF-IDF and cosine similarity
- Search and autocomplete functionality
- Visualizations of Netflix content distribution
- Deployed on huggingface for easiest access
- Works on both macOS and Windows locally
- Docker deployment available
Prerequisites
- Google Chrome and Internet Access
Ensure you have the following installed to build/run locally:
- Python 3.12+ (Check with
python --versionorpython3 --version) - Node.js and npm (Check with
node -vandnpm -v) - pip (Python package manager)
View application online (easiest method)
https://huggingface.co/spaces/erichier/finalcapstone
Manual Installation
1. Clone the Repository
git clone https://huggingface.co/spaces/erichier/finalcapstone
cd finalcapstone
2. Set Up a Virtual Environment
macOS & Linux
python3.12 -m venv venv
source venv/bin/activate
Windows (Command Prompt)
python -m venv venv
venv\Scripts\activate
Windows (PowerShell)
python -m venv venv
venv\Scripts\Activate.ps1
3. Install Dependencies
pip install -r requirements.txt
npm install
4. Download Dataset
Verify netflix_titles.csv is placed present from git clone.
Available here if needed: https://www.kaggle.com/datasets/shivamb/netflix-shows
5. Build or Load Model & Run Application
Run the following command to preprocess the dataset and generate a similarity model:
gunicorn -w 2 -b 0.0.0.0:7860 recommend_app:app
This will load the Netflix dataset, process it, and save a cached similarity model (cosine_sim_cache.pkl).
The app will be available at:
Access app at [http://0.0.0.0:7860] or [http://localhost:7860]
File Structure
finalcapstone/
βββ Dockerfile # For huggingface or local easy deployment
βββ README.md # Info and instructions on how to build and run
βββ recommend_app.py # Flask API entry point
βββ recommendation_engine.py # Machine Learning Recommendation Engine
βββ netflix_titles.csv # Dataset file from Kaggle.com
βββ requirements.txt # Python dependencies
βββ package.json # Frontend dependencies
βββ static/
β βββ index.html # Main frontend page
β βββ js/ # Frontend scripts
β βββ styles.css # Stylesheet
βββ venv/ # Python virtual environment
Stopping the Server
To stop the Flask server, press Ctrl + C in the terminal.
To deactivate the virtual environment:
macOS & Linux
deactivate
Windows
venv\Scripts\deactivate
DOCKER Deployment (optional EASY local deployment using Docker)
docker build -t my-recommend-app .
docker run -p 7860:7860 my-recommend-app
access app at http://0.0.0.0:7860 or http://localhost:7860
Example Use of the Application
Steps:
- Enter the name of a Netflix show or movie you like.
- As you type, autocomplete will suggest matching options.
- Select one of the autocomplete suggestions.
- The application will display 10 similar movies and shows, each with a corresponding similarity score percentage.