Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

'DataFrame' object has no attribute 'time_series_features_extractor' using tsfel with python

So I’m working on a machine learning assignment in Python using google colab and I’m currently using pandas and tsfel for the feature extraction. The issue is that I can only run the feature extraction method(tsfel.time_series_feature_extracton()) once. Any other attempt to use the method again gives the error, "’DataFrame’ object has no attribute ‘time_series_features_extractor’". Any help on this would be greatly appreciated.

import pandas as pd
import tsfel

#just for clarification the df_time_wlk, df_sub_WLKFULL, df_WlkFull are dataframes

#config for the specific type of features I want to get
cfg=tsfel.get_features_by_domain('statistical')

#Making a new dataframe by copying two columns from another dataframe
t_time_wlk=df_WlkFull[['t_start','t_end']].copy()

#Extracting features from the new dataframe
#Running this first one works
tsfel = tsfel.time_series_features_extractor(cfg, t_time_wlk)
tsfel

#Extracting features from another dataframe
#This is where the error happens
sub_XYZ=tsfel.time_series_features_extractor(cfg,df_sub_WLKFULL)
sub_XYZ

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You override tsfel:

#         v-- the module       
tsfel = tsfel.time_series_features_extractor(cfg, t_time_wlk)
# ^-- now it's a dataframe

Documentation:

tsfel.feature_extraction.calc_features.time_series_features_extractor

Returns: Extracted features
Return type: DataFrame

Solution: choose another name

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading