pip install tsfresh★Pulls in pandas, numpy, scipy, statsmodels. Optional Dask/distributed for scale.# N time series (by id) -> 1 row of ~1200 features each★The output is a classic tabular matrix: rows = series, columns = features. Then it's an ordinary ML problem.from tsfresh import extract_features, select_features, extract_relevant_features★The three functions you'll use 90% of the time.
X = extract_features(ts, column_id="id", column_sort="time")★The main call.column_idgroups rows into series;column_sortorders each series in time. Returns a wide feature matrix indexed by id.extract_features(ts, column_id="id", column_sort="time", column_value="value", column_kind="sensor")★column_kindlets one long table hold multiple signals per id (e.g. several sensors) — features are computed per kind.extract_features(ts, ..., n_jobs=4, disable_progressbar=True)Parallelize across cores; extraction is the expensive step (1200 features × N series).
# LONG (stacked) format — the default input: # columns: id | time | value (one row per observation)★tsfresh expects long data: each row is one timestamp of one series. Getting this shape right is half the battle.# multiple signals -> add a "kind" column: # id | time | kind | valueStack different measurements under akindcolumn and passcolumn_kind.df.melt(id_vars=["id","time"]) # wide -> long, if neededIf your data is wide (one column per series/signal), reshape with pandasmeltfirst.