时间序列数据平滑处理:
python tsmoothie包:https://github.com/cerlymarco/tsmoothie/tree/master
学习笔记:
1、安装包:pip install --upgrade tsmoothie
2、测试
Examples
--------
>>> import numpy as np
>>> from tsmoothie.utils_func import sim_randomwalk
>>> from tsmoothie.smoother import *
>>> np.random.seed(33)
>>> data = sim_randomwalk(n_series=10, timesteps=200,
... process_noise=10, measure_noise=30)
>>> smoother = KalmanSmoother(component='level_trend',
... component_noise={'level':0.1, 'trend':0.1})
>>> smoother.smooth(data)
>>> low, up = smoother.get_intervals('kalman_interval')
data['q_smooth'] = smoother.smooth_data[0] # 获取平滑后的流量值
data['lower_bound'] = low[0]
data['upper_bound'] = up[0]
3、学习资料
Kalman-and-Bayesian-Filters-in-Python-chinese:https://github.com/artificialIntelligenceStudy/Kalman-and-Bayesian-Filters-in-Python-chinese/tree/chinese