如何导入 tsfel 模块而不引发错误?

发布于 2025-01-15 21:01:16 字数 682 浏览 5 评论 0原文

我使用 tsfel 包从信号中提取特征。我尝试实现个性化功能,并且已阅读文档 (https:// tsfel.readthedocs.io/en/latest/descriptions/personal.html)。我已完全按照这些步骤操作,但当我尝试运行第二步(即将新功能添加到 features.json)时,它会引发错误 ModuleNotFoundError: No module named 'tsfel.features_utils'

这是一个简单的代码示例

import numpy as np
# from tsfel.add_personal_features import add_feature_json

@set_domain("domain", "statistical")
def range(signal):
    range = np.max(signal) - np.min(signal)
    return range

错误是:ModuleNotFoundError:没有名为'tsfel.features_utils'的模块

我应该如何导入模块?

I use the tsfel package to extract features from signals. I try to implement a personalized feature and I have read the documentation (https://tsfel.readthedocs.io/en/latest/descriptions/personal.html). I have followed the steps exactly but when i try to run the second step (i.e. Add the new feature to features.json) it raises an error ModuleNotFoundError: No module named 'tsfel.features_utils'.

Here is a simple example of code

import numpy as np
# from tsfel.add_personal_features import add_feature_json

@set_domain("domain", "statistical")
def range(signal):
    range = np.max(signal) - np.min(signal)
    return range

The error is: ModuleNotFoundError: No module named 'tsfel.features_utils'

How should I import the module?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

驱逐舰岛风号 2025-01-22 21:01:16

对于0.1.6版本,您可以执行以下操作

from tsfel.feature_extraction.features_utils import set_domain

您也可以从 github
输入图片此处描述

For the version 0.1.6, you may do as follows

from tsfel.feature_extraction.features_utils import set_domain

You can also confirm it from the github
enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文