Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
stumpy — 可扩展的 Python 库,基于 matrix profiles 进行时间序列分析,支持基序发现、异常检测、语义分割和流式模式挖掘。 | Kitploit
工具/GitHubGitHub/stumpy-dev/stumpy
通用工具机器学习异常检测异常检测 分类第 13 名
GitHubstumpy-dev/stumpy

stumpy

可扩展的 Python 库,基于 matrix profiles 进行时间序列分析,支持基序发现、异常检测、语义分割和流式模式挖掘。

查看仓库
4.2k3716220天前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享
网站

|PyPI Version| |Conda Forge Version| |PyPI Downloads| |License| |Test Status| |Code Coverage|

|RTD Status| |Binder| |JOSS| |NumFOCUS|

.. |PyPI Version| image:: https://img.shields.io/pypi/v/stumpy.svg :target: https://pypi.org/project/stumpy/ :alt: PyPI Version .. |Conda Forge Version| image:: https://anaconda.org/conda-forge/stumpy/badges/version.svg :target: https://anaconda.org/conda-forge/stumpy :alt: Conda-Forge Version .. |PyPI Downloads| image:: https://static.pepy.tech/badge/stumpy/month :target: https://pepy.tech/project/stumpy :alt: PyPI Downloads .. |License| image:: https://img.shields.io/pypi/l/stumpy.svg :target: https://github.com/stumpy-dev/stumpy/blob/main/LICENSE.txt :alt: License .. |Test Status| image:: https://github.com/stumpy-dev/stumpy/workflows/Tests/badge.svg :target: https://github.com/stumpy-dev/stumpy/actions?query=workflow%3ATests+branch%3Amain :alt: Test Status .. |Code Coverage| image:: https://img.shields.io/badge/Coverage-100%25-green :alt: Code Coverage .. |RTD Status| image:: https://readthedocs.org/projects/stumpy/badge/?version=latest :target: https://stumpy.readthedocs.io/ :alt: ReadTheDocs Status .. |Binder| image:: https://mybinder.org/badge_logo.svg :target: https://mybinder.org/v2/gh/stumpy-dev/stumpy/main?filepath=notebooks :alt: Binder .. |JOSS| image:: http://joss.theoj.org/papers/10.21105/joss.01504/status.svg :target: https://doi.org/10.21105/joss.01504 :alt: JOSS .. |DOI| image:: https://zenodo.org/badge/184809315.svg :target: https://zenodo.org/badge/latestdoi/184809315 :alt: DOI .. |NumFOCUS| image:: https://img.shields.io/badge/NumFOCUS-Affiliated%20Project-orange.svg?style=flat&colorA=E1523D&colorB=007D8A :target: https://numfocus.org/sponsored-projects/affiliated-projects :alt: NumFOCUS Affiliated Project .. |Twitter| image:: https://img.shields.io/twitter/follow/stumpy_dev.svg?style=social :target: https://twitter.com/stumpy_dev :alt: Twitter

|

.. image:: https://raw.githubusercontent.com/stumpy-dev/stumpy/main/docs/images/stumpy_logo_small.png :target: https://github.com/stumpy-dev/stumpy :alt: STUMPY Logo

====== STUMPY

STUMPY 是一个功能强大且可扩展的 Python 库,它能够高效地计算所谓的 矩阵轮廓 <https://stumpy.readthedocs.io/en/latest/Tutorial_The_Matrix_Profile.html>__,这是一种学术化的说法,意思是“对于时间序列中的每一个(绿色)子序列,自动识别其对应的最近邻(灰色)”:

.. image:: https://github.com/stumpy-dev/stumpy/blob/main/docs/images/stumpy_demo.gif?raw=true :alt: STUMPY Animated GIF

重要的是,一旦你计算出矩阵轮廓(如上图中部面板所示),它就可以用于各种时间序列数据挖掘任务,例如:

  • 模式/基序(即较长时间序列中近似重复的子序列)发现
  • 异常/新颖性(discord)发现
  • shapelet 发现
  • 语义分割
  • 流式(在线)数据
  • 快速近似矩阵轮廓
  • 时间序列链(按时间排序的子序列模式集合)
  • 用于归纳长时间序列的 snippets
  • pan matrix profiles,用于选择最佳子序列窗口大小
  • 以及更多 ... <https://www.cs.ucr.edu/~eamonn/100_Time_Series_Data_Mining_Questions__with_Answers.pdf>__

无论你是学者、数据科学家、软件开发人员还是时间序列爱好者,STUMPY 都易于安装,我们的目标是让你更快地获得时间序列洞察。更多信息请参阅 文档 <https://stumpy.readthedocs.io/en/latest/>__。


如何使用 STUMPY

请参阅我们的 API 文档 <https://stumpy.readthedocs.io/en/latest/api.html>__ 获取完整可用函数列表,并查看内容丰富的 教程 <https://stumpy.readthedocs.io/en/latest/tutorials.html>__ 以了解更全面的示例用例。下面你会找到快速演示如何使用 STUMPY 的代码片段。

典型用法(一维时间序列数据),使用 STUMP <https://stumpy.readthedocs.io/en/latest/api.html#stumpy.stump>__:

.. code:: python

import stumpy
import numpy as np

if __name__ == "__main__":
    your_time_series = np.random.rand(10000)
    window_size = 50  # Approximately, how many data points might be found in a pattern 

    matrix_profile = stumpy.stump(your_time_series, m=window_size)

通过 STUMPED <https://stumpy.readthedocs.io/en/latest/api.html#stumpy.stumped>__ 使用 Dask Distributed 对一维时间序列数据进行分布式处理:

.. code:: python

import stumpy
import numpy as np
from dask.distributed import Client

if __name__ == "__main__":
    with Client() as dask_client:
        your_time_series = np.random.rand(10000)
        window_size = 50  # Approximately, how many data points might be found in a pattern 

        matrix_profile = stumpy.stumped(dask_client, your_time_series, m=window_size)

使用 GPU-STUMP <https://stumpy.readthedocs.io/en/latest/api.html#stumpy.gpu_stump>__ 对一维时间序列数据进行 GPU 处理:

.. code:: python

import stumpy
import numpy as np
from numba import cuda

if __name__ == "__main__":
    your_time_series = np.random.rand(10000)
    window_size = 50  # Approximately, how many data points might be found in a pattern
    all_gpu_devices = [device.id for device in cuda.list_devices()]  # Get a list of all available GPU devices

    matrix_profile = stumpy.gpu_stump(your_time_series, m=window_size, device_id=all_gpu_devices)

多维时间序列数据,使用 MSTUMP <https://stumpy.readthedocs.io/en/latest/api.html#stumpy.mstump>__:

.. code:: python

import stumpy
import numpy as np

if __name__ == "__main__":
    your_time_series = np.random.rand(3, 1000)  # Each row represents data from a different dimension while each column represents data from the same dimension
    window_size = 50  # Approximately, how many data points might be found in a pattern

    matrix_profile, matrix_profile_indices = stumpy.mstump(your_time_series, m=window_size)

使用 Dask Distributed MSTUMPED <https://stumpy.readthedocs.io/en/latest/api.html#stumpy.mstumped>__ 进行分布式多维时间序列数据分析:

.. code:: python

import stumpy
import numpy as np
from dask.distributed import Client

if __name__ == "__main__":
    with Client() as dask_client:
        your_time_series = np.random.rand(3, 1000)   # Each row represents data from a different dimension while each column represents data from the same dimension
        window_size = 50  # Approximately, how many data points might be found in a pattern

        matrix_profile, matrix_profile_indices = stumpy.mstumped(dask_client, your_time_series, m=window_size)

时间序列链,使用 Anchored Time Series Chains (ATSC) <https://stumpy.readthedocs.io/en/latest/api.html#stumpy.atsc>__:

.. code:: python

import stumpy
import numpy as np

if __name__ == "__main__":
    your_time_series = np.random.rand(10000)
    window_size = 50  # Approximately, how many data points might be found in a pattern 
    
    matrix_profile = stumpy.stump(your_time_series, m=window_size)

    left_matrix_profile_index = matrix_profile[:, 2]
    right_matrix_profile_index = matrix_profile[:, 3]
    idx = 10  # Subsequence index for which to retrieve the anchored time series chain for

    anchored_chain = stumpy.atsc(left_matrix_profile_index, right_matrix_profile_index, idx)

    all_chain_set, longest_unanchored_chain = stumpy.allc(left_matrix_profile_index, right_matrix_profile_index)

语义分割,使用 Fast Low-cost Unipotent Semantic Segmentation (FLUSS) <https://stumpy.readthedocs.io/en/latest/api.html#stumpy.fluss>__:

.. code:: python

import stumpy
import numpy as np

if __name__ == "__main__":
    your_time_series = np.random.rand(10000)
    window_size = 50  # Approximately, how many data points might be found in a pattern

    matrix_profile = stumpy.stump(your_time_series, m=window_size)

    subseq_len = 50
    correct_arc_curve, regime_locations = stumpy.fluss(matrix_profile[:, 1], 
                                                    L=subseq_len, 
                                                    n_regimes=2, 
                                                    excl_factor=1
                                                    )

依赖项

支持的 Python 和 NumPy 版本根据 NEP 29 弃用策略 <https://numpy.org/neps/nep-0029-deprecation_policy.html>__ 确定。

  • NumPy <http://www.numpy.org/>__
  • Numba <http://numba.pydata.org/>__
  • SciPy <https://www.scipy.org/>__

获取方式

conda:

.. code:: bash

conda install -c conda-forge stumpy
下载工具