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
Contrastive Loss Gradient Attack (CLGA)

Contrastive Loss Gradient Attack (CLGA) Official implementation of Unsupervised Graph Poisoning Attack via Contrastive Loss Back-propagation, WWW22 Bu

12 Dec 23, 2022
Official code for the paper "Self-Supervised Prototypical Transfer Learning for Few-Shot Classification"

Self-Supervised Prototypical Transfer Learning for Few-Shot Classification This repository contains the reference source code and pre-trained models (

EPFL INDY 44 Nov 04, 2022
This repository contains all the code and materials distributed in the 2021 Q-Programming Summer of Qode.

Q-Programming Summer of Qode This repository contains all the code and materials distributed in the Q-Programming Summer of Qode. If you want to creat

Sammarth Kumar 11 Jun 11, 2021
Spectralformer: Rethinking hyperspectral image classification with transformers

The code in this toolbox implements the "Spectralformer: Rethinking hyperspectral image classification with transformers". More specifically, it is detailed as follow.

Danfeng Hong 104 Jan 04, 2023
Official code for "Mean Shift for Self-Supervised Learning"

MSF Official code for "Mean Shift for Self-Supervised Learning" Requirements Python = 3.7.6 PyTorch = 1.4 torchvision = 0.5.0 faiss-gpu = 1.6.1 In

UMBC Vision 44 Nov 21, 2022
Implementation of temporal pooling methods studied in [ICIP'20] A Comparative Evaluation Of Temporal Pooling Methods For Blind Video Quality Assessment

Implementation of temporal pooling methods studied in [ICIP'20] A Comparative Evaluation Of Temporal Pooling Methods For Blind Video Quality Assessment

Zhengzhong Tu 5 Sep 16, 2022
Airborne Optical Sectioning (AOS) is a wide synthetic-aperture imaging technique

AOS: Airborne Optical Sectioning Airborne Optical Sectioning (AOS) is a wide synthetic-aperture imaging technique that employs manned or unmanned airc

JKU Linz, Institute of Computer Graphics 39 Dec 09, 2022
Res2Net for Instance segmentation and Object detection using MaskRCNN

Res2Net for Instance segmentation and Object detection using MaskRCNN Since the MaskRCNN-benchmark of facebook is deprecated, we suggest to use our mm

Res2Net Applications 55 Oct 30, 2022
Codes for building and training the neural network model described in Domain-informed neural networks for interaction localization within astroparticle experiments.

Domain-informed Neural Networks Codes for building and training the neural network model described in Domain-informed neural networks for interaction

DIDACTS 0 Dec 13, 2021
Code for "Finding Regions of Heterogeneity in Decision-Making via Expected Conditional Covariance" at NeurIPS 2021

Finding Regions of Heterogeneity in Decision-Making via Expected Conditional Covariance Justin Lim, Christina X Ji, Michael Oberst, Saul Blecker, Leor

Sontag Lab 3 Feb 03, 2022
Julia package for multiway (inverse) covariance estimation.

TensorGraphicalModels TensorGraphicalModels.jl is a suite of Julia tools for estimating high-dimensional multiway (tensor-variate) covariance and inve

Wayne Wang 3 Sep 23, 2022
PConv-Keras - Unofficial implementation of "Image Inpainting for Irregular Holes Using Partial Convolutions". Try at: www.fixmyphoto.ai

Partial Convolutions for Image Inpainting using Keras Keras implementation of "Image Inpainting for Irregular Holes Using Partial Convolutions", https

Mathias Gruber 871 Jan 05, 2023
Official source code of paper 'IterMVS: Iterative Probability Estimation for Efficient Multi-View Stereo'

IterMVS official source code of paper 'IterMVS: Iterative Probability Estimation for Efficient Multi-View Stereo' Introduction IterMVS is a novel lear

Fangjinhua Wang 127 Jan 04, 2023
Text-to-SQL in the Wild: A Naturally-Occurring Dataset Based on Stack Exchange Data

SEDE SEDE (Stack Exchange Data Explorer) is new dataset for Text-to-SQL tasks with more than 12,000 SQL queries and their natural language description

Rupert. 83 Nov 11, 2022
Python package for missing-data imputation with deep learning

MIDASpy Overview MIDASpy is a Python package for multiply imputing missing data using deep learning methods. The MIDASpy algorithm offers significant

MIDASverse 77 Dec 03, 2022
Code for the paper "Relation of the Relations: A New Formalization of the Relation Extraction Problem"

This repo contains the code for the EMNLP 2020 paper "Relation of the Relations: A New Paradigm of the Relation Extraction Problem" (Jin et al., 2020)

YYY 27 Oct 26, 2022
Supplementary code for the experiments described in the 2021 ISMIR submission: Leveraging Hierarchical Structures for Few Shot Musical Instrument Recognition.

Music Trees Supplementary code for the experiments described in the 2021 ISMIR submission: Leveraging Hierarchical Structures for Few Shot Musical Ins

Hugo Flores García 32 Nov 22, 2022
Node Editor Plug for Blender

NodeEditor Blender的程序化建模插件 Show Current 基本框架:自定义的tree-node-socket、tree中的node与socket采用字典查询、基于socket入度的拓扑排序 数据传递和处理依靠Tree中的字典,socket传递字典key TODO 增加更多的节点

Cuimi 11 Dec 03, 2022
Explainable Medical ImageSegmentation via GenerativeAdversarial Networks andLayer-wise Relevance Propagation

MedAI: Transparency in Medical Image Segmentation What is this repo This repo contains the code and experiments that are implemented to contribute in

Awadelrahman M. A. Ahmed 1 Nov 22, 2021
Deep Learning Pipelines for Apache Spark

Deep Learning Pipelines for Apache Spark The repo only contains HorovodRunner code for local CI and API docs. To use HorovodRunner for distributed tra

Databricks 2k Jan 08, 2023