<jupyter_start><jupyter_text>Smooth the dataIn this case, the data do not have to be smoothed but in order to evaluate the curves on the same grid, we have to do it.<jupyter_code># Load packages
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

from FDApy.misc import utils
from FDApy.preprocessing.smoothing.bandwidth import Bandwidth
from FDApy.representation.functional_data import DenseFunctionalData
from FDApy.representation.functional_data import IrregularFunctionalData
from FDApy.representation.functional_data import MultivariateFunctionalData
from FDApy.visualization.plot import plot

RECORDING_NUMBER = '00'

# Do it with 'x', 'y', 'xVelocity', 'yVelocity', 'xAcceleration', 'yAcceleration'
VAR = 'x'
# Load data
data_fd = pd.read_pickle(f'./data/processed/recording_{RECORDING_NUMBER}/{VAR}_fd.pkl')
# Print data
data_fd
# Plot some data
plot(data_fd[0:50])
plt.show()
%%time
# Smooth the data on a common grid
points = np.linspace(0, 1, 151)
data_smooth = data_fd.smooth(points=0.5, neighborhood=14, points_estim=points)
# Convert it to functional data object
data_smooth_fd = data_smooth.as_dense()
# Plot some smoothed data
plot(data_smooth_fd[0:50])
plt.show()
# Save the smoothed data
pd.to_pickle(data_smooth_fd, f'./data/processed/recording_{RECORDING_NUMBER}/{VAR}_smooth_fd.pkl')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09453471196454949, 'fraction_numerical': 0.012555391432791729, 'mean_word_length': 6.569832402234637, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '279754', 'license': 'MIT', 'n_tokens_mistral': 489, 'n_tokens_neox': 444, 'n_words': 128, 'path': 'round/031-smooth.ipynb', 'repo_name': 'StevenGolovkine/fcubt', 'size': '1354'}