Highly comparative time-series analysis

Overview

〰️ hctsa 〰️ : highly comparative time-series analysis

DOI Twitter

hctsa is a software package for running highly comparative time-series analysis using Matlab (full support for versions R2018b or later).

The software provides a code framework that enables the extraction of thousands of time-series features from a time series (or a time-series dataset). It also provides a range of tools for visualizing and analyzing the resulting time-series feature matrix, including:

  1. Normalizing and clustering the data,
  2. Producing low-dimensional representations of the data,
  3. Identifying and interpreting discriminating features between different classes of time series,
  4. Learning multivariate classification models.

Feel free to email me for help with real-world applications of hctsa 🤓

Acknowledgement 👍

If you use this software, please read and cite these open-access articles:

Feedback, as email, github issues or pull requests, is much appreciated.

For commercial use of hctsa, including licensing and consulting, contact Engine Analytics.

Getting Started 😊

Documentation 📖

Comprehensive documentation for hctsa, from getting started through to more advanced analyses is on gitbook.

Downloading the repository ⬇️

For users unfamiliar with git, the current version of the repository can be downloaded by simply clicking the green Code button, and then clicking Download ZIP.

It is recommended to use the repository with git. For this, please make a fork of it, clone it to your local machine, and then set an upstream remote to keep it synchronized with the main repository e.g., using the following code:

git remote add upstream git://github.com/benfulcher/hctsa.git

(make sure that you have generated an ssh key and associated it with your Github account).

You can then update to the latest stable version of the repository by pulling the master branch to your local repository:

git pull upstream master

For analyzing specific datasets, we recommend working outside of the repository so that incremental updates can be pulled from the upstream repository. Details on how to merge the latest version of the repository with the local changes in your fork can be found here.

Related resources

CompEngine 💥

CompEngine is an accompanying web resource for this project. It is a self-organizing database of time-series data that allows users to upload, explore, and compare thousands of diverse types of time-series data. This vast and growing collection of time-series data can also be downloaded. Go have a play, read more about it in our 📙 paper, or watch a talk on YouTube.

catch22 2️⃣ 2️⃣

Is over 7000 just a few too many features for your application? Do you not have access to a Matlab license? catch22 has all of your faux-rhetorical questions covered. This reduced set of 22 features, determined through a combination of classification performance and mutual redundancy as explained in this paper, is available here as an efficiently coded C implementation with wrappers for python, R, and Julia.

hctsa datasets and example workflows 💾

There are a range of open datasets with pre-computed hctsa features, as well as some examples of hctsa workflows.

(If you have data to share and host, let me know and I'll add it to this list)

Running hctsa on a cluster 💻

Matlab code for computing features for an initialized HCTSA.mat file, by distributing the computation across a large number of cluster jobs (using pbs or slurm schedulers) is here.

Publications 📕

hctsa has been used by us and others to do new science in neuroscience, engineering, and biomedicine. An updated list of publications using hctsa is on this wiki page.

hctsa licenses

Internal licenses

There are two licenses applied to the core parts of the repository:

  1. The framework for running hctsa analyses and visualizations is licensed as the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. A license for commercial use is available from Engine Analytics.

  2. Code for computing features from time-series data is licensed as GNU General Public License version 3.

A range of external code packages are provided in the Toolboxes directory of the repository, and each have their own associated license (as outlined below).

External packages and dependencies

Many features in hctsa rely on external packages and Matlab toolboxes. In the case that some of them are unavailable, hctsa can still be used, but only a reduced set of time-series features will be computed.

hctsa uses the following Matlab Add-On Toolboxes: Statistics and Machine Learning, Signal Processing, Curve Fitting, System Identification, Wavelet, and Econometrics.

The following external time-series analysis code packages are provided with the software (in the Toolboxes directory), and are used by our main feature-extraction algorithms to compute meaningful structural features from time series:

Other time-series analysis resources

A collection of good resources for time-series analysis (including in other programming languages like python and R) are on the wiki.

Acknowledgements 👋

Many thanks go to Romesh Abeysuriya for helping with the mySQL database set-up and install scripts, and Santi Villalba for lots of helpful feedback and advice on the software.

Comments
  • nn_prepare.m as a function is not supported and a whole host of other errors

    nn_prepare.m as a function is not supported and a whole host of other errors

    I am using Ethoscope velocity data to distinguish between genotype. I don't have a license for the econometrics toolbox so I get a few errors about that. Additionally I get errors about functions not being supported. Are these issue with my installation or is it because the data is not amenable to that particular analysis?

    Execution of script nn_prepare as a function is not supported:
    /home/luca/Toolboxes/OpenTSTOOL/tstoolbox/mex/nn_prepare.m
    
    opened by posttenebre 8
  • Stochasticity

    Stochasticity

    Some operations output results that depend on the random seed, and thus running the same operation on the same time series can produce different results if run multiple times. A solution to this is required, and could be done by allowing a random seed input to each non-deterministic function, to allow reproducible results. If none is provided, a default could be rng('default') at the start of each function. I should implement this as a priority going forward.

    bug 
    opened by benfulcher 6
  • TS_GetIDs returns brace indexing error

    TS_GetIDs returns brace indexing error

    Hi Ben,

    I get this error when trying to GetIds of a part of name from the Operations.Name table.

    When I leave the 'Name' flag out it searches the keywords field and it works fine.

    >> OperationIDs = TS_GetIDs('mystring', myFile, 'ops', 'Name');
    Loading data from....mat... Done.
    Brace indexing is not supported for variables of this type.
    
    Error in TS_GetIDs (line 114)
                cmatch = find(contains(theDataTable.Name,theMatchString{i}));
    

    However it works when I use 'contains' below (partially copying the method used in keywords). I'm not sure the reason for the loop in Name using cmatch?

        case {'name','Name'}
            % The cell of comma-delimited keyword strings:
            theKeywordCell = theDataTable.Name;
    
            % Find objects with a keyword that matches the input string:
            matches = find(contains(theKeywordCell, theMatchString));
    
            % Return the IDs of the matches:
            IDs = theDataTable.ID(matches);
    
            % Check for empty:
            if isempty(IDs)
                warning('No matches to ''%s'' found in %s',theMatchString,theDataFile)
            end
    
    opened by LJGz 5
  • TISEAN d2 leaves temporary files undeleted

    TISEAN d2 leaves temporary files undeleted

    opened by sdvillal 5
  • Multivariate time series analysis

    Multivariate time series analysis

    Hello,

    Thank you for such an amazing tool. I'm wondering about how to approach multivariate time series using hctsa. Is there a special way of assigning the keywords before using TS_LabelGroups?

    Thank you in advance, Konstantin

    opened by smetanadvorak 4
  • database connection error

    database connection error

    mysql_dbopen.m throws error even after including the appropriate connector via

    javaaddpath('/home/philip/work/CompEngineMatlab/Database/mysql-connector-java-5.1.34-bin.jar')
    
    % -- Error -- 
    Error using mysql_dbopen (line 24)
    Error with java database connector: Java exception occurred:
    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
    
    opened by Philiphorst 4
  • Not able to skip User input

    Not able to skip User input "y" in TS_Init

    Hi,

    I am trying to extract the temporal features from a large number of BOLD resting state fMRI signals using hctsa toolbox. Therefore, I have written a script which loads keyword matrices, labels, and timeseries in a loop and inputs them sequentially to TS_Init for creation of HCTSA.mat files. But, for each loop the algorithm requires a user input "y" to confirm the time series. I could not find the corresponding line of the code in "TS_Init.m" file of the toolbox to modify it and skip this step, and I was wondering if you could please guide me towards solving this issue.

    Thank you for the great toolbox. Regards, Ali

    opened by javanray 3
  • Wrong_TS_Classify

    Wrong_TS_Classify

    Hi Ben,

    I have been using your HCTSA toolbox for sometime and had a question. HCTSA is an outstanding job. When I get start with "hctsa_phenotypingWorm-master" and "hctsa_phenotypingFly-master" project. Here was the question that plotconfusion(realLabels,predictLabels); plotconfusion (line 111) update_args = standard_args(args{:}); plotconfusion>standard_args (line 255) Value is not a matrix or cell array. I did not understand how to solve this problem. Can you give me some suggestions?

    opened by ozone521 3
  • Multivariate TS classification

    Multivariate TS classification

    Dear Ben, first of all thank you for all the work and effort you put into the hctsa package. It has been really helpful so far!

    In the beginning I was dealing with a single sensor to monitor a pressure ts. The classification is mostly a 2-class but can also be a multiple class problem. Now, I have multiple sensors available that monitor one and the same process. I would like to include possible relations and dependencies between the sampled variables into my analsis. Therefore, I like to ask if you have made any experience yet on how to implement a multivariate ts analysis in a smart way, still using all the beautiful functions within this package.

    Thank you in advance and best regards, Alex

    opened by zeisal 3
  • Re: Forecasting

    Re: Forecasting

    Hi,

    I'm generating features for a forecasting application. I require "causal" features, i.e. features that at any point in time do not use future information. I noted that there is a subset of features with the keyword 'forecasting.' Are these all causal? Are any features in other subsets also causal? Is there a simple way to extract only those sorts of features?

    Thanks for any help on this matter, Gavin.

    opened by xenmind 3
  • Update TS_plot_timeseries.m

    Update TS_plot_timeseries.m

    Hi Ben, added the legend into the time series plot. The code may seem a little clunky so feel free to edit/make it a bit nicer :)

    Also went through and added further options to TS_classify so classification rates are returned, and there is the option to suppress the confusion matrix.

    Nic

    opened by nic-barbara 3
  • Error using compile_mex

    Error using compile_mex

    When I try to compile the install.m file I get this error:

    Error using compile_mex An error occurred while compiling ML_Fastdfa_core C code. It appears that mex is not set up to work on this system (cf. 'doc mex' and 'mex -setup'). Get 'mex ML_fastdfa_core.c' to work, and then re-run compile_mex.m

    In the code warns you of this but I do not know how to configure it 'Please make sure that mex is set up with the right compilers for this system.'

    opened by Carlosrrn 1
  • compile_mex error from range_search.cpp file

    compile_mex error from range_search.cpp file

    Hi Ben,

    I have encountered an error when compiling MEX as part of the installation process. When compiling the OpenTSTOOL, I get a series of warnings followed by an error. This is generated from the range_search.cpp file line 116 (see screenshot below): Screenshot 2022-09-19 at 10 52 11

    I suspect that the error arises as the code is trying to compare a range to an integer, which is an invalid operation? When justifying that part of the code, the MEX is compiled successfully (see screenshot below): Screenshot 2022-09-19 at 10 52 53

    I just wanted to share this and I would be grateful for any suggestions. FYI - I am using macOS Catalina v10.15.7 and Matlab R2021a.

    Many thanks! Irene

    opened by faimai00 1
  • TS_Classify produces an

    TS_Classify produces an "Unrecognized function or variable 'foldLosses'" error when trying to save the classifier

    Hi Ben

    I'm just trying to save the classifier produced by TS_Classify, and I'm getting an error saying both Unrecognized function or variable 'foldLosses', and Unrecognized function or variable 'whatLoss'. It looks like these variables are no longer produced by TS_Classify (when I use the find function to look for the variables within TS_Classify, they are not produced as outputs on any line). When I comment out the lines that require these variables, the function works.

    It looks like the aspect of the TS_Classify function that utilizes these variables might have been removed at some stage, because I've noticed the following in the output description (I was also interested in the doPCs option, but couldn't work out how to perform it):

    %---OUTPUTS: % Text output on classification rate using all features, and if doPCs = true, also % shows how this varies as a function of reduced PCs (text and as an output plot) % foldLosses, the performance metric across repeats of cross-validation % nullStats, the performance metric across randomizations of the data labels % jointClassifier, details of the saved all-features classifier

    Kind regards,

    Neil

    opened by NeilwBailey 1
  • Consider a cloud CI service

    Consider a cloud CI service

    Given public open source projects have free support for cloud ci services, consider leveraging one of them here. 🎉

    https://blogs.mathworks.com/developer/2020/12/15/cloud-ci-services/

    opened by acampbel 1
  • Analysis methods mistreat missing values

    Analysis methods mistreat missing values

    Analysis methods, like TS_TopFeatures, assume that there are no errors in the data matrix (i.e., that all bad values have been filtered out of the dataset, using TS_normalize). There should be better checks on this, to avoid the zeros in TS_DataMat being treated as actual zeros (rather than error symbols in TS_Quality. Best solution would be to use data in TS_Quality to restrict the computation to good values (where meaningful analysis is possible), e.g., in the case of TS_TopFeatures.

    bug 
    opened by benfulcher 0
  • Operations -> Features

    Operations -> Features

    Perhaps it's time to update the terminology, since Feature is more common usage than Operation. Could consider changing the name of the Operations data object to Features...

    opened by benfulcher 0
Releases(v1.07)
  • v1.07(Jul 22, 2022)

    • TS_SimSearch supports interactive plots to swap between raw and ranked values in scatter plots
    • Better error messaging for computation
    • install script checks for required toolboxes
    • 'svmBeta' option to score individual features on SVM beta weights: added to TS_TopFeatures
    • Better checks on input data type (e.g., singles or integers) in feature computation
    • Improved reporting of in-fold and out-of-fold accuracies in k-fold CV classification
    • Logistic regression added to classifiers, as well as svm-linear (high-dim) default (original available as svm-linear-lowdim)
    • TS_ClassifyLowDim expanded functionality to check for in-sample over-fitting
    • Null testing improved with option for simple shuffle-based nulls (under assumption that random in -> random out; rather than full model-based nulls)
    • Improved visualization settings in TS_TopFeatures (including Spearman correlations now default)
    • signed p-value test statistic from rank-sum test added in TS_TopFeatures
    • Improved syntax for TS_Init for selecting a feature set by name.
    • Progress bar option for new minimal output versions of TS_Compute as 'fast' and 'minimal' (in cases like with catch22 where full output makes the commandline unreadable.
    • Some feature keywords improved.
    Source code(tar.gz)
    Source code(zip)
  • v1.06(Aug 5, 2021)

    • Interactive plotting (annotations added in response to mouse clicks) in TS_LowDimInspect and TS_FeatureSummary
    • Histogram binning now done in a simpler and more transparent way, to match C implementation in catch22 (in DN_HistogramMode).
    • New histogram asymmetry features added via DN_HistogramAsymmetry.
    Source code(tar.gz)
    Source code(zip)
  • v1.05(Jan 8, 2021)

    • Clearer naming of the CO_HistogramAMI features
    • New nsadf feature
    • New features of first maximum of various self-correlation function (rather than just first min) added.
    • Various additional fixes
    Source code(tar.gz)
    Source code(zip)
  • v1.04(Jul 22, 2020)

    • Clearer naming of CO_HistogramAMI features
    • Ability to specify reduced feature subsets in cfnParams (that will be applied in TS_Classify, TS_ClassifyLowDim, TS_TopFeatures, TS_PlotLowDim)
    • Clearer keyword labeling of 'locDep' -> 'locationDependent', etc.
    Source code(tar.gz)
    Source code(zip)
  • v1.03(Jul 2, 2020)

    Added continuous analogues of first crossings

    CO_FirstZero and CO_f1ecac combined into CO_FirstCrossing, and added discrete (first time lag the ACF exceeds the threshold) and continuous (linear interpolation for the crossing estimate, between previous and subsequent time points). Also an issue with BF_PreProcess consistency and with 'absclose' being incorrectly set to 'saturate' causing an issue for DN_RemovePoints

    Source code(tar.gz)
    Source code(zip)
  • v1.02(May 17, 2020)

  • v1.01(May 16, 2020)

  • v1.0(Jul 11, 2019)

    Tweaked some features, fixed some errors. Semantic versioning practices are not quite valid for hctsa's feature library (where every slight change to any feature makes hctsa results inconsistent with every previous version). But it's about time we had a v1.0!

    Source code(tar.gz)
    Source code(zip)
  • v0.99(Feb 15, 2019)

    Cleaning of poor-performing features, FourierPowerSpectrum keyword used, TS_plot_timeseries -> TS_PlotTimeSeries for consistent naming convention, improvement in Gaussian mutual information computation.

    Source code(tar.gz)
    Source code(zip)
  • 0.98(Sep 3, 2018)

    • Metadata for TimeSeries, Operations, and MasterOperations are now stored in tables (rather than clunkier cell arrays).
    • TS_plot_pca renamed TS_PlotLowDim and now supports tSNE projections.
    • Added very simple function for reducing the number of features as TS_ReduceFeatureSet.
    Source code(tar.gz)
    Source code(zip)
  • v0.96(Mar 5, 2018)

  • v0.92(Mar 5, 2018)

Owner
Ben Fulcher
I use methods from physics and statistics to understand the structure and dynamics of complex systems like the brain
Ben Fulcher
Implementation of parameterized soft-exponential activation function.

Soft-Exponential-Activation-Function: Implementation of parameterized soft-exponential activation function. In this implementation, the parameters are

Shuvrajeet Das 1 Feb 23, 2022
ICCV2021 - A New Journey from SDRTV to HDRTV.

ICCV2021 - A New Journey from SDRTV to HDRTV.

XyChen 82 Dec 27, 2022
Spectral Temporal Graph Neural Network (StemGNN in short) for Multivariate Time-series Forecasting

Spectral Temporal Graph Neural Network for Multivariate Time-series Forecasting This repository is the official implementation of Spectral Temporal Gr

Microsoft 306 Dec 29, 2022
When BERT Plays the Lottery, All Tickets Are Winning

When BERT Plays the Lottery, All Tickets Are Winning Large Transformer-based models were shown to be reducible to a smaller number of self-attention h

Sai 16 Nov 10, 2022
The Ludii general game system, developed as part of the ERC-funded Digital Ludeme Project.

The Ludii General Game System Ludii is a general game system being developed as part of the ERC-funded Digital Ludeme Project (DLP). This repository h

Digital Ludeme Project 50 Jan 04, 2023
🔪 Elimination based Lightweight Neural Net with Pretrained Weights

ELimNet ELimNet: Eliminating Layers in a Neural Network Pretrained with Large Dataset for Downstream Task Removed top layers from pretrained Efficient

snoop2head 4 Jul 12, 2022
A Parameter-free Deep Embedded Clustering Method for Single-cell RNA-seq Data

A Parameter-free Deep Embedded Clustering Method for Single-cell RNA-seq Data Overview Clustering analysis is widely utilized in single-cell RNA-seque

AI-Biomed @NSCC-gz 3 May 08, 2022
Rotary Transformer

[中文|English] Rotary Transformer Rotary Transformer is an MLM pre-trained language model with rotary position embedding (RoPE). The RoPE is a relative

325 Jan 03, 2023
This is an official PyTorch implementation of Task-Adaptive Neural Network Search with Meta-Contrastive Learning (NeurIPS 2021, Spotlight).

NeurIPS 2021 (Spotlight): Task-Adaptive Neural Network Search with Meta-Contrastive Learning This is an official PyTorch implementation of Task-Adapti

Wonyong Jeong 15 Nov 21, 2022
Hyperbolic Image Segmentation, CVPR 2022

Hyperbolic Image Segmentation, CVPR 2022 This is the implementation of paper Hyperbolic Image Segmentation (CVPR 2022). Repository structure assets :

Mina Ghadimi Atigh 46 Dec 29, 2022
A repo for Causal Imitation Learning under Temporally Correlated Noise

CausIL A repo for Causal Imitation Learning under Temporally Correlated Noise. Running Experiments To re-train an expert, run: python experts/train_ex

Gokul Swamy 5 Nov 01, 2022
Implementation of the paper Recurrent Glimpse-based Decoder for Detection with Transformer.

REGO-Deformable DETR By Zhe Chen, Jing Zhang, and Dacheng Tao. This repository is the implementation of the paper Recurrent Glimpse-based Decoder for

Zhe Chen 33 Nov 30, 2022
Code to replicate the key results from Exploring the Limits of Out-of-Distribution Detection

Exploring the Limits of Out-of-Distribution Detection In this repository we're collecting replications for the key experiments in the Exploring the Li

Stanislav Fort 35 Jan 03, 2023
OpenMMLab Model Deployment Toolset

Introduction English | 简体中文 MMDeploy is an open-source deep learning model deployment toolset. It is a part of the OpenMMLab project. Major features F

OpenMMLab 1.5k Dec 30, 2022
Real-ESRGAN: Training Real-World Blind Super-Resolution with Pure Synthetic Data

Real-ESRGAN Real-ESRGAN: Training Real-World Blind Super-Resolution with Pure Synthetic Data Ported from https://github.com/xinntao/Real-ESRGAN Depend

Holy Wu 44 Dec 27, 2022
Code for database and frontend of webpage for Neural Fields in Visual Computing and Beyond.

Neural Fields in Visual Computing—Complementary Webpage This is based on the amazing MiniConf project from Hendrik Strobelt and Sasha Rush—thank you!

Brown University Visual Computing Group 29 Nov 30, 2022
Densely Connected Search Space for More Flexible Neural Architecture Search (CVPR2020)

DenseNAS The code of the CVPR2020 paper Densely Connected Search Space for More Flexible Neural Architecture Search. Neural architecture search (NAS)

Jamin Fong 291 Nov 18, 2022
Hand Gesture Volume Control | Open CV | Computer Vision

Gesture Volume Control Hand Gesture Volume Control | Open CV | Computer Vision Use gesture control to change the volume of a computer. First we look i

Jhenil Parihar 3 Jun 15, 2022
Official PyTorch implementation of "RMGN: A Regional Mask Guided Network for Parser-free Virtual Try-on" (IJCAI-ECAI 2022)

RMGN-VITON RMGN: A Regional Mask Guided Network for Parser-free Virtual Try-on In IJCAI-ECAI 2022(short oral). [Paper] [Supplementary Material] Abstra

27 Dec 01, 2022
Single-step adversarial training (AT) has received wide attention as it proved to be both efficient and robust.

Subspace Adversarial Training Single-step adversarial training (AT) has received wide attention as it proved to be both efficient and robust. However,

15 Sep 02, 2022