tsfresh.examples 包

子模块

tsfresh.examples.driftbif_simulation 模块

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

模拟 n 个时间序列,每个时间序列长度为 length 个时间步,用于耗散孤子的 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。时间序列容器和目标向量

返回类型 X:

pandas.DataFrame

返回类型 y:

pandas.DataFrame

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

返回控制参数列表

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

  • kappa_3 (float) – 逆分叉点

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

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

返回:

tau。采样分叉参数列表

返回类型 tau:

list

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)[source]

基类: 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.]))[source]
参数:
  • N (int) – 时间步数

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

返回:

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

返回类型:

ndarray

tsfresh.examples.har_dataset 模块

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

参考文献

tsfresh.examples.har_dataset.download_har_dataset(folder_name='/home/docs/checkouts/readthedocs.org/user_builds/tsfresh/envs/latest/lib/python3.10/site-packages/tsfresh/examples/data/UCI HAR Dataset')[source]

从 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='/home/docs/checkouts/readthedocs.org/user_builds/tsfresh/envs/latest/lib/python3.10/site-packages/tsfresh/examples/data/UCI HAR Dataset')[source]
tsfresh.examples.har_dataset.load_har_dataset(folder_name='/home/docs/checkouts/readthedocs.org/user_builds/tsfresh/envs/latest/lib/python3.10/site-packages/tsfresh/examples/data/UCI HAR Dataset')[source]

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='/home/docs/checkouts/readthedocs.org/user_builds/tsfresh/envs/latest/lib/python3.10/site-packages/tsfresh/examples/data/robotfailure-mld/lp1.data')[source]

从 UCI 机器学习存储库[#2]下载机器人执行失败 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='/home/docs/checkouts/readthedocs.org/user_builds/tsfresh/envs/latest/lib/python3.10/site-packages/tsfresh/examples/data/robotfailure-mld/lp1.data')[source]

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

示例

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

multiclass (bool) – 如果为 True,返回所有目标标签。默认为仅返回“正常”与其他所有标签的对比。

返回:

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

返回类型:

tuple

模块内容

包含可供试用的示例数据集的模块。

例如,请参阅快速开始部分了解如何使用它们。