catch22: CAnonical Time-series CHaracteristics
catch22 GitHub
  • Welcome to catch22
    • Citing catch22
    • Publications using catch22
  • LANGUAGE-SPECIFIC DOCS
    • Python
    • MATLAB
    • R
    • Julia
    • C-compiled
  • INFORMATION ABOUT CATCH22
    • Feature Descriptions
      • Feature Overview Table
      • Distribution shape
      • Extreme event timing
      • Linear autocorrelation structure
      • Nonlinear autocorrelation
      • Symbolic
      • Incremental differences
      • Simple forecasting
      • Self-affine scaling
      • Other
    • API Reference
      • Python API
      • Julia API
      • R API
      • MATLAB API
    • Contributing to catch22
      • Contributor Code of Conduct
    • Related Packages
    • License
Powered by GitBook
On this page
  • catch22_all
  • Syntax
  • Parameters
  • Return Value
  • Example Usage
  • Individual Feature Methods
  • Syntax
  • Parameters
  • Return Values
  • Example Usage
  1. INFORMATION ABOUT CATCH22
  2. API Reference

Python API

This is the class and function reference of pycatch22. Please refer to the user guide for further details as the class and function specifications may not be sufficient to give full context.

PreviousAPI ReferenceNextJulia API

Last updated 1 year ago

catch22_all

Extract the catch22 feature set from an input time series.

Syntax

pycatch22.catch22_all(data, catch24=False, short_names=False)

Parameters

Parameter
Type
Description

data

Input time-series data.

catch24

If True, include the two catch24 features (mean and standard deviation) in the output. Default is False.

short_names

If True, also include the short names of the features in the output. Default is False.


Return Value

The function returns a with the following keys:

Key
Type
Description

'names'

List of feature names.

'values'

List of corresponding feature values.

'short_names'

List of short feature names (if short_names=True).


Example Usage

import numpy as np
import pycatch22 as catch22

data = np.random.rand(100)
features = catch22_all(data)
print(features['names'])
# Output: ['DN_HistogramMode_5', 'DN_HistogramMode_10', 'CO_f1ecac', ..., 'SP_Summaries_welch_rect_centroid', 'FC_LocalSimple_mean3_stderr']
print(features['values'])
# Output: [0.23, 0.18, 1.52, ..., 0.04, 0.67]

features_with_catch24 = catch22_all(data, catch24=True)
print(features_with_catch24['names'][-2:])
# Output: ['DN_Mean', 'DN_Spread_Std']

features_with_short_names = catch22_all(data, short_names=True)
print(features_with_short_names['short_names'])
# Output: ['mode_5', 'mode_10', 'acf_timescale', ..., 'low_freq_power', 'forecast_error']


Individual Feature Methods

Syntax

pycatch22.DN_Mean(data)

Parameters

Parameter
Type
Description

data

Input time-series data.

Return Values

Value
Type
Description

feature

Individual feature value. Either integer or float depending on the feature method.

Example Usage

import numpy as np
from pycatch22 import DN_Mean

data = list(np.random.randn(100))
individual_feature = DN_Mean(data)
print(individual_feature)
# Output: -0.11125506527054776

The catch22 module provides direct access to the individual feature extraction methods implemented in C. These methods can be called directly using pycatch22.{name}, where {name} is the name of the feature method (as given by the long name in the ).

( or )

( or )

dictionary
table of features
array-like
bool
bool
list
list
list
list
tuple
Int
Float
Page cover image