Quantify Effort in Activity using Power¶
This example illustrates which metrics can be used to quantify the effort of a cyclist during a cycling ride.
print(__doc__)
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# License: BSD 3 clause
We can first read a toy ride from the library
Different scores are available in scikit-cycling
. We can first compute
the normalized power® which corresponds to an average power during the ride
with an additional smoothing. To compute this score, we need to know the
maximum power aerobic (or the functional threshold power).
from skcycling.metrics import normalized_power_score
mpa = 400
np_score = normalized_power_score(ride['power'], mpa)
print('Normalized power {:.2f}'.format(np_score))
Out:
Normalized power 218.49
The intensity factor® normalize the normalized power using the functional threshold power.
from skcycling.metrics import intensity_factor_score
if_score = intensity_factor_score(ride['power'], mpa)
print('Intensity factor {:.2f}'.format(if_score))
Out:
Intensity factor 0.72
To obtain a metric which is normalized depending of the time, we need to compute the training stress score® which is derived from the intensity factor®.
from skcycling.metrics import training_stress_score
ts_score = training_stress_score(ride['power'], mpa)
print('Training stress score {:2f}'.format(ts_score))
Out:
Training stress score 32.384457
Alternatively, we can use the ESIE scale to compute the load of an activity.
from skcycling.metrics import training_load_score
tl_score = training_load_score(ride['power'], mpa)
print('Training load score {:.2f}'.format(tl_score))
Out:
Training load score 74.90
Total running time of the script: ( 0 minutes 1.032 seconds)