Loren on the Art of MATLAB

Turn ideas into MATLAB

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

When is a Baked Good a Cookie? 1

Posted by Loren Shure,

This is one time of the year when there is often an abundance of baked goods showing up in my office, and many others no doubt. And you hear people say things like, "That's the best cookie I ever had!". And sometimes a debate ensues.

One problem, of course, is that not all cookies are good. Another is not all baked goods are cookies. Hmmm, there must be some math that could help us out here.

Contents

Quantifying "Cookieness"

A colleague just pointed out a thread on Reddit where there is a discussion about cookies, and which ones are best. In an effort to resolve the intense debate, one employee analyzed recipes to determine which ones qualify as a cookie.

Methodology

To do so, the author

  1. scraped recipes from the net, including ones including the term "cookie" and some other chosen terms,
  2. used the ingredient lists as input to principal component analysis to reduce the dimensionality of the problem,
  3. applied clustering algorithms and and support vector machines to distinguish between pastries and cookies

Outcome

The conclusion reached - some very tasty tarts did not quality for best cookie! Do you use MATLAB recreationally? To learn new concepts that might not yet be relevant for your work, but you are curious about? We'd love to hear your ideas here.


Get the MATLAB code

Published with MATLAB® R2017b

Note

Comments are closed.

1 CommentsOldest to Newest

Harald Hentschke replied on : 1 of 1
Many years ago I implemented an audio-enhanced version of the card game popularly known as 'Memory' (aka 'Pairs', or 'Concentration'): a large figure window opens up and initially displays 2*n magenta rectangles ('cards'), each of them being associated with a sound snippet (characteristic of our lab) and occluding graphs of the time series and frequency power spectrum of that sound snippet. When the user clicks on a rectangle, the sound is played and the rectangle made invisible, revealing the graphs. The player's task is to find matching pairs. Upon success, the matching pair of cards remain 'open' (rectangle invisible, graphs visible), otherwise they are 'closed' again. Primarily a birthday present back then, it also served me to rehearse the basics of GUI programming outside the GUIDE framework. I'm considering tailoring it to kids in terms of sounds (think crunching cookie etc.) and licenses (make it a standalone application). Deploying code as standalone applications may soon become relevant for my work, so I'm happy to rehearse & play.