A machine learning-based Anime Recommendation Engine, implemented in Python, designed to suggest anime titles based on content similarity. This project showcases data exploration, preprocessing, feature engineering, and basic recommendation algorithms using the included anime dataset.
- Features
- MLOps Architecture
- Getting Started
- API Deployment
- Project Structure
- Technologies Used
- Results
- License
This project now includes a production-ready MLOps pipeline with:
- Endpoint:
/recommend/{anime_name}- Get personalized anime recommendations - Features:
- Fast, async API built with FastAPI
- Automatic API documentation (Swagger UI at
/docs) - Input validation and error handling
- Pre-loaded similarity matrix for instant recommendations
- Dockerfile included for reproducible deployments
- Port: Exposed on
8000 - Benefits:
- Consistent environment across development and production
- Easy deployment to cloud platforms (AWS, GCP, Azure)
- Isolated dependencies
anime-app/main.py- FastAPI application with recommendation logicanime-app/anime_list.pkl- Serialized dataframe with similarity scoresanime-app/Dockerfile- Container configurationanime-app/requirements.txt- API dependencies
- Data source: Uses
anime.csv(Kaggle anime dataset). - Recommendation Algorithms:
- Content-based filtering (genre, synopsis, etc.)
- (Extendable for collaborative filtering)
- Jupyter Notebook: All code and explanations in
Anime_Recommendation_Engine.ipynb.
- Clone the repository:
git clone https://github.com/<your-username>/Anime-Recommendation-Engine.git
- Install requirements:
pip install requirements.txt
- Run the notebook:
- Open
Anime_Recommendation_Engine.ipynbin Jupyter Notebook, JupyterLab, or Colab.
- Dataset:
-
The project includes
anime.csv. No separate download needed.
1. Navigate to the API directory
cd anime-app2. Install dependencies
pip install -r requirements.txt3. Run the FastAPI server
uvicorn main:app --reload --host 0.0.0.0 --port 80004. Access the API
- API:
http://localhost:8000 - Interactive Docs (Swagger UI):
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
5. Test the endpoint
curl http://localhost:8000/recommend/Naruto1. Build the Docker image
cd anime-app
docker build -t anime-recommendation-api .2. Run the container
docker run -d -p 8000:8000 anime-recommendation-api3. Verify the deployment
curl http://localhost:8000/Request:
GET /recommend/Death%20NoteResponse:
{
"anime": "Death Note",
"recommendations": [
"Code Geass",
"Steins;Gate",
"Monster",
"Psycho-Pass",
"Ergo Proxy"
]
}anime-recommendation-engine/
│
├── Anime_Recommendation_Engine.ipynb # Main notebook with code
├── /data/anime.csv # Anime dataset
├── requirements.txt # required libraries
└── README.md # Project documentation
├── /anime-app/ # FastAPI deployment
│ ├── main.py # FastAPI application
│ ├── anime_list.pkl # Serialized data & similarity matrix
│ ├── Dockerfile # Container configuration
│ ├── requirements.txt # API dependencies
│ └── .gitignore # API-specific ignores
-
Sample recommendations:
The notebook demonstrates how the system recommends similar anime titles.
| Category | Technologies |
|---|---|
| Language | Python 3.9+ |
| ML/Data Science | pandas, NumPy, scikit-learn |
| NLP | CountVectorizer, TF-IDF |
| API Framework | FastAPI, Uvicorn |
| Deployment | Docker |
| Development | Jupyter Notebook |
| Version Control | Git, GitHub |
Distributed under the MIT License. See LICENSE for details.