Package: pycatch22
pycatch22- CAnonical Time-series CHaracteristics in pythonAboutcatch22is a collection of 22 time-series features coded in C that can be run from Python, as well asR,Matlab, andJulia.This package provides a python implementation as the modulepycatch22, licensed under theGNU GPL v3 license(or later).What do the features do?ThisGitBooks websiteis dedicated to describing the features.
For their implementation in code, see themaincatch22repository.
There is also information in the associated paper📗 Lubba et al. (2019)..Acknowledgement :+1:If you use this software, please read and cite this open-access article:📗 Lubba et al.catch22: CAnonical Time-series CHaracteristics,Data Min Knowl Disc33, 1821 (2019).InstallationUsingpipforpycatch22:pip install pycatch22If this doesn't work, make sure you are using the latestsetuptools:pip install setuptools --upgrade.If you come across errors with version resolution, you should try something like:pip install pycatch22==0.4.2 --use-deprecated=legacy-resolver.It is also apackage on anacondathanks to@rpanai, which you can install viaconda:conda install -c conda-forge pycatch22ormamba:mamba install -c conda-forge pycatch22[A manual install (bottom of this page) is a last resort.]UsageEach feature function can be accessed individually and takes arrays as tuple or lists (notnumpyarrays).
For example, for loaded datatsDatain Python:importpycatch22tsData=[1,2,4,3]# (or more interesting data!)pycatch22.CO_f1ecac(tsData)All features are bundled in the methodcatch22_all, which also acceptsnumpyarrays and gives back a dictionary containing the entriescatch22_all['names']for feature names andcatch22_all['values']for feature outputs.Usage (computing 22 features:catch22):pycatch22.catch22_all(tsData)Usage (computing 24 features:catch24=catch22+ mean + standard deviation):pycatch22.catch22_all(tsData,catch24=True)We also include a 'short name' for each feature for easier reference (as outlined in the GitBookFeature overview table).
These short names can be included in the output fromcatch22_all()by settingshort_names=Trueas follows:pycatch22.catch22_all(tsData,catch24=True,short_names=True)Template analysis scriptThanks to@jmoo2880for putting together ademonstration notebookfor using pycatch22 to extract features from a time-series dataset.Usage notesWhen presenting results usingcatch22, you must identify the version used to allow clear reproduction of your results. For example,CO_f1ecacwas altered from an integer-valued output to a linearly interpolated real-valued output from v0.3.Important Note:catch22features only evaluatedynamicalproperties of time series and do not respond to basic differences in the location (e.g., mean) or spread (e.g., variance).Fromcatch22v0.3, If the location and spread of the raw time-series distribution may be important for your application, we suggest applying the function argumentcatch24 = Trueto your call to thecatch22function in the language of your choice.
This will result in 24 features being calculated: thecatch22features in addition to mean and standard deviation.Manual installIf you find issues with thepipinstall, you can also install usingsetuptools:python3 setup.py build
python3 setup.py install