Package: tsflex
tsflexis a toolkit forflexibletimeseriesprocessing&feature extraction, that is efficient and makes few assumptions about sequence data.Useful linksPaperDocumentationExample (machine learning) notebooksInstallationcommandpippip install tsflexcondaconda install -c conda-forge tsflexUsagetsflexis built to be intuitive, so we encourage you to copy-paste this code and toy with some parameters!Feature extractionimportpandasaspd;importnumpyasnp;importscipy.statsasssfromtsflex.featuresimportMultipleFeatureDescriptors,FeatureCollectionfromtsflex.utils.dataimportload_empatica_data# 1. Load sequence-indexed data (in this case a time-index)df_tmp,df_acc,df_ibi=load_empatica_data(['tmp','acc','ibi'])# 2. Construct your feature extraction configurationfc=FeatureCollection(MultipleFeatureDescriptors(functions=[np.min,np.mean,np.std,ss.skew,ss.kurtosis],series_names=["TMP","ACC_x","ACC_y","IBI"],windows=["15min","30min"],strides="15min",))# 3. Extract featuresfc.calculate(data=[df_tmp,df_acc,df_ibi],approve_sparsity=True)Note that the feature extraction is performed on multivariate data with varying sample rates.signalcolumnssample ratedf_tmp["TMP"]4Hzdf_acc["ACC_x", "ACC_y", "ACC_z" ]32Hzdf_ibi["IBI"]irregularly sampledProcessingWorking example in our docsWhy tsflex? ✨Flexible:handles multivariate/multimodal time seriesversatile function support
=>integrateswith many packages for:processing (e.g.,scipy.signal,statsmodels.tsa)feature extraction (e.g.,numpy,scipy.stats,seglearn¹,tsfresh¹,tsfel¹)feature extraction handlesmultiple strides & window sizesEfficient:view-based operations for processing & feature extraction => extremelylow memory peak&fast execution timesee:feature extraction benchmark visualizationIntuitive:maintains the sequence-index of the datafeature extraction constructs interpretable output column namesintuitive APIFew assumptionsabout the sequence data:no assumptions about sampling rateable to deal with multivariate asynchronous datai.e. data with small time-offsets between the modalitiesAdvanced functionalities:applyFeatureCollection.reduceafter feature selection for faster inferenceusefunction execution time loggingto discover processing and feature extraction bottlenecksembeddedSeriesPipeline&FeatureCollectionserializationtime serieschunking¹ These integrations are shown inintegration-example notebooks.Future work 🔨scikit-learn integration for both processing and feature extractionnote: is actively developed uponsklearn integrationbranch.Support time series segmentation (exposing under the hood strided-rolling functionality) -see this issueSupport for multi-indexed dataframes=> Also see theenhancement issuesContributing 👪We are thrilled to see your contributions to further enhancetsflex.Seethis guidefor more instructions on how to contribute.Referencing our packageIf you usetsflexin a scientific publication, we would highly appreciate citing us as:@article{vanderdonckt2021tsflex,author={Van Der Donckt, Jonas and Van Der Donckt, Jeroen and Deprost, Emiel and Van Hoecke, Sofie},title={tsflex: flexible time series processing \& feature extraction},journal={SoftwareX},year={2021},url={https://github.com/predict-idlab/tsflex},publisher={Elsevier}}Link to the paper:https://www.sciencedirect.com/science/article/pii/S2352711021001904👤Jonas Van Der Donckt, Jeroen Van Der Donckt, Emiel Deprost