Weigh the Data Confidence Score by Food Mass, Not Entry Count

Hi everyone,

I would like to suggest an improvement to the Data Confidence Score shown for micronutrients.

As I understand it, the current Data Confidence Score is calculated in a fairly rough way: it looks at the number of food entries that contain data for a given nutrient and divides that by the total number of food entries.

For example, if I log 13 food items, and 12 of them contain Selenium data, the Data Confidence Score for Selenium would be:

12 / 13 = 92.3%

That makes sense as a simple first pass, but I think it can be misleading in real-world food logs.

The issue is that each food entry appears to be treated equally, regardless of how much of that food was actually consumed.

For example, suppose the 1 item missing Selenium data is a spice or seasoning logged at 0.1 g. Should that really reduce the confidence score by 7.7 percentage points? That tiny amount is unlikely to have a meaningful impact on the total Selenium intake.

On the other hand, imagine the opposite case. Suppose the 12 foods with Selenium data are all tiny entries, like salt, pepper, spices, or small garnishes, while the 1 food missing Selenium data is the main meal of the day and accounts for 99% of the total food mass consumed. In that case, a confidence score of 92.3% would feel overly optimistic, because the missing data is attached to the food item that matters most.

My suggestion is to calculate the Data Confidence Score using the mass weight of each food item, rather than simply counting food entries.

So instead of:

(Items with nutrient data / total items) * 100

It could be:

(Total grams from foods with nutrient data / total grams logged) * 100

For example:

If I eat 910 g of food in total, and the foods that contain Magnesium data account for 900 g, while the missing item accounts for only 10 g, then the confidence score would be:

(900 / 910) * 100 = 98.9%

That seems much more representative than simply counting the number of food entries.

Likewise, if I eat 512 g of food, but only 12 g comes from foods with the nutrient data, while the remaining 500 g is missing that nutrient data, then the confidence score would be:

(12 / 512) * 100 = 2.3%

That would give a much more realistic warning that the nutrient value is probably unreliable.

The fundamental argument is that many food log entries are not equal in nutritional importance. A 0.1 g spice entry cannot contain more than 0.1 g of total substance across all nutrients, while a 500 g meal can obviously have a major impact on micronutrient totals. Treating both entries as having equal impact on the Data Confidence Score can either artificially inflate or artificially deflate the score.

I think a mass-weighted confidence score would better reflect the actual reliability of the nutrient totals and would make the label much more useful, especially for users who log many small ingredients, spices, supplements, or custom recipes.

Curious what others think.