Error with feature selection. #873
-
I am trying to extract features for machine learning using tsfresh. It worked for feature extraction. However, when I try to do feature selection, an error popped up:
It seems the X and y have different shapes. df1 => (23400, 3) What should I do to correct the error? Thank you. Here is the code:
Here is the input data (id is the 26 English letters):
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @renzha-miun! If you want to do a prediction use case (which would fit to having as many target entries as time steps), you need to "roll" the data first. Have a look into our documentation |
Beta Was this translation helpful? Give feedback.
Hi @renzha-miun!
tsfresh will extract one set of features (= one row in the output dataframe) per time series you give to it - which means one per unique ID. It will treat all data for the same ID as belonging together (and forming one time series).
So as you have 26 IDs, your resulting dataframe will have 26 rows.
This is optimized for the typical classification use case: you want to predict a single class for each time series (or ID). So we assume you have as many entries in the target vector as you have time series (and IDs).
If you want to do a prediction use case (which would fit to having as many target entries as time steps), you need to "roll" the data first. Have a look into our d…