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.
source share