I'm trying to find the best possible combination of 4 variable values to produce a successful outcome, with the data of only ~100 different recipe combinations. However, the correct outcome is a also a percent chance, meaning if I did the same recipe/combination 100 times, I might get like a 6% chance of the successful outcome, and 94% failed outcome. So different variable values/recipes would produce a different % chance of successful outcome. The range of the values can be from 10-300 inclusively. Would it be possible to sort out 4 different variables to determine some sort of rough estimate(s) of the recipe that would produce the best chance of an outcome?

Here's the best example I came I up with if I did't explain it too well; Say I want to make the best possible recipe for a magical cake (successful outcome) with 4 different ingredients with different values. Let's say the 4 variables are Chocolate, Flour, Eggs, Oil, and you have a range of 10-300 grams to put in. The oven I use has a variable % chance to produce magical cakes (successful outcome) dependent on the combination of the 4 ingredients. If it doesn't produce a magical cake, it will produce a regular cake (failed outcome). What would the best possible recipe((s) ...since there might not be enough data) be to get the highest chance of magical cakes?

I also want to apologize if it's not tagged correctly; I'm not entirely too sure what else it would fall under.

Here's some of the data. I mentioned it earlier, but I have only roughly ~100 different combinations tested for such a large range of values, which is likely going to make things harder. Ah, also to note, I'm not too sure how I would account for differences in the amount of data, since some combinations have roughly millions of attempts, while some only have 1-2k.: https://imgur.com/a/bue2tkQ

Feel free to scale the simplify/scale down the data to make it more palatable, say to single digits and easy percentages. I just really want to learn the process so I can scale it back up to the data I'm tackling, and maybe add or take out one or two variables depending on the situation. Thanks!

EDIT: Here is one of the sets of data I want to manipulate if anyone wants to take a look!


  • $\begingroup$ Can you use machine learning? :) $\endgroup$ – Matti P. Aug 16 '18 at 7:35
  • $\begingroup$ I would recommend posting the numbers here instead of a picture. It's not very convenient to extract numbers from a picture. $\endgroup$ – Matti P. Aug 16 '18 at 7:37
  • $\begingroup$ I tried to add it on to the original post, but the formatting was a bit off. I'll try again. I don't have much background in machine learning sadly ): This isn't for work/school so there's no real restriction on what you can and cannot do $\endgroup$ – Duke K Aug 16 '18 at 8:06
  • $\begingroup$ @MattiP. I linked a google spreadsheet. Thank you for taking a look! (Also, sounds like a neat idea and future project to learn and use machine learning for stuff like this) $\endgroup$ – Duke K Aug 16 '18 at 8:17
  • $\begingroup$ I would say that the starting point is to consider that the success rate is a function of $a, b, c$ and $d$: $$ s = s(a, b, c, d) $$ Let's hope that $s$ is a smooth function, although we don't know its expression. Then you just have to find the maximum value of $s$. For this, there are many methods, and one good approach is to calculate the gradient of $s$ ... $\endgroup$ – Matti P. Aug 16 '18 at 9:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.