Cake Comparison Algorithm

It's literally about comparing cakes. My friend has a cupcake party to determine the best cups in Manhattan. In fact, it is much more ambitious. Read on.

There are 27 bakeries and 19 people (possibly one or two non-shows). There will be 4 cupcakes from each bakery, if possible, including staples - vanilla, chocolate and red velvet - and rounding 4 using wildcard flavors. There are 4 attributes on which you can evaluate cupcakes: aroma, humidity, performance (prettiness) and the common good. People will give ratings on a 5-point scale for each attribute for each cake they try. Finally, each cupcake can be cut into 4 or 5 pieces.

Question: what is the procedure for obtaining a statistically significant ranking of bakeries for each attribute and for each flavor (treatment of a “wildcard” as a flavor)? In particular, we want to rank bakeries 8 times: for each taste, we want to evaluate bakeries by kindness (kindness is one of the attributes), and for each attribute we want to rank bakeries by all tastes (i.e., regardless of taste, i.e. aggregation for all tastes). The main prize goes to a first-class bakery for the goodness attribute.

Bonus points to summarize this, of course.

This happens after about 12 hours, so I will send as an answer what we finished if no one answers in the meantime.

PS: Here's a post-party blog post about it: http://gracenotesnyc.com/2009/08/05/gracenotes-nycs-cupcake-cagematch-the-sweetest-battle-ever/

+4
source share
5 answers

Here's what we ended up doing. I made a huge table to collect all the ratings at http://etherpad.com/sugarorgy (25th edition, just in case it gets vandalized by adding this public link to it), and then used the following Perl script for analysis data to CSV file:

#!/usr/bin/env perl # Grabs the cupcake data from etherpad and parses it into a CSV file. use LWP::Simple qw(get); $content = get("http://etherpad.com/ep/pad/export/sugarorgy/latest?format=txt"); $content =~ s/^.*BEGIN_MAGIC\s*//s; $content =~ s/END_MAGIC.*$//s; $bakery = "none"; for $line (split('\n', $content)) { next if $line =~ /sar kri and deb/; if ($line =~ s/bakery\s+(\w+)//) { $bakery = $1; } $line =~ s/\([^\)]*\)//g; # strip out stuff in parens. $line =~ s/^\s+(\w)(\w)/$1 $2/; $line =~ s/\-/\-1/g; $line =~ s/^\s+//; $line =~ s/\s+$//; $line =~ s/\s+/\,/g; print "$bakery,$line\n"; } 

Then I did averaging and something else in Mathematica:

 data = Import["!~/svn/sugar.pl", "CSV"]; (* return a bakery list of ratings for the given type of cupcake *) tratings[bak_, t_] := Select[Drop[ First@Select [data, #[[1]]==bak && #[[2]]==t && #[[3]]=="g" &], 3], #!=-1&] (* return a bakery list of ratings for the given cupcake attribute *) aratings[bak_, a_] := Select[Flatten[Drop[#,3]& /@ Select[data, #[[1]]==bak && #[[3]]==a&]], #!=-1&] (* overall rating for a bakery *) oratings[bak_] := Join @@ (tratings[bak, #] & /@ {"V", "C", "R", "W"}) bakeries = Union@data [[All, 1]] SortBy[{#, oratings@ #, Round[ Mean@oratings [#], .01]}& /@ bakeries, -#[[3]]&] 

The results are below http://etherpad.com/sugarorgy .

+3
source

It might be useful to read about voting systems . PS: Do not accept what is written on Wikipedia as "good fish." I found actual errors in advanced topics.

+2
source

Break the problem into subtasks.

What is the value of a cupcake? The main approach is the "average score". A slightly more robust approach may be a "weighted average." But there can be complications, besides this ... a cupcake with 3 good and 3 flavors can be “better” than one with 5 flavors and 1 kindness, even if taste and kindness have the same weight (IOW, a low score can have a disproportionate effect).

Make a few test cupcakes (features! Cover normal scenarios and a few strange ones) and evaluate what, in your opinion, would be a reasonable “common” score if you had the perfect algorithm. Then use this data to reverse engineer the algorithm.

For example, a cupcake with kindness 4, taste 3, performance 1, and humidity 4 may deserve 4 overall, while one with kindness 4, flavor 2, presentation 5, and humidity 4 may rate only 3.

Then do the same for the bakery. Given a set of cupcakes with many points, what would be the appropriate rating? Then define a function that will give you this data.

The "goodness" rating seems a little strange, because it seems that this is a general rating, and therefore its presence already has a total score, so why calculate the total score?

If you had time to work with this, I would always suggest capturing the raw data and use it as the basis for a more detailed analysis, but I do not think that this is really relevant.

+1
source

This may be too general for you, but you can approach this type of problem using Conjoint Analysis ( link text ). Package R for implementing this Bayesma ( link text ).

+1
source

If you can write SQL, you can create a small database and write some queries. It should not be so difficult.

eg. select the amount (invoice) / invoice (estimate) as finalscore, bakery, flavor from tables, where the group from the bakery, flavor

0
source

All Articles