tsfreshの使い方
概要
- 時系列のデータの特徴量自動作成ツール
インストール
$ python3 -m pip install 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()
display(timeseries.head())
特徴量作成
from tsfresh import extract_features
extracted_features = extract_features(timeseries, column_id="id", column_sort="time")
extracted_features
特徴量の厳選
from tsfresh import select_features
from tsfresh.utilities.dataframe_functions import impute
impute(extracted_features)
filtered_features = select_features(extracted_features, y)
filtered_features