Package: tspymfe
ts-pymfe: meta-feature extractor for one-dimensional time-seriesA backup for the pymfe expansion for time-series data. Currently, this repository contains the methods for meta-feature extraction and an modified pymfe core to run extract the meta-features.Please note that tspymfe is not intended to be a stand-alone package, and will be oficially merged (hopefully soon) to the original Pymfe package. Until then, this package is available as a beta version.There is 149 distinct metafeature extraction methods in this version, distributed in the following groups:GeneralLocal statisticsGlobal statisticsStatistical testsAutocorrelationFrequency domainInformation theoryRandomizeLandmarkingModel basedInstallFrom pip:pip install -U tspymfeor:python3 -m pip install -U tspymfeUsageTo extract the meta-features, the API behaves pretty much like the original Pymfe API:importtspymfe.tsmfeimportnumpyasnp# random time-seriests=0.3*np.arange(100)+np.random.randn(100)extractor=tspymfe.tsmfe.TSMFE()extractor.fit(ts)res=extractor.extract()print(res)Dev-installIf you downloaded directly from github, install the required packages using:pip install -Ur requirements.txtYou can run some test scripts:python test_a.py <data_id> <random_seed> <precomp 0/1>
python test_b.py <data_id> <random_seed> <precomp 0/1>Where the first argument is the test time-series id (checkdata/comp-engine-export-sample.20200503.csvfile.) and must be between 0 (inclusive) and 19 (also inclusive), the random seed must be an integer, and precomp is a boolean argument ('0' or '1') to activate the precomputation methods, used to calculate common values between various methods and, therefore, speed the main computations.Example:python test_a.py 0 16 1
python test_b.py 0 16 1The code format style is checked using flake8, pylint and mypy. You can use the Makefile to run all verifications by yourself:pip install -Ur requirements-dev.txt
make code-checkAvailable meta-features by groupBelow I present the full list of available meta-features in this package separated by meta-feature group. Also note that you can use the following methods to recover the available meta-feature, groups, and summary functions:importtspymfe.tsmfegroups=tspymfe.tsmfe.TSMFE.valid_groups()print(groups)metafeatures=tspymfe.tsmfe.TSMFE.valid_metafeatures()print(metafeatures)summaries=tspymfe.tsmfe.TSMFE.valid_summary()print(summaries)landmarking:model_arima_010_cmodel_arima_011_cmodel_arima_011_ncmodel_arima_021_cmodel_arima_100_cmodel_arima_110_cmodel_arima_112_ncmodel_expmodel_gaussianmodel_hwes_adamodel_hwes_admmodel_linearmodel_linear_acf_first_nonposmodel_linear_embedmodel_linear_seasonalmodel_loc_meanmodel_loc_medianmodel_meanmodel_mean_acf_first_nonposmodel_naivemodel_naive_driftmodel_naive_seasonalmodel_sesmodel_sinegeneral:bin_meancao_e1cao_e2diffemb_dim_caoemb_lagembed_in_shellfnn_propforce_potentialfrac_cpfs_lenlengthmoving_thresholdpeak_fracperiodpredstep_changesstep_changes_trendstick_anglestrough_fracturning_pointsturning_points_trendwalker_cross_fracwalker_pathglobal-stat:corr_dimdfaexp_hurstexp_max_lyapioe_tdelta_meankurtosis_diffkurtosis_residualskurtosis_sdiffopt_boxcox_coefsd_diffsd_residualssd_sdiffseason_strenghtskewness_diffskewness_residualsskewness_sdiffspikinesst_meantrend_strenghtlocal-stat:local_extremalocal_rangelumpinessmoving_acfmoving_acf_shiftmoving_approx_entmoving_avgmoving_avg_shiftmoving_gmeanmoving_gmean_shiftmoving_kldivmoving_kldiv_shiftmoving_kurtosismoving_kurtosis_shiftmoving_lillieforsmoving_sdmoving_sd_shiftmoving_skewnessmoving_skewness_shiftmoving_varmoving_var_shiftstabilitymodel-based:avg_cycle_periodcurvaturedes_leveldes_trendets_levelets_seasonets_trendgaussian_r_sqrioe_std_adj_r_sqrioe_std_slopelinearityinfo-theory:low_freq_powerps_entropyps_freqsps_peaksps_residualsstat-tests:test_adftest_adf_glstest_dwtest_earchtest_kpsstest_lbtest_lillieforstest_pptest_zaautocorr:acfacf_detrendedacf_diffacf_first_nonposacf_first_nonsigautocorr_crit_ptautocorr_out_distfirst_acf_locmingen_autocorrgresid_autocorrgresid_lbtestpacfpacf_detrendedpacf_difftc3trevrandomize:itrand_acfitrand_meanitrand_sdresample_first_acf_locminresample_first_acf_nonposresample_stdsurr_tc3surr_trevfreq-domain:amiami_curvatureami_detrendedami_first_critptapprox_entropycontrol_entropyhist_ent_out_diffhist_entropylz_complexitysample_entropysurpriseMain referencesPapersT.S. Talagala, R.J. Hyndman and G. Athanasopoulos. Meta-learning how to forecast time series (2018)..Kang, Yanfei., Hyndman, R.J., & Smith-Miles, Kate. (2016). Visualising Forecasting Algorithm Performance using Time Series Instance Spaces (Department of Econometrics and Business Statistics Working Paper Series 10/16).C. Lemke, and B. Gabrys. Meta-learning for time series forecasting and forecast combination (Neurocomputing
Volume 73, Issues 10–12, June 2010, Pages 2006-2016)B.D. Fulcher and N.S. Jones. hctsa: A computational framework for automated time-series phenotyping using massive feature extraction. Cell Systems 5, 527 (2017).B.D. Fulcher, M.A. Little, N.S. Jones. Highly comparative time-series analysis: the empirical structure of time series and their methods. J. Roy. Soc. Interface 10, 83 (2013).BooksHyndman, R.J., & Athanasopoulos, G. (2018) Forecasting: principles and practice, 2nd edition, OTexts: Melbourne, Australia. OTexts.com/fpp2. Accessed on April 29 2020.Packagestsfeatures (R language)hctsa (Matlab language)DataData sampled from:https://comp-engine.org/