A Julia package wrapping catchaMouse16, which is a set of 16 time-series features shown to be performant in BOLD fMRI time-series classification problems. This package mirrors Catch22.jl, which is a set of 22 features for general time-series problems.
The catchaMouse16 repository provides these 22 features, originally coded in Matlab as part of the hctsa toolbox, as C functions (in addition to Matlab and Python wrappers). This package simply uses Julia's ccall
to wrap these C functions from a shared library that is accessed through catchaMouse16_jll and compiled by the fantastic BinaryBuilder package.
Below we provide a brief getting-started guide to using CatchaMouse16.jl. For more detailed information on the catchaMouse16 feature set, such as in-depth descriptions of each feature and a list of publications that use catchaMouse16, see the catchaMouse16 wiki.
using Pkg
Pkg.add("CatchaMouse16")
using CatchaMouse16
The input time series can be provided as a Vector{Float64}
or Array{Float64, 2}
. If an array is provided, the time series must occupy its columns. For example, this package contains a few test time series from catchaMouse16:
๐ฑ = CatchaMouse16.testdata[:testSinusoid] # a Vector{Float64}
X = randn(1000, 10) # an Array{Float64, 2} with 10 time series
A list of features (as symbols) can be obtained with getnames(catchaMouse16)
and their short descriptions with getdescriptions(catchaMouse16)
. Each feature can be evaluated for a time series array or vector with the catchaMouse16
FeatureSet
. For example, the feature AC_nl_035
can be evaluated using:
f = catchaMouse16[:AC_nl_035](๐ฑ) # Returns a scalar Float64
๐ = catchaMouse16[1](X) # Returns a 1ร10 Matrix{Float64}
All features are returned as Float64's, even though some may be constrained to the integers.
Alternatively, functions that calculate each feature individually are exported. AC_nl_035
can be evaluated with:
f = AC_nl_035(๐ฑ)
All catchaMouse16 features can be evaluated with:
๐ = catchaMouse16(๐ฑ)
F = catchaMouse16(X)
If an array is provided, containing one time series in each of N columns, then a 22รN FeatureArray
of feature values will be returned (a subtype of AbstractDimArray).
A FeatureArray
has most of the properties and methods of an Array but is annotated with feature names that can be accessed with getnames(F)
.
If a vector is provided (a single time series) then a vector of feature values will be returned as a FeatureVector
, a one-dimensional FeatureArray
.
Finally, note that since catchaMouse16
is a FeatureSet
it can be indexed with a vector of feature names as symbols to calculate a FeatureArray
for a subset of catchaMouse16. For details on the Feature
, FeatureSet
and FeatureArray
types check out the package docs.
Calculating features for a single time series of a given length: