from skcycling.data_management import Rider
filename = '../data/rider/user_5.p'
my_rider = Rider.load_from_pickles(filename)
print('This rider has {} rides.'.format(len(my_rider.rides_pp_)))
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [16]: df = pd.DataFrame({'A': [1, 2, 1, 2, 1, 2, 3, 3]}) | |
In [17]: df2 = df[df['A'].isin([1, 2])] | |
In [18]: df2.loc[df2['A'] == 1, 'A'] = 4 | |
/home/glemaitre/miniconda3/lib/python3.7/site-packages/pandas/core/indexing.py:189: SettingWithCopyWarning: | |
A value is trying to be set on a copy of a slice from a DataFrame | |
See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy | |
self._setitem_with_indexer(indexer, value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.datasets import load_diabetes | |
from sklearn.compose import TransformedTargetRegressor | |
from sklearn.model_selection import GridSearchCV | |
from sklearn.ensemble import RandomForestRegressor | |
from sklearn.linear_model import LinearRegression | |
X, y = load_diabetes(return_X_y=True) | |
ttr = TransformedTargetRegressor() | |
grid = [{'regressor': [RandomForestRegressor()], 'regressor__n_estimators': [10, 20]}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import pandas as pd | |
import numpy as np | |
from sklearn.ensemble import make_stack_layer | |
from sklearn.preprocessing import FunctionTransformer | |
from sklearn.experimental import make_column_transformer | |
from sklearn.pipeline import make_pipeline | |
from sklearn.preprocessing import StandardScaler | |
from sklearn.preprocessing import CategoricalEncoder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
['/home/glemaitre/Documents/data/cycling/user_3/2015/2015-01-03-10-28-33.fit', | |
'/home/glemaitre/Documents/data/cycling/user_3/2015/2015-01-09-18-14-34.fit', | |
'/home/glemaitre/Documents/data/cycling/user_3/2015/2015-01-16-18-20-45.fit', | |
'/home/glemaitre/Documents/data/cycling/user_3/2015/2015-01-22-17-58-25.fit', | |
'/home/glemaitre/Documents/data/cycling/user_3/2015/2015-01-23-17-36-40.fit', | |
'/home/glemaitre/Documents/data/cycling/user_3/2015/2015-01-30-18-03-10.fit', | |
'/home/glemaitre/Documents/data/cycling/user_3/2015/2015-02-01-17-14-54.fit', | |
'/home/glemaitre/Documents/data/cycling/user_3/2015/2015-02-06-18-22-13.fit', | |
'/home/glemaitre/Documents/data/cycling/user_3/2015/2015-02-13-18-21-15.fit', | |
'/home/glemaitre/Documents/data/cycling/user_3/2015/2015-02-14-09-05-54.fit', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --- ploting the original angles ---# | |
fig, xxx = plt.subplots(nrows=3, ncols=2, figsize=(18, 10), sharex=True) | |
((ax0, ax1), (ax2, ax3), (ax4, ax5)) = xxx | |
ax0.plot(imu_eG[:, 0], '-', c='k', linewidth=3, label='GT', alpha=0.8) | |
ax0.plot(pre_angle[:, 0], ':', lw=2, | |
label=r'No noise$= {:1.3f} \pm {:1.3f}$'.format(0.087, 0.078)) | |
ax0.plot(pre_angle[:, 0] + np.random.random(pre_angle[:, 0].shape) - 0.5, '-.', lw=2, | |
label=r'Noisy$= {:1.3f} \pm {:1.3f}$'.format(0.087, 0.078)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import ABCMeta, abstractmethod | |
from random import randint | |
import six | |
class BaseChiffrement(six.with_metaclass(ABCMeta)): | |
@staticmethod | |
def _check_input(texte, cle): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cython: cdivision=True | |
#cython: boundscheck=False | |
#cython: nonecheck=False | |
#cython: wraparound=False | |
from libc.stdlib cimport malloc, free, realloc | |
import numpy as np | |
from ..transform import integral_image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def rep_boitier_inertiel(Ax, Ay, Az, q0, q1, q2, q3): | |
"""TODO: Docstring for rep_boitier_inertiel. | |
:Ax: Acc lin x | |
:Ay: Acc lin y | |
:Az: Acc lin z | |
:q0: quat q0 | |
:q1: quat q1 | |
:q2: quat q2 | |
:q3: quat q3 | |
:returns: array Ax, Ay, Az corrigé dans l'espace |