tsfresh.examples 包

子模块

tsfresh.examples.driftbif_simulation 模块

tsfresh.examples.driftbif_simulation.load_driftbif(n, length, m=2, classification=True, kappa_3=0.3, seed=False)[源代码]

模拟了 n 个时间序列,每个时间序列的长度为 time steps,用于描述耗散孤子的 m 维速度

classification=True: 目标 0 表示 tau<=1/0.3,具有布朗运动的耗散孤子(纯噪声驱动)目标 1 表示 tau> 1/0.3,具有主动布朗运动的耗散孤子(叠加噪声的内在速度)

classification=False: 目标为分岔参数 tau

参数:
  • n (int) – 样本数量

  • length (int) – 时间序列的长度

  • m (int) – 空间维度数量(默认 m=2)耗散孤子在其中传播

  • classification (bool) – 区分分类(默认 True)和回归目标

  • kappa_3 (float) – 逆分岔参数 (默认 0.3)

  • seed (float) – 随机种子 (默认 False)

返回:

X, y. 时间序列容器和目标向量

Rtype X:

pandas.DataFrame

Rtype y:

pandas.DataFrame

tsfresh.examples.driftbif_simulation.sample_tau(n=10, kappa_3=0.3, ratio=0.5, rel_increase=0.15)[源代码]

返回控制参数列表

参数:
  • n (int) – 样本数量

  • kappa_3 (float) – 逆分岔点

  • ratio (float) – 漂移-分叉前后样本的比率(默认值为0.5)

  • rel_increase (float) – 从分叉点的相对增加

返回:

tau. 采样的分岔参数列表

Rtype tau:

列表

class tsfresh.examples.driftbif_simulation.velocity(tau=3.8, kappa_3=0.3, Q=1950.0, R=0.0003, delta_t=0.05, seed=None)[源代码]

基类:object

模拟耗散孤子(一种自组织粒子)的速度 [6]。在没有噪声 R=0 且 $ au>1.0/kappa_3$ 时,平衡速度为 $kappa_3 sqrt{(tau - 1.0/kappa_3)/Q}$。在漂移分岔之前 $ au le 1.0/kappa_3$,速度为零。

引用

>>> ds = velocity(tau=3.5) # Dissipative soliton with equilibrium velocity 1.5e-3
>>> print(ds.label) # Discriminating before or beyond Drift-Bifurcation
1

# 平衡速度 >>> print(ds.deterministic) 0.0015191090506254991

# 模拟速度作为时间序列,包含20000个时间步长,受到高斯白噪声的干扰 >>> v = ds.simulate(20000)

simulate(N, v0=array([0., 0.]))[源代码]
参数:
  • N (int) – 时间步数

  • v0 (ndarray) – 初始速度矢量

返回:

速度矢量的时间序列,形状为 (N, v0.shape[0])

返回类型:

ndarray

tsfresh.examples.har_dataset 模块

此模块实现了下载和加载人体活动识别数据集 [4] 的功能。数据集的描述可以在 [5] 中找到。

引用

tsfresh.examples.har_dataset.download_har_dataset(folder_name='/Users/cw/baidu/code/fin_tool/github/tsfresh/tsfresh/examples/data/UCI HAR Dataset')[源代码]

从UCI ML Repository下载人体活动识别数据集并存储在/tsfresh/notebooks/data目录下。

示例

>>> from tsfresh.examples import har_dataset
>>> har_dataset.download_har_dataset()
tsfresh.examples.har_dataset.load_har_classes(folder_name='/Users/cw/baidu/code/fin_tool/github/tsfresh/tsfresh/examples/data/UCI HAR Dataset')[源代码]
tsfresh.examples.har_dataset.load_har_dataset(folder_name='/Users/cw/baidu/code/fin_tool/github/tsfresh/tsfresh/examples/data/UCI HAR Dataset')[源代码]

tsfresh.examples.robot_execution_failures 模块

此模块实现了下载机器人执行失败LP1数据集[1]_、[2]、[3]_并将其加载为DataFrame的功能。

重要: 你需要自己下载数据集,无论是手动下载还是通过函数 download_robot_execution_failures() 下载。

引用

tsfresh.examples.robot_execution_failures.download_robot_execution_failures(file_name='/Users/cw/baidu/code/fin_tool/github/tsfresh/tsfresh/examples/data/robotfailure-mld/lp1.data')[源代码]

从 UCI 机器学习库 [#2] 下载 Robot Execution Failures LP1 数据集 [#1] 并将其存储在本地。

返回:

示例

>>> from tsfresh.examples import download_robot_execution_failures
>>> download_robot_execution_failures()
tsfresh.examples.robot_execution_failures.load_robot_execution_failures(multiclass=False, file_name='/Users/cw/baidu/code/fin_tool/github/tsfresh/tsfresh/examples/data/robotfailure-mld/lp1.data')[源代码]

加载机器人执行失败 LP1 数据集[1]。时间序列作为扁平的 DataFrame 传递。

示例

>>> from tsfresh.examples import load_robot_execution_failures
>>> df, y = load_robot_execution_failures()
>>> print(df.shape)
(1320, 8)
参数:

multiclass (bool) – 如果为真,返回所有目标标签。默认只返回“正常”标签与所有其他标签。

返回:

时间序列数据作为 pandas.DataFrame 和目标向量作为 pandas.Series

返回类型:

tuple

模块内容

包含示例数据集的模块,可供随意使用。

例如,请参阅如何使用它们的 快速开始标签 部分。