当前位置:网站首页>时间序列曲线相似性
时间序列曲线相似性
2022-07-30 11:03:00 【jaffe—fly】
使用DTW比较曲线相似性
from dtaidistance import dtw as dtwd
import numpy as np
import matplotlib.pyplot as plt
from labellines import labelLines
x=np.arange(0,2*np.pi,0.1)
y=np.sin(x)
plt.plot(x, y,label='y')
for i in [0,1,2,3]:
z=np.sin(x+(np.pi/2)*i)
distance_s = dtwd.distance(y, z,use_c=True)
plt.plot(x,z,label=str(i))
print(distance_s)
#简单的设置legend(设置位置)
#位置在右上角
plt.legend(loc = 'upper right')
0.0
3.579437105036351
5.914434728535967
3.3300802329969446

峰谷想错的时候,距离最大
边栏推荐
猜你喜欢
随机推荐
活动速递| Apache Doris 性能优化实战系列直播课程初公开,诚邀您来参加!
R语言怎么绘图(一个r语言完整的命令有什么)
自定义查询--关于倒排索引的研究
RY-D1/1电压继电器
张量篇-初步
Still using Swagger?I recommend this interface management artifact with zero code intrusion
RandLA-Net复现记录
Jingdong school recruited written test questions + summary of knowledge points
UE5 GAS Study Notes Postscript 0
Log4j additivity属性简介说明
单片机开发之ADC0808/9信号采集
log4j Logger简介说明
【Flume】batchSize和transactionCapacity区别
定制.NET 6.0的依赖注入
还在用Swagger?我推荐这款零代码侵入的接口管理神器
Voltage relay HDY - vac - 1 A / 1-220
编译Hudi
FPGA刷题——计数器(简易秒表、可置位计数器、加减计数器)
HJY-F931A/YJ三相电压继电器
The battle-hardened programmer was also deceived by a fake programmer from a certain fish. The trust between programmers should be the highest, and he alone destroyed this sense of trust








