CatchaMouse16.jl

Evaluate catchaMouse16 features in Julia
Author brendanjohnharris
Popularity
1 Star
Updated Last
4 Months Ago
Started In
July 2024

CatchaMouse16.jl

Build Status Coverage DOI

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.


Usage

Installation

using Pkg
Pkg.add("CatchaMouse16")
using CatchaMouse16

Input time series

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

Evaluating a feature

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(๐ฑ)

Evaluating a feature set

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.


Single-threaded performance

Calculating features for a single time series of a given length: scaling

Multithreaded performance

Calculating features for 100 time series of a given length: multithread_scaling

Used By Packages

No packages found.