This project is a simple, interactive web application that predicts calories burned during exercise, based on user input as following:
age, weight, height,duration of exercise, heart rate, and current body temperature.
It follows a microservice-based architecture using:
- Streamlit as the frontend UI
- FastAPI as the backend prediction API
- Collects user details (like age, height, weight, duration of exercise, etc.) through a friendly web interface.
- Sends that data to a FastAPI microservice.
- Applies feature engineering and a trained machine learning model to predict calories burned.
- Returns the prediction to the frontend and displays it.
Make sure you have Python 3.8+ installed. Then:
git clone https://github.com/sfarrukhm/predict-calories.git
cd predict-caloriesCreate and activate a virtual environment first:
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
# Then install dependencies
pip install -r requirements.txtcd predictor_service
uvicorn main:app --reloadThis will start the API server at http://localhost:8000
cd frontend
streamlit run app.pyThis project is based on the dataset provided in the Kaggle Playground Series - Season 5, Episode 5, which involves predicting calories burned during exercise.
The feature engineering and modeling techniques can be seen in following notebook: