我正在尝试使用一个测试文件(24行x366列)的有效参数来使用python 3.7.1中的tsfresh特征提取库。
它从不停止并继续处理,我试图在另一台安装了python 2.17.16的笔记本电脑上运行相同的库,但tsfresh库不起作用。
我该怎么办?


# Import Data from CSV file
#import csv
#with open('T7.csv') as T7:
# reader = csv.reader(T7)
# try:
# for row in reader:
# print(row)
# finally:
# T7.close()
from matplotlib import pyplot as plt
from matplotlib import style
import numpy as np
import pandas as pd
style.use('ggplot')
#from tsfresh import extract_features #as tsfreshobj
#from tsfresh import MinimalFeatureExtractionSettings
from tsfresh.feature_extraction import extract_features, EfficientFCParameters
#X = extract_features(df, column_id='id', column_sort='time')
y=pd.read_csv ('1.csv')#, skiprows=1)
#y=np.loadtxt('T7_2.csv')#,
#unpack=True,
# delimiter=',')
#y1=tsfreshobj.feature_extraction.extraction.generate_data_chunk_format(y)
#y2=tsfreshobj.feature_extraction.feature_calculators.absolute_sum_of_changes(y1)
#y1=extract_features(y, feature_extraction_settings=MinimalFeatureExtractionSettings)
print (y)
# from tsfresh.feature_extraction import MinimalFeatureExtractionSettings
y1=extract_features(y, column_id='time', default_fc_parameters=EfficientFCParameters())#, column_sort='time')
print (y)
print (y1)
plt.plot(y1)
print (y)
plt.title ('some numbers')
plt.ylabel('Y axis')
plt.xlabel ('X axis')
plt.show() 发布于 2020-08-29 04:25:16
你有没有尝试过MinimalFCParameters,如果它还能工作的话?有了这些,它应该在几秒钟内完成。
一个问题可能是,您需要将代码包装在if __name__ == "__main__"中,否则多处理库将出现问题。
如果这不起作用,你可以使用我描述的任何技术,例如here来并行化tsfresh计算。
在您的另一台计算机上安装tsfresh的问题与tsfresh无关-错误消息显示您在调用pip install时没有internet连接。
https://stackoverflow.com/questions/58100194
复制相似问题