Is there any way to get the N most relevant features in TSFRESH? Currently, the method extract_relevant_features has a parameter fdr_level, but for a big amount of time series (>1000), the function with a very low fdr_level parameter (< 0.01) returns more than 400 features. I would like to return the 20 or 40 most relevant features.
Asked
Active
Viewed 1,079 times
3
-
See also this similar question and answer: [Selecting only a certain number of top features using tsfresh](https://stackoverflow.com/questions/65204734/selecting-only-a-certain-number-of-top-features-using-tsfresh) – makeyourownmaker Nov 13 '22 at 11:18
1 Answers
1
You could use the function calculate_relevance_table
(link to the docu) (which is called internally in the select_features
method, which in turn is called in the extract_relevant_features
method) to get the p-value for each of the features and then only use the TOP-N sorted by p-value.
So the general flow would be:
- extract all features with
extract_features
- call
calculate_relevance_table
- sort by p-value
- get only the top N
You could even tell tsfresh
the next time to only extract those features (to save a lot of computation time) following this.

nilpferd1991
- 156
- 5