decision tree application

Hello, can someone help me with this case by applying the decision tree. It is a very simple case of pizza distribution. Within the table is the profit of the company
Demand 150 Demand 160 Demand 170 Demand 180
to bake 150 300 300 300 300
to bake 160 290 320 320 320
to bake 170 280 310 340 340
to bake 180 270 300 330 360
probability 0.2 0.4 0.25 0.15

The solution is to brake 170 pizzas!!!

How I have to config the workflow or how I have to transform the data?
Thank you very much in advanced.

The table is not very crear in the editor. The columns are moved, below demand 150, goes 300, 290,280, 270 and 0.2 and so on with all

Hi @Fer,
How do you arrive at the conclusion that the solution is to bake 170 Pizzas? Do you want to calculate the sum over all columns weighted by the probability per row? In that case, please have a look at the attached workflow. You should split your probabilities and the profit into two tables, then use Unpivoting, to flatten the profit table and Transpose to turn around the probabilities table. You can then join the two tables, multiply using Math Formula, then GroupBy the “to bake” column, taking the sum over the products of probability and profit. In the end, you can sort by that product to find out how many pizzas to bake. You could also use the Top k Selector node instead if you only care for the top result. Please send me some of the :pizza: :wink:

Kind regards

pizza.knwf (17.0 KB)


Hi Alexander thank you very much. Here you are the answer of the problem:
Calculando el Valor Esperado:
1-. 300(0,2)+300(0,4)+300(0,25)+300(0,15)= 300
2-. 290(0,2)+320(0,4)+320(0,25)+320(0,15)= 314
3-. 280(0,2)+310(0,4)+340(0,25)+340(0,15)= 316
4-. 270(0,2)+300(0,4)+330(0,25)+360(0,15)= 310,5
I am trying to understand your flows.
Kinder regards

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.