I have an ice cream sales simulator for which I can simulate ice cream sales on any given day in the past. I want to optimize daily profit. The dependent variables for my ice cream shop which I have control over are: 'scoop size' and 'number of flavours'.

Now, for every day I ran my simulator with all possible combinations of my input variables, resulting in something like this:

day scoop size number of flavours profit
1 1 1 100
1 1 2 120
1 1 3 140
1 2 1 90
1 2 2 95
1 2 3 105
2 1 1 102
2 1 2 85
... ... ... ...

So for every day, I created a simulation for all possible scoop sizes and number of flavours. Apart from this, other factors might also affect my sales, like weather or day of the week, but I have no control about these.

So given the fact that I have this huge dataset with simulations, how do I go about finding the best combination of scoop size and number of flavours to use in the future?

What I've tried:

  • Just ick the combination of the row with the highest profit (140 in this case), but this might just return an outlier, for example a day on which the weather was very good, so all profits were better. I'm looking for the results with the highest average profit.
  • Group by both variables individually or create plots to visualize them against profit, but then I'm only optimizing for 1 variables at a time, but both are not independent of each other.

Should I try to add all variables that could have an impact on my profit first before making any predictions, even though there's maybe an infinite amount?

I'm not looking for an exact answer, I'm just wondering what kind of problem I'm trying to solve here, any tips or any resources to read to get a better understanding of this problem would be very welcome. I'm new to data science so I just don't know where to look. Thanks! (I'm using Python btw)


1 Answer 1


I would propose a solution like this:

  • Train a regression model which predicts the sales (target variable) based on all the features (both types: those you have control on and those you don't).
  • Assuming that the model works well, it can predicts sales given any conditions.

For example, let's say you want to optimize for tomorrow:

  • For the uncontrollable parameters, input the current values, for example day of the week tomorrow and weather forecast
  • For the controllable parameters, try all the possible combinations (repeat the process of applying the model).

Then just pick the combination of controllable parameters which leads to highest sales volume.

  • $\begingroup$ Thank you, will try. Is there any regression model you would recommend to start with for this problem? I also got a suggestion to use response surface methodology to approach this problem. Would that be a method you recommend? $\endgroup$ Jun 22, 2022 at 0:01
  • $\begingroup$ @user3739400 I would try decision tree regression or support vector regression (SVR). I don't know response surface methodology, sorry. $\endgroup$
    – Erwan
    Jun 22, 2022 at 8:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.