← Back to list

Calorie Prediction: A start of smth

🏋 I Tried to Predict Calories Burned Using Machine Learning — Here’s What I Learned

Bhargav Punugupati · 2026-04-27 16:26 · 1 claps · 3.4 min read
#machine-learning #calorie-counting #random-forest #learning
Open on Medium ↗
Wiki topics: ML · Machine Learning EDU · Education & Learning

Calorie Prediction: A start of smth

🏋 I Tried to Predict Calories Burned Using Machine Learning — Here’s What I Learned

I completed a machine learning specialization a while ago, but for a long time it felt like I was just following along — understanding concepts, but not really owning them.

Recently, I wanted to change that.

Instead of doing another course, I decided to pick something I actually care about — fitness — and try to explore it using machine learning.

Not to build the most complex model, but to understand things differently this time:

  • by experimenting
  • by making mistakes
  • and by actually questioning the results

This project is a small step in that direction.

📌 The Question

I’ve always been into fitness — tracking workouts, checking calories burned, trying to optimize sessions.

But one thing always bothered me:

How accurate are these calorie numbers, really?

Every app gives you a number. Every machine shows a number.

But it always felt a bit… approximate.

So instead of guessing, I decided to build a model to see what actually drives calorie burn.

📊 The Data

I used a fitness dataset with features like:

  • Age
  • Gender
  • Height & Weight
  • Workout Duration
  • Heart Rate
  • Body Temperature
  • Calories burned

Nothing too complex — just the kind of data most fitness trackers already collect.

🧪 Starting Simple (Linear Regression)

I began with a basic Linear Regression model.

At this point, I thought:

“Calories should increase pretty steadily with workout intensity, right?”

The result:

  • RMSE ≈ 12.8

Not terrible.

But then I plotted the predictions.

🔍 Something Felt Off

The points didn’t form a clean line.

Instead, they curved.

That was the moment it clicked:

Calorie burn isn’t linear.

The relationship between duration, heart rate, and calories is more complex than a straight line.

And my model was forcing it to be simple.

🛠️ Making the Model Smarter

Instead of jumping to a complex model immediately, I tried something simple:

I added squared features like:

  • Duration²
  • Heart Rate²

Basically telling the model:

“Maybe this relationship curves a bit.”

The result:

  • RMSE ≈ 8.5

This was a big difference

It showed that improving a model isn’t always about switching algorithms — sometimes it’s about understanding the data better.

🌳 Letting the Model Handle Complexity

Next, I tried a Random Forest model.

Unlike linear regression, Random Forest:

  • Builds multiple decision trees
  • Captures nonlinear patterns
  • Learns interactions automatically

The result:

  • RMSE ≈ 2.6

This was a significant improvement.

At this point, the predictions were much closer to reality.

⚖️ Is It Too Good?

Whenever a model performs really well, it’s worth asking:

“Is this actually learning — or just memorizing?”

So I checked:

  • Train RMSE ≈ 1.09
  • Test RMSE ≈ 2.66

There was a small gap, meaning slight overfitting, but overall the model generalized well.

Then i tried modifying some params of the randomforest Generator and the Train RMSE ≈ Test RMSE bothare around 4 but its not OVERFITTED.

🧠 What I Learned

This project wasn’t just about models — it actually changed how I think about both machine learning and fitness data.

1. Understanding > memorizing

Doing a course is one thing. Actually building and questioning models is completely different.

2. Data isn’t always simple

Even something as “intuitive” as calorie burn isn’t linear.

3. Feature engineering matters

Simple tweaks like squared features made a big difference.

4. Tree-based models are powerful

Random Forest handled complexity much better than I expected.

🏋️ Bringing It Back to Fitness

What I found interesting is this:

We often treat calorie numbers as exact.

But in reality:

  • They depend on multiple interacting factors
  • They behave non-linearly
  • And they’re harder to estimate than they seem

So next time you see:

“You burned 243 calories”

Just remember:

It’s probably close… but not perfect.

🚀 What’s Next

This started as a small experiment, but now I’m curious to take it further.

Maybe:

  • Track my own workouts and build a personalized model
  • Create a simple tool I can actually use to do more than just simple calorie predictions on datasets, which maybe i will use too one day because ultimately and IMO most wearables GET THIS WRONG.
  • Explore more fitness-related data

💡 Final Thought

This project reminded me of something simple:

You don’t really understand machine learning until you start building things you care about.


메타데이터
post_id
9eed918e68bc
slug
calorie-prediction-a-start-of-smth-9eed918e68bc
url
https://medium.com/@bhargav.punugupati/calorie-prediction-a-start-of-smth-9eed918e68bc
canonical_url
https://medium.com/@bhargav.punugupati/calorie-prediction-a-start-of-smth-9eed918e68bc
author_url
https://medium.com/@bhargav.punugupati
status
ok
fetched_at
2026-06-29 01:02:39