In [ ]:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import linregress
from skcycling.power_profile import Rpp
# Load some data previously acquired
my_rpp = Rpp()
path_to_profile = '../data/user_3/profile/2015/profile.npy'
my_rpp.load_from_npy(path_to_profile, cyclist_weight=1.)
SAMPLING_WKO = np.array([0.016, 0.083, 0.5, 1, 3, 3.5, 4, 4.5, 5, 5.5,
6, 6.5, 7, 10, 20, 30, 45, 60, 120, 180, 240])
pma, t_pma, aei = my_rpp.aerobic_meta_model(ts=SAMPLING_WKO,
normalized=False,
method='lsq')
print "pma " + str(pma) + " t_pma " + str(t_pma) + " aei " + str(aei)
# Define a lambda function to plot a line
#def line_generator(x, slope, intercept):
# return slope * x + intercept
#plt.figure()
# Plot the specific point in a semilog plot
#plt.semilogx(ts, rider_rpp.resampling_rpp(ts, normalized=True), 'ro')
#plt.semilogx(ts, line_generator(np.log(ts), slope, intercept))
#plt.fill_between(ts,
# line_generator(np.log(ts), slope,
# intercept) + 2 * std_err,
# line_generator(np.log(ts), slope,
# intercept) - 2 * std_err,
# alpha=0.2)
# Show the plot
#plt.show()
#print rider_rpp.rpp_[int(6.5*60)]
#print rider_rpp.rpp_[int(5*60)]
#print np.size(rider_rpp.rpp_)/60.
c'est à dire avec une régression linéaire sur 10 à 240 min
y =-37.2883509494 ln(t) + 394.391597262 The goodness of fitting is R2: 0.985910988681
y =-35.5001870783 ln(t) + 387.119053749 The goodness of fitting is R2: 0.975857875254
Seul cas où ça marche : ici TPma = 6.5 et PMA = 331 // CP5 = 367 il y a 10% d'écart ce qui peut expliquer l'intétrêt de la méthode.
c'est à dire avec une régression linéaire sur 10 à 240 min
y =-51.8451061423 ln(t) + 508.111452204 The goodness of fitting is R2: 0.970059919194
y =-46.6502509108 ln(t) + 482.454497481 The goodness of fitting is R2: 0.941971851905
y =-47.0294383031 ln(t) + 469.524619293 The goodness of fitting is R2: 0.984948413965
y =-46.0297635163 ln(t) + 465.798655779 The goodness of fitting is R2: 0.966533910872
/!\ données
c'est à dire avec une régression linéaire sur 10 à 240 min
y =-78.0709545049 ln(t) + 553.516831704 The goodness of fitting is R2: 0.669143641807
y =-66.8443307397 ln(t) + 534.048063237 The goodness of fitting is R2: 0.474085820413
/!\ données
c'est à dire avec une régression linéaire sur 10 à 240 min
y =-212.223117612 ln(t) + 1307.5261854 The goodness of fitting is R2: 0.993985841965
y =-210.035486305 ln(t) + 1294.88237582 The goodness of fitting is R2: 0.976610561949
c'est à dire avec une régression linéaire sur 10 à 240 min
y =-34.7173460436 ln(t) + 447.080414061 The goodness of fitting is R2: 0.95123856965
y =-38.2065802442 ln(t) + 458.563031896 The goodness of fitting is R2: 0.967534477466
In [ ]:
In [ ]: