Difference between revisions of "Recipe/Example/Petit Beurre"
Line 1: | Line 1: | ||
In an ingredient list often the amount (fraction) of ingredients is not specified. Knowing this is useful to get a better handle on various score. The question is now how we could estimate these fractions using the information that we have (nutritional values of separate ingredients from Ciqual and the total values for a product (a recipe). | In an ingredient list often the amount (fraction) of ingredients is not specified. Knowing this is useful to get a better handle on various score. The question is now how we could estimate these fractions using the information that we have (nutritional values of separate ingredients from Ciqual and the total values for a product (a recipe). | ||
− | A recipe | + | A recipe/product contains N ingredients, numbered i=0 to N-1. |
− | A recipe has M nutrients j=0 to M-1. | + | A recipe/product has M nutrients j=0 to M-1. |
− | Each ingredient contributes y<sub>ij</sub> to nutrient j. | + | Each ingredient contributes y<sub>ij</sub> to nutrient j. The value of y<sub>ij</sub> is between 0 and 1. The sum of all nutrients for an ingredient should be smaller than 1. The difference between 1 and the sum is the amount of water. |
− | In a recipe an ingredient | + | In a recipe contains only a fractio of an ingredient x<sub>i</sub>. |
− | The total values for a nutrient Y<sup>calculated</sup><sub>j</sub> = SUM<sub>i=0</sub><sup>N-1</sup> x<sub>i</sub>y<sub>ij</sub>. We know Y<sup>product</sup><sub>j</sub> from the | + | The total values for a nutrient Y<sup>calculated</sup><sub>j</sub> = SUM<sub>i=0</sub><sup>N-1</sup> x<sub>i</sub>y<sub>ij</sub>. We know Y<sup>product</sup><sub>j</sub> from the product. |
We kind try to find the values for x<sub>i</sub> by finding the minimum for the squared distances: | We kind try to find the values for x<sub>i</sub> by finding the minimum for the squared distances: | ||
Min SUM<sub>j</sub><sup>M-1</sup>(Y<sup>product</sup><sub>j</sub> - Y<sup>calculated</sup><sub>j</sub>)<sup>2</sup> | Min SUM<sub>j</sub><sup>M-1</sup>(Y<sup>product</sup><sub>j</sub> - Y<sup>calculated</sup><sub>j</sub>)<sup>2</sup> |
Revision as of 16:58, 16 January 2025
In an ingredient list often the amount (fraction) of ingredients is not specified. Knowing this is useful to get a better handle on various score. The question is now how we could estimate these fractions using the information that we have (nutritional values of separate ingredients from Ciqual and the total values for a product (a recipe).
A recipe/product contains N ingredients, numbered i=0 to N-1.
A recipe/product has M nutrients j=0 to M-1.
Each ingredient contributes yij to nutrient j. The value of yij is between 0 and 1. The sum of all nutrients for an ingredient should be smaller than 1. The difference between 1 and the sum is the amount of water.
In a recipe contains only a fractio of an ingredient xi.
The total values for a nutrient Ycalculatedj = SUMi=0N-1 xiyij. We know Yproductj from the product.
We kind try to find the values for xi by finding the minimum for the squared distances:
Min SUMjM-1(Yproductj - Ycalculatedj)2