DEV Community

Kazi Priom
Kazi Priom

Posted on

The Popcorn Problem - lowCal_update 8

I'm trying to find a way to use the Nutrionix API to work with my model. I don't have the entire database, which is problematic, but perhaps running a script will give me enough data for the model to learn. The worst case is that I have to get a license for the DB with money.

I will have to calculate the calorie density of the food and use that as the metric. I will try with calories/gram, however, this might be too simplistic in the vast data of food. One simple example of a food with a lot of density with an average calorie/gram ratio is popcorn. This is due to the large amount of air in popcorn. This causes an issue in using the calories/gram metric as air doesn't have weight. Perhaps another metric can be used: calories/serving. However, this causes the issue of the serving size being chosen by the manufacturer. Many foods have very small serving sizes, leading the consumer to think that a food has 200 calories, while in reality it has 400 as it has two serving sizes. But a potentially perfect metric might be calorie/cup. Cup is a volume metric, and is perfect for my use case. Work needs to be done in this area.

API Trace View

How I Cut 22.3 Seconds Off an API Call with Sentry

Struggling with slow API calls? Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (0)

Postgres on Neon - Get the Free Plan

No credit card required. The database you love, on a serverless platform designed to help you build faster.

Get Postgres on Neon