Using Data Science to Start The Quest for the Perfect Recipe

Posted on Jul 12, 2021
The skills I demoed here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.


This project aimed to use data science to address a problem facing my personal cake business. As the operator of a one woman cakery, there is seldom more crucial than a perfect vanilla cake recipe. This project used web scrapping and data analysis to achieve this goal.Β 



Recipe testing is a notoriously expensive and time consuming part of operating a bakery. There are millions of recipes online and bakers try out dozens before the customer ever has their first bite. I have been auditioning new vanilla cake recipes for my cakery to find one that is both delicious and reliable, while being low cost per serving and relatively low calorie. After many unsatisfying trials, I turned to data science to help me narrow my search. My main purpose was to find a vanilla-esque recipe Β that was delicious, cost effective, reasonable calories, and had generic ingredients.Β 

The Data:Β 

The first step was to obtain and clean data. The Food Network website hosts thousands of recipes, and I scraped over three thousand vanilla, yellow, white, lemon, and angel cake recipes. Each recipe included a reviews and ratings, which I used as a metric of tastiness, an ingredient list, and a serving size. These were not uniform in their construction as different authors wrote each recipe, so they were cleaned. Second, the cost and calories per serving were calculated based on the ingredient list using the prices as found on and an online calorie tracking database. Once these attributes were cleaned and created they were ready to be analyzed.Β 

Data Analysis:Β 

In addition to my ultimate goal of finding a delicious, cheap, and low calorie vanilla cake recipe, I also had curiosities about the data that could be implemented in my own business. Do higher rated cakes cost more per serving? Are they higher calorie? Do specialty ingredients yield more stars? Are these investments necessary to create delicious cakes?


Using Data Science to Start The Quest for the Perfect Recipe Using Data Science to Start The Quest for the Perfect Recipe

As shown in the graphs above, the five star rated cakes did not, in fact, have a higher per serving cost or calorie count nor was there any upward trend in these attributes and the rating got higher. Though there was a higher spread of cost in the higher rated recipes, this could be due to the fact that there was higher volume of four and five star recipes. This was encouraging because it is not about the amount spent or butter added per serving, a good recipe is more than that.Β 

Next, further analysis was done on the five-star recipes to find ones that were cost and calorie effective and had copious reviews.Β 

Using Data Science to Start The Quest for the Perfect Recipe

As seen above, calories and cost per serving have a highly linear relationship as would be expected because they stem from the same list of ingredients. The ideal recipe would fall into the bottom left corner of low calorie and cheaper.Β 


Taking a closer look at this region we can see the recipes that meet the criteria and when shaded in based on number of ratings, we can extract the top four recipes that were delicious, popular, cheaper, and calorie conscious, the attributes of a good recipe. These will be tested in the coming weeks as contenders for my bakery's new vanilla cake.Β 


Further Works:

In the future, the main thing I would like to incorporate into this project is more and varied data. Instead of scraping just one recipe hub, I would love to collect data from more baking blogs and other recipe sites as well. I would also love to explore the effect of specialty ingredients on the rating of the cake to see if it is a worthwhile investment. Ultimately, now that the tools are built this is a very efficient way to explore other flavors and optimize my recipe testing.Β 

About Author

Gabrielle Klein

Recent graduate from the University of Chicago with a Master's in Applied and Computational Mathematics. Experience programming in Python, R, and Matlab. Passionate about all things math, looking forward to launching a career in data science.
View all posts by Gabrielle Klein >

Related Articles

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI