幾行 Python 代碼就可以提取數(shù)百個時間序列特征

來源:DeepHub IMBA 本文約900字,建議閱讀5分鐘 在本文中,我們將深入討論tsfresh包的使用。

特征生成 特征選擇 與大數(shù)據(jù)的兼容性
pip install -U tsfresh# orconda install -c conda-forge tsfresh
描述性統(tǒng)計(平均值、最大值、相關(guān)性等) 基于物理的非線性和復(fù)雜性指標(biāo) 數(shù)字信號處理相關(guān)功能 歷史壓縮特征
import pandas as pdfrom tsfresh import select_features# Read the time-series datadf = pd.read_excel("train.xlsx", parse_dates=['date']).set_index('date')# automated feature generationfeatures = tsfresh.extract_features(df, column_id="date", column_sort="date")
多線程處理:默認(rèn)tsfresh包可以將特征生成/提取和特征選擇在多核上并行執(zhí)行。 分布式框架:tsfresh還實現(xiàn)了一個自己的分布式框架,將特征計算分布在多臺機器上加快計算速度。 Spark兼容:tsfresh還可以使用spark或Dask來處理非常大的數(shù)據(jù)。
tsfresh 的官方文檔:
https://tsfresh.readthedocs.io/en/latest/
編輯:于騰凱
評論
圖片
表情
