Skip to content

Models for calculating the calories burned by a cyclist during a workout.

Notifications You must be signed in to change notification settings

aliceseaborn/cycling-caloric-expenditure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cycling Caloric Expenditure

A study of the MET-based calculation behind estimates of caloric expenditures during cycling events. Includes both the discrete MET (DMET) calculation and the continuous MET (CMET) calculation developed through machine learning methods.

This repository contains:

  1. The repository requirements in requirements.txt
  2. The Jupyter Notebook development documentation in project/Cycling Caloric Expenditure.ipynb
  3. A static HTML webpage of the documentation in project/Cycling Caloric Expenditure.html
  4. A module for calculating the discrete-based caloric output project/lib/discrete-met-model.py
  5. A module for calculating the continuous-based caloric output project/lib/continuous-met-model.py
  6. Figures generated by the study contained in the Jupyter Lab Notebook project/figures/*
  7. Figures used by the notebook and webpage in project/jupyter-figures/*

Table of Contents

Background

Sports scientists have developed methods for estimating the number of calories burned by an athlete during their workout. Among these methods is the metabolic equivalent for task (MET) calculation of caloric consumption that attempts to scale different athletic activities against each other according to their relative intensities. For cyclists, the MET scale provides calculations for caloric consumption based on the average speed of the cyclist throughout the workout. However, the scale does not provide for speeds between the specific zones of their study. Consequently, this scale results in inaccurate estimates for athletes who do not travel at the exact average speeds included in the scale. Within the scope of this study, I refer to the original scale as the discrete MET (DMET) model. Using a polynomial regression model, the gaps within the DMET model were closed to form a continuous MET (CMET) calculation that offers superior caloric expenditure estimates. In order to form some basis for comparison, the MET model for the stationary-bike and the models used by three major activity tracking applications were also studied.

Usage

Install the requirements in a python environment using the included requirements file. Then navigate into the project directory.

pip install -r requirements.txt

Import the discrete_met_model and the continuous_met_model models from lib.

>>> from lib.discrete_met_model import *
>>> from lib.continuous_met_model import *

DMET Caloric Output

To calculate the number of calories burned during a workout using the discrete MET model, pass in your current weight in pounds, the duration and the average speed of your workout.

>>> dmet_calc_total_calories_burned(weight=155.0, duration=120, speed=14.5)
1476.1904761904766

CMET Caloric Output

The continuous MET calculation takes the same arguments in the same order as the discrete calculation but offers considerably better results.

>>> cmet_calc_total_calories_burned(weight=155.0, duration=120, speed=14.5)
1286.5800318094882

About

Models for calculating the calories burned by a cyclist during a workout.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published