Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel
Integration:  dvc git github
Annalie Kruseman b5382b7f04
Convert README.rst to .md
3 years ago
b5382b7f04
Convert README.rst to .md
3 years ago
b5382b7f04
Convert README.rst to .md
3 years ago
b5382b7f04
Convert README.rst to .md
3 years ago
51455b5911
Add project.
3 years ago
b5382b7f04
Convert README.rst to .md
3 years ago
5070693b02
Add raw data
3 years ago
51455b5911
Add project.
3 years ago
b5382b7f04
Convert README.rst to .md
3 years ago
5070693b02
Add raw data
3 years ago
51455b5911
Add project.
3 years ago
f6e788c6ab
Add ipynb checkpoints.
3 years ago
538ca883c8
Minor change in README.
3 years ago
Storage Buckets
Data Pipeline
Legend
DVC Managed File
Git Managed File
Metric
Stage File
External File

README.md

You have to be logged in to leave a comment. Sign In

Recipe Recommendations

Description

Often recipe websites contain a filter to look for recipes. Sometimes when you look for a recipe you don’t necessarily know what filter you want to apply exactly. Do you want to filter on recipes with zucchini or carrots? Maybe you don’t mind what kind of vegetable is used when the taste of the dishes are sort of similar. The goal of this recommendation system is to find recipes that are considered similar in taste and composition. And, to challenge your comfortzone with new recipes. In order to do that we use the ingredients of each recipe as the features and calculate how similar to another recipe each recipe is. To build the features we use the bag of words technique. For the similarity metric we use the cosine similarity. The advantage of using a cosine similarity metric is to outweigh the fact that some recipes contain very few ingredients and others contain many. By converting recipes to vectors we only consider the angel between two vectors and not the lenght. Hence, the cosine similarity works well with sparse matrices. The foundation of this recommendation system is a network graph. A network graph will provide a representation of how connected, or similar, recipes are. The resulting network consists only of recipes that exceed the threshold of a similarity score of 0.5. In this example the relations between recipes are explored. However, the concept described here can be applied to many other type of relations between entities or actors.

The result of this recommendation system is presented with the Streamlit application and contains an interactive network made with Plotly and Networkx.

Getting Started

Prerequisites

Make sure Streamlit is installed and a python version between 3.6 and 3.8 is running. The python version of this application python 3.8.6. For all prerequisites see the dependencies in the file pyproject.toml.

Installation

The data for this application is stored in a personal AWS S3 bucket and retreived with the data version control package DVC. If you would like to replicate this application clone this repository and download the raw dataset, see link at the bottom of this page. .

When downloading the data with DVC it is assumed that the data is stored elsewhere and that DVC is connected. Next, use the following line of code in the same directory in your terminal to fetch the data:

dvc pull

To run the streamlit application and view the recommendation system run:

streamlit run recipes_recommendatons.py

Alternative to running the streamlit application you may run the raw python code that outputs the recommendation for a particular recipe as an interactive network graph in your browser. Choose a threshold for the similarity metric as the first argument and the recipe as the second argument. To replicate this code run:

python raw_code.py .5 41995

Usage

The recommendation system created here is an example of exploring relations between between entities. The data used here consists of text, but the concept can be used for many other applications. Think of a network of people and their behaviors, or a network of connected roads.

The below figure shows an example of the output through the Streamlit application. Recipe Recommendation Network example

Authors and acknowledgment

Annalie Kruseman

Feel free to contact me for any questions on annaliakruseman@gmail.com

Dataset downloaded from Kaggles ‘What’s Cooking’

Tip!

Press p or to see the previous file or, n or to see the next file

About

Recommendations for recipes displayed in a streamlit application.

Collaborators 1

Comments

Loading...