使用tsfresh报错:Can only compute partial correlation for lugs up to 50% of the sample size.

关于很多博客中的使用tsfresh提取时间序列特征,运行例子的时候报错:Can only compute partial correlation for lugs up to 50% of the sample size.

解决方法:

1. 网上博客例子是这样的:

  import tsfresh
  from tsfresh.examples.robot_execution_failures import download_robot_execution_failures, load_robot_execution_failures
  download_robot_execution_failures()
  timeseries, y = load_robot_execution_failures()
  from tsfresh import extract_features
  extraced_features = extract_features(timeseries, column_id='id', column_sort='time')
  extraced_features.head()
替换成这样:

import tsfresh
from tsfresh.examples.robot_execution_failures import download_robot_execution_failures, load_robot_execution_failures

from tsfresh import extract_features
robot_execution_failures.download_robot_execution_failures()
df, y = robot_execution_failures.load_robot_execution_failures()
df.head()

extraction_settings = ComprehensiveFCParameters()

X = extract_features(df, column_id='id', column_sort='time',
                     default_fc_parameters=extraction_settings,
                     # we impute = remove all NaN features automatically
                     impute_function=impute)

X.head()

2. 如果还有错误,先重启你的notebook然后再试试。

3. 如果还有错误,那么首先重新安装你的pandas和numpy,然后重启你的notebook。

4.如果还有错误,手动删掉你安装的tsfresh包,重新安装tsfresh,然后重启你的notebook测试。

经过上面的步骤后,经过我的亲测,可以解决各种报错问题。最后如果成功会出现类似下图效果:

有问题可加qq群Python数据分析&机器学习636866908或者群R语言&大数据分析456726635与我进行沟通讨论。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值