Reputation: 1
I'm new using tsfresh, when I use the following lines, I get the extracted feature as desired
import numpy as np
import pandas as pd
from tsfresh.feature_extraction import ComprehensiveFCParameters
from tsfresh import extract_features
df = pd.DataFrame(np.array([[1, 2, 3, 4],[1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4]]),
columns=['Context ID','Time Elapsed', 'time_serie A', 'time_serie B'])
settings = ComprehensiveFCParameters()
kind_to_fc_parameters = {
"time_serie A": {},
"time_serie B": {"mean": None}
}
extract_features = extract_features(df, kind_to_fc_parameters =kind_to_fc_parameters,
column_id='Context ID', column_sort="Time Elapsed")
extract_features
However, when I change {"mean": None}
by {"absolute_maximum": None}
or "count_above": [{"t": 0.05}]
it'won't work anymore:
module 'tsfresh.feature_extraction.feature_calculators' has no attribute 'absolute_maximum'
What do I miss ?
Upvotes: 0
Views: 849
Reputation: 2005
I just had a similar issue with another calculation I chose and found it's just not in the feature_calculators.py
(you can open it from yourdirectory\Python\Python37\Lib\site-packages\tsfresh\feature_extraction
), so I did pip install tsfresh -U
in terminal to get the latest tsfresh, checked feature_calculators.py
again, my desired function is there and code runs fine then.
Upvotes: 0