基于矩阵轮廓的开放源代码python时序库

matrixprofile-ts的Python项目详细描述


PyPI versionBuild StatusDownloadsDownloads/WeekLicense

矩阵配置文件ts

Matrix Stices TS是一个Python 2和3库,用于使用U{LaSuthand新墨西哥大学的KeoghMueen研究组开发的矩阵轮廓算法来评估时间序列数据。当前的实现包括mass、stmp、stamp、stampi、stomp、scrimp++和fluss。

阅读目标博客文章here

进一步的学术描述可以找到here

matrixprofile ts的pypi页面是here

内容

矩阵剖面基础

MatrixProfile TS是Matrix Profile Foundation的一部分,该组织致力于通过教育资源和高质量代码促进社区意识和采用Matrix Profile。更多信息可以在https://www.matrixprofile.org/找到。

可以在https://ui.matrixprofile.org/找到交互式矩阵配置文件ui。

问题

矩阵配置文件基金会的一个关键目标是为在实际环境中部署矩阵配置文件提供帮助。除了电子邮件的基础成员,MPF提供了一个专门的不和谐渠道,其中从业人员可以讨论矩阵配置文件申请,并寻求具体的援助。要加入频道,click here

安装

matrixprofile ts的主要版本可在python包索引中找到:

pip install matrixprofile-ts

有关每个版本的详细信息可以在here中找到。

快速启动

>>> from matrixprofile import *
>>> import numpy as np
>>> a = np.array([0.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0])
>>> matrixProfile.stomp(a,4)
(array([0., 0., 0., 0., 0., 0., 0., 0., 0.]), array([4., 5., 6., 7., 0., 1., 2., 3., 0.]))

请注意,scrimp++由于其速度和随时可用的能力,强烈推荐用于计算矩阵配置文件。

示例

jupyter笔记本包含各种使用matrixprofile ts的示例,可以在docs/examples下找到。

作为基本的介绍,我们可以使用一个合成信号并使用stomp来计算相应的矩阵轮廓(这与{a24}中的合成信号相同)。这个例子的代码可以找到here

datamp

有几项需要注意:

  • 矩阵轮廓值在每个相位变化处跳跃。高矩阵轮廓值与“不协调”相关:以前从未观察到的时间序列行为。

  • 数据中的重复模式(或“模体”)导致低矩阵轮廓值。

我们可以在时间序列的末尾引入一个异常,并使用stampi来检测它

datampanom

矩阵配置文件的值急剧增加,突出显示了(潜在的)新行为的存在。注意,矩阵配置文件异常检测功能将取决于数据的性质以及所选的子查询长度参数。和所有好的算法一样,尝试不同的参数值也是很重要的。

算法比较

本节介绍矩阵轮廓算法和计算它们所需的时间。它还讨论了何时使用一个或另一个的用例。计时比较基于显示运行时速度的合成样本数据集。

有关更全面的运行时比较,请查看笔记本docs/examples/Algorithm Comparison.ipynb

所有的时间比较都是在一个4核2.8ghz处理器上进行的,处理器的内存为16gb。使用的操作系统是ubuntu 18.04lts64位。

AlgorithmTime to CompleteDescription
STAMP310 ms ± 1.73 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)STAMP is an anytime algorithm that lets you sample the data set to get an approximate solution. Our implementation provides you with the option to specify the sampling size in percent format.
STOMP79.8 ms ± 473 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)STOMP computes an exact solution in a very efficient manner. When you have a historic time series that you would like to examine, STOMP is typically the quickest at giving an exact solution.
SCRIMP++59 ms ± 278 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)SCRIMP++ merges the concepts of STAMP and STOMP together to provide an anytime algorithm that enables "interactive analysis speed". Essentially, it provides an exact or approximate solution in a very timely manner. Our implementation allows you to specify the max number of seconds you are willing to wait for a solution to obtain an approximate solution. If you are wanting the exact solution, it is able to provide that as well. The original authors of this algorithm suggest that SCRIMP++ can be used in all use cases.

其他语言的矩阵配置文件

联系人

引文

  1. 叶金嘉、朱彦、乌兰诺娃、贝古姆、丁一菲、黄安道、席尔瓦、穆恩、基奥(2016)。矩阵轮廓I:时间序列的所有成对相似连接:一个统一的视图,包括基序、不协调和形状。ieee icdm 2标准016

  2. 矩阵轮廓II:利用一种新的算法和GPU来突破时间序列模体和连接的1亿个障碍。朱彦,齐默尔曼(Zachary Zimmerman),纳德沙基贝·塞诺巴里(Nader Shakibay Senobari),叶金嘉(Chin Chia Michael Yeh),加雷斯·富宁(Gareth Funning),阿卜杜拉·穆恩(Abdullah Mueen),菲利普·贝里斯克(Philip Berisk)和埃蒙·基奥(Eamonn Ke欧洲经济区ICDM 2016

  3. 矩阵剖面v:一种将领域知识融入模体发现的通用技术。黄安道和伊蒙基奥。加拿大哈利法克斯,KDD'17。

  4. 矩阵剖面xi:scrimp++:交互速度下的时间序列模体发现。朱彦,叶金嘉,齐默尔曼,卡维坎加和伊蒙基奥,ICDM 2018。

  5. 矩阵轮廓八:超人性能水平的领域不可知的在线语义分割。Shaghayegh Gharghbi,Yifei Ding,Chin Chia Michael Yeh,Kaveh Kamgar,Liudmila Ulanova和Emonn Keogh。ICDM 2017年。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
我们应该在测试java代码时模拟黄瓜测试吗。我们应该在多大程度上使用黄瓜?   Hibernate Weblogic 10.3.4 java。lang.NoSuchMethodError:javax/persistence/spi/PersistenceUnitInfo。getValidationMode()Ljavax/persistence/ValidationMode;   java如何在main()中访问私有静态实例变量   java JMockit无法模拟类的公共final字段   java是否可以返回特定控制器操作的输出(html)?   java如何返回正确类型的列表?   rest-OpenUI/Swagger-java-to-API   java组织。springframework。豆。工厂NoSuchBeanDefinitionException或加载ApplicationContext失败   java使用POST将参数从JSP发送到Servlet   java如何监听特定的按钮按下和主视图用户交互?   java如何让gradle在本地maven repo中覆盖库?   如何在Java中“合并”两个URI?   java如何制作一个方法来移动数组中的字符?   使用来自java的命令启动powershell窗口   java垃圾收集器和匿名类   java如何为CellTable(GWT 2.4)中的ImageResourceCell创建PanelPopup?