tsfresh extract_features运行时错误“ freeze_support”

时间:2019-04-09 13:17:47

标签: python time-series feature-extraction

我最近安装了tsfresh软件包以提取我的时间序列数据的特征。我尝试在documentation中运行示例,并收到以下错误:

RuntimeError: 
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.

我有点困惑,因为它实际上是示例代码:

from tsfresh.examples import load_robot_execution_failures
from tsfresh import extract_features

df, _ = load_robot_execution_failures()
X = extract_features(df, column_id='id', column_sort='time')

当我使用自己的数据尝试该函数时,我遇到相同的错误。 我在做什么错了?

1 个答案:

答案 0 :(得分:1)

我认为there is解决了这个问题。 您可以尝试将"if __name__ == __main__:"放在函数调用周围。