/Recipe-Recommendation

A web app which recommends recipes to different users, satisfy their nutrition need and flavor at the same time

Primary LanguagePython

Recipe-Recommendation

Introduction

People always face same problem in their daily life: What to eat and how to eat healthily. What’s more, people who love cooking usually don’t know how to start when facing too many ingredient pairings. Our Recipe Recommendation System gives users nutritious recipe choices which also satisfy their personal taste. Our target users are busy students and professionals who want to eat healthy. Our goal is to help people with their meal decision and bring up their health consciousness.

Data

Yummly’s API
Open Food Facts Dataset
Ingredient and Compound matching
Estimated Energy Requirements Diagram

Project Architecture

alt tag

  1. Combine two original dataset into one big recipe-compound matrix.
  2. With recipe-compound data on hand, we use two machine learning algorithms, hierarchical clustering and DBSCAN, to cluster flavor of recipes based on their compound. In final implementation, we use DBSCAN because it discard those isolated recipes and make recipe distribution better.
  3. Use information of user’s body condition to further filter out the recipes to recommend.

Installation

1. Running locally

In command prompt, enter code folder and install all necessary python libraries:

$ cd code
$ sudo pip install -r requirements.txt
$ python application.py

Then you will see something like

 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger pin code: 103-344-409

Which means you run our demo successfully. Go to you browse and enter localhost:5000, you will see our webapplication.

If you don’t want to install all the libraries and packages in your system, you can use virtualenv to setup virtual environment:

$ sudo pip install virtualenv
$ cd code
$ virtualenv venv
$ . venv/bin/activate  (For Windows user: $ venv\Scripts\activate)
$ pip install -r requirements.txt
$ python application.py

This option provides you with a virtual environment in folder venv. Whenever you want to run the demo, you can just use command $ . venv/bin/activate. After testing demo, use

$ deactivate

to exist virtual environment.

Interface

There are two pages of our webapp.
Choose flavor and enter body condition in the first page. alt tag

Display recommendation on the second page. alt tag

Dependencies

Flask
scikit-learn

Solutions to some problems

Create and Connect to a MySQL Database with Amazon RDS
Deploy a flask application on AWS
Import CSV file into MySQL

SQL to load CSV data in workbench for escapsing comma:

USE recipe;
LOAD DATA LOCAL INFILE '/Users/meteor/Gatech/Recipe-Recommendation/cleaned_data/recipe_final.csv' INTO TABLE recipe_info FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';