<commit_before>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
path_to_profile = '../../data/user_1/profile/2014/profile.npy'
rider_rpp = Rpp.load_from_npy(path_to_profile, cyclist_weight=70.)

# plt.figure()

# # Plot the original data
# plt.plot(np.linspace(0, rider_rpp.max_duration_rpp_, rider_rpp.rpp_.size), 
#          rider_rpp.rpp_norm_)

# # # Plot a denoised signal using b-spline
# # plt.plot(np.linspace(0, rider_rpp.max_duration_rpp_, rider_rpp.rpp_.size),
# #          rider_rpp.denoise_rpp(normalized=True), 'r+')

# # Resample the data as the SRM
ts = 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])
# plt.plot(ts, rider_rpp.resampling_rpp(ts, normalized=True))

# # Show the plot
# plt.show()

# Fit the model from Pinot et al.
ts_reg = np.array([4, 4.5, 5, 5.5,
                   6, 6.5, 7, 10, 20, 30,
                   45, 60, 120, 180, 240])
slope, intercept, std_err, r_squared = rider_rpp.aerobic_meta_model(ts=ts_reg,
                                                                    normalized=True,
                                                                    method='lsq')

print 'The goodness of fitting is R2: {}'.format(r_squared)

# Define a lambda function to plot a line<commit_msg>Change the file for Grappe<commit_after>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
path_to_profile = '../../data/user_1/profile/2015/profile.npy'
rider_rpp = Rpp.load_from_npy(path_to_profile, cyclist_weight=70.)

# plt.figure()

# # Plot the original data
# plt.plot(np.linspace(0, rider_rpp.max_duration_rpp_, rider_rpp.rpp_.size), 
#          rider_rpp.rpp_norm_)

# # # Plot a denoised signal using b-spline
# # plt.plot(np.linspace(0, rider_rpp.max_duration_rpp_, rider_rpp.rpp_.size),
# #          rider_rpp.denoise_rpp(normalized=True), 'r+')

# # Resample the data as the SRM
ts = 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])
# plt.plot(ts, rider_rpp.resampling_rpp(ts, normalized=True))

# # Show the plot
# plt.show()

# Fit the model from Pinot et al.
ts_reg = np.array([10, 20, 30,
                   45, 60, 120, 180, 240])
slope, intercept, std_err, r_squared = rider_rpp.aerobic_meta_model(ts=ts_reg,
                                                                    normalized=True,
                                                                    method='lsq')

print 'The goodness of fitting is R2: {}'.format(r_squared)

# Define a lambda function to plot a line
{'fraction_non_alphanumeric': 0.1223613595706619, 'fraction_numerical': 0.05509838998211091, 'mean_word_length': 2.4433497536945814, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '902431', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1002, 'n_words': 250}